Skip to content

Bugfix setBulletStyle in XSLFTextParagraph #770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 8, 2025

Conversation

GermanAlejo
Copy link
Contributor

Having a 0 here throws IllegalArgumentException, the method setBulletAutoNumber requires 1 as minimun as argument.

Having a 0 here throws IllegalArgumentException, the method setBulletAutoNumber requires 1 as minimun as argument
@pjfanning
Copy link
Contributor

This won't be accepted unless there is a detailed description of why this is needed and test cases are needed.

@GermanAlejo
Copy link
Contributor Author

I discovered this bug while using the library myself. The method setBulletStyle from XSLFTextParagraph class calls setBulletAutoNumber method, which expects a int as a parameter (startAt) this is hardcoded so minimun value allowed is 1, if the value is less than 1 then the method will throw IllegalArgumentException

image

The problem is method setBulletStyle has a minimun hardcoded value of 0 when calling this method, which means that each time we call it with a AutoNumberingScheme argument it will always throw an IllegalArgumentException, this renders this method quite useless, changing the 0 by 1 would solve the issue.

@GermanAlejo
Copy link
Contributor Author

I have added a couple of tests, however I am not knowledgeable in testing so please let me know If this should be done in any way different or if it is insufficient and I will update the PR.

Let me know aswell if the explanation provided is not enough.

@pjfanning pjfanning merged commit bbd404f into apache:trunk Jul 8, 2025
@pjfanning
Copy link
Contributor

Thanks @GermanAlejo - merged. I will have a look out for issues and if there are, I may need to revert this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants