]> source.dussan.org Git - poi.git/commitdiff
fix findbug issues introduced recently
authorPJ Fanning <fanningpj@apache.org>
Wed, 31 Jan 2018 05:52:46 +0000 (05:52 +0000)
committerPJ Fanning <fanningpj@apache.org>
Wed, 31 Jan 2018 05:52:46 +0000 (05:52 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1822758 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/poi/sl/draw/DrawTextParagraph.java
src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextRun.java

index c0c7eb21fdbfaf1a70e0a026693580de8f8c2e5a..78979c97b420b2a3f077fb18030c60169724f55d 100644 (file)
@@ -383,11 +383,11 @@ public class DrawTextParagraph implements Drawable {
 
     String getRenderableText(TextRun tr) {
         String txt = tr.getRawText();
-        txt.replace("\t", tab2space(tr)).replace("\u000b", "\n");
+        txt = txt.replace("\t", tab2space(tr)).replace("\u000b", "\n");
 
         switch (tr.getTextCap()) {
-            case ALL: txt.toUpperCase(LocaleUtil.getUserLocale()); break;
-            case SMALL: txt.toLowerCase(LocaleUtil.getUserLocale()); break;
+            case ALL: txt = txt.toUpperCase(LocaleUtil.getUserLocale()); break;
+            case SMALL: txt = txt.toLowerCase(LocaleUtil.getUserLocale()); break;
             case NONE: break;
         }
 
index 4c12a38d11c2ec96b171eb9cd549492a05b4bfa9..47a712df80cfc1e8e300ac253c3d8529c86a45c7 100644 (file)
@@ -99,7 +99,7 @@ public class XSLFTextRun implements TextRun {
 
     String getRenderableText(String txt) {
         // TODO: finish support for tabs
-        txt.replace("\t", "  ");
+        txt = txt.replace("\t", "  ");
 
         switch (getTextCap()) {
             case ALL:
@@ -589,7 +589,9 @@ public class XSLFTextRun implements TextRun {
         }
 
         Double srcFontSize = r.getFontSize();
-        if (srcFontSize != getFontSize()) {
+        if (srcFontSize == null) {
+            if (getFontSize() != null) setFontSize(null);
+        } else if(!srcFontSize.equals(getFontSize())) {
             setFontSize(srcFontSize);
         }