This is an automated email from the ASF dual-hosted git repository.
fanningpj pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/poi.git
The following commit(s) were added to refs/heads/trunk by this push:
new f3bf31ac5d avoid creating CTUnderline
f3bf31ac5d is described below
commit f3bf31ac5da946ea8009fdf8eb85709fed0796ba
Author: PJ Fanning <[email protected]>
AuthorDate: Tue Jul 15 14:08:14 2025 +0100
avoid creating CTUnderline
---
.../java/org/apache/poi/xwpf/usermodel/XWPFRun.java | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFRun.java
b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFRun.java
index 3c0ac9eb89..29339e1453 100644
--- a/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFRun.java
+++ b/poi-ooxml/src/main/java/org/apache/poi/xwpf/usermodel/XWPFRun.java
@@ -600,16 +600,17 @@ public class XWPFRun implements ISDTContents,
IRunElement, CharacterRun {
* @since 4.0.0
*/
public String getUnderlineColor() {
- CTUnderline underline = getCTUnderline(true);
- assert(underline != null);
String colorName = "auto";
- Object rawValue = underline.getColor();
- if (rawValue != null) {
- if (rawValue instanceof String) {
- colorName = (String)rawValue;
- } else {
- byte[] rgbColor = (byte[])rawValue;
- colorName = HexDump.toHex(rgbColor[0]) +
HexDump.toHex(rgbColor[1]) + HexDump.toHex(rgbColor[2]);
+ CTUnderline underline = getCTUnderline(false);
+ if (underline != null) {
+ Object rawValue = underline.getColor();
+ if (rawValue != null) {
+ if (rawValue instanceof String) {
+ colorName = (String) rawValue;
+ } else {
+ byte[] rgbColor = (byte[]) rawValue;
+ colorName = HexDump.toHex(rgbColor[0]) +
HexDump.toHex(rgbColor[1]) + HexDump.toHex(rgbColor[2]);
+ }
}
}
return colorName;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]