mirror of https://github.com/apache/poi.git
bug 60005: fix NPE in XSLFTextParagraph.getDefaultFontSize()
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1756397 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d4e3df3192
commit
0167a32f7f
|
@ -752,6 +752,10 @@ public class XSLFTextParagraph implements TextParagraph<XSLFShape,XSLFTextParagr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return master style text paragraph properties, or <code>null</code> if
|
||||||
|
* there are no master slides or the master slides do not contain a text paragraph
|
||||||
|
*/
|
||||||
/* package */ CTTextParagraphProperties getDefaultMasterStyle(){
|
/* package */ CTTextParagraphProperties getDefaultMasterStyle(){
|
||||||
CTPlaceholder ph = _shape.getCTPlaceholder();
|
CTPlaceholder ph = _shape.getCTPlaceholder();
|
||||||
String defaultStyleSelector;
|
String defaultStyleSelector;
|
||||||
|
@ -932,7 +936,11 @@ public class XSLFTextParagraph implements TextParagraph<XSLFShape,XSLFTextParagr
|
||||||
public Double getDefaultFontSize() {
|
public Double getDefaultFontSize() {
|
||||||
CTTextCharacterProperties endPr = _p.getEndParaRPr();
|
CTTextCharacterProperties endPr = _p.getEndParaRPr();
|
||||||
if (endPr == null || !endPr.isSetSz()) {
|
if (endPr == null || !endPr.isSetSz()) {
|
||||||
endPr = getDefaultMasterStyle().getDefRPr();
|
// inherit the font size from the master style
|
||||||
|
CTTextParagraphProperties masterStyle = getDefaultMasterStyle();
|
||||||
|
if (masterStyle != null) {
|
||||||
|
endPr = masterStyle.getDefRPr();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return (endPr == null || !endPr.isSetSz()) ? 12 : (endPr.getSz() / 100.);
|
return (endPr == null || !endPr.isSetSz()) ? 12 : (endPr.getSz() / 100.);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue