https://bz.apache.org/bugzilla/show_bug.cgi?id=63541

            Bug ID: 63541
           Summary: NullPointerException from XSLFSimpleShape.getAnchor
                    for empty xfrm tags
           Product: POI
           Version: 4.0.x-dev
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLF
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Created attachment 36643
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=36643&action=edit
pptx file that contains a shape for which getAnchor throws NullPointerException

I have stumbled upon a pptx file that contains a shape for which getAnchor
throws NullPointerException. The issue is with the following two lines from
XSLFSimpleShape:

    CTPoint2D off = xfrm.getOff();
    double x = Units.toPoints(off.getX());

Apparently the shape in slide1.xml contains an empty xfrm tag and an empty
path, and xfrm.getOff() returns null.

I have attached a simplified pptx file containing the weird shape. The
mentioned shape is not visible in various editors/viewers, but they show other
parts of the presentation correctly.

Test with:

    XMLSlideShow pptx = ... // attached file
    pptx.getSlides().get(0).getShapes().get(0).getAnchor();

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to