Skip to content

Bugfix setBulletStyle in XSLFTextParagraph#770

Merged
pjfanning merged 2 commits intoapache:trunkfrom
GermanAlejo:trunk
Jul 8, 2025
Merged

Bugfix setBulletStyle in XSLFTextParagraph#770
pjfanning merged 2 commits intoapache:trunkfrom
GermanAlejo:trunk

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
Member

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
Member

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