fix create issue in getUnderline

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1923440 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2025-01-29 13:20:25 +00:00
parent 72aa1f42a7
commit e51877f5a6

View File

@ -523,7 +523,10 @@ public class XWPFRun implements ISDTContents, IRunElement, CharacterRun {
* @return The underline, or null create is false and there is no underline.
*/
private CTUnderline getCTUnderline(boolean create) {
CTRPr pr = getRunProperties(true);
CTRPr pr = getRunProperties(create);
if (pr == null) {
return null;
}
return pr.sizeOfUArray() > 0 ? pr.getUArray(0) : (create ? pr.addNewU() : null);
}
@ -582,7 +585,7 @@ public class XWPFRun implements ISDTContents, IRunElement, CharacterRun {
/**
* Get the underline color for the run's underline, if any.
*
* @return The RGB color value as as a string of hexadecimal digits (e.g., "A0B2F1") or "auto".
* @return The RGB color value as a string of hexadecimal digits (e.g., "A0B2F1") or "auto".
* @since 4.0.0
*/
public String getUnderlineColor() {