fix findbug issues introduced recently

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1822758 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2018-01-31 05:52:46 +00:00
parent 15e1aa8b8b
commit 0cd2fdc86a
2 changed files with 7 additions and 5 deletions

View File

@ -383,11 +383,11 @@ public class DrawTextParagraph implements Drawable {
String getRenderableText(TextRun tr) { String getRenderableText(TextRun tr) {
String txt = tr.getRawText(); String txt = tr.getRawText();
txt.replace("\t", tab2space(tr)).replace("\u000b", "\n"); txt = txt.replace("\t", tab2space(tr)).replace("\u000b", "\n");
switch (tr.getTextCap()) { switch (tr.getTextCap()) {
case ALL: txt.toUpperCase(LocaleUtil.getUserLocale()); break; case ALL: txt = txt.toUpperCase(LocaleUtil.getUserLocale()); break;
case SMALL: txt.toLowerCase(LocaleUtil.getUserLocale()); break; case SMALL: txt = txt.toLowerCase(LocaleUtil.getUserLocale()); break;
case NONE: break; case NONE: break;
} }

View File

@ -99,7 +99,7 @@ public class XSLFTextRun implements TextRun {
String getRenderableText(String txt) { String getRenderableText(String txt) {
// TODO: finish support for tabs // TODO: finish support for tabs
txt.replace("\t", " "); txt = txt.replace("\t", " ");
switch (getTextCap()) { switch (getTextCap()) {
case ALL: case ALL:
@ -589,7 +589,9 @@ public class XSLFTextRun implements TextRun {
} }
Double srcFontSize = r.getFontSize(); Double srcFontSize = r.getFontSize();
if (srcFontSize != getFontSize()) { if (srcFontSize == null) {
if (getFontSize() != null) setFontSize(null);
} else if(!srcFontSize.equals(getFontSize())) {
setFontSize(srcFontSize); setFontSize(srcFontSize);
} }