sonar fixes

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1832229 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andreas Beeker 2018-05-25 10:20:44 +00:00
parent 24020f66af
commit 8c06c5f51a
2 changed files with 12 additions and 1 deletions

View File

@ -268,7 +268,7 @@ public class XSLFTableCell extends XSLFTextShape implements TableCell<XSLFShape,
private CTLineProperties setBorderDefaults(BorderEdge edge) {
final CTLineProperties ln = getCTLine(edge, true);
if (ln == null) {
return null;
throw new IllegalStateException("CTLineProperties couldn't be initialized");
}
if (ln.isSetNoFill()) {
@ -366,6 +366,9 @@ public class XSLFTableCell extends XSLFTextShape implements TableCell<XSLFShape,
}
CTLineProperties ln = setBorderDefaults(edge);
if (!ln.isSetPrstDash()) {
ln.addNewPrstDash();
}
ln.getPrstDash().setVal(STPresetLineDashVal.Enum.forInt(dash.ooxmlId));
}

View File

@ -106,6 +106,10 @@ public final class SXSSFPicture implements Picture {
@Override
public void resize(double scale){
XSSFClientAnchor anchor = getClientAnchor();
if (anchor == null) {
logger.log(POILogger.WARN, "picture is not anchored via client anchor - ignoring resize call");
return;
}
XSSFClientAnchor pref = getPreferredSize(scale);
@ -139,6 +143,10 @@ public final class SXSSFPicture implements Picture {
*/
public XSSFClientAnchor getPreferredSize(double scale){
XSSFClientAnchor anchor = getClientAnchor();
if (anchor == null) {
logger.log(POILogger.WARN, "picture is not anchored via client anchor - ignoring resize call");
return null;
}
XSSFPictureData data = getPictureData();
Dimension size = getImageDimension(data.getPackagePart(), data.getPictureType());