poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 53568] New: Pictures in XSSF have NULL anchors
Date Thu, 19 Jul 2012 05:49:28 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=53568

          Priority: P2
            Bug ID: 53568
          Assignee: dev@poi.apache.org
           Summary: Pictures in XSSF have NULL anchors
          Severity: normal
    Classification: Unclassified
          Reporter: toni.helenius@syncrontech.com
          Hardware: PC
            Status: NEW
           Version: 3.8
         Component: XSSF
           Product: POI

Hello,

I'm converting some HSSF specific code to use the generic SS one. I keep
getting NPEs from XSSFPicture functions (using the Interface, Picture) since
they don't contain anchors. Anchors are null. This generic code works just fine
on HSSF.

I also need the locations of the images, so the getAllImages() just doesn't cut
it.

FileInputStream file = new FileInputStream(new File("c:\\temp\\test.xlsx"));
Workbook wb = WorkbookFactory.create(file);
Sheet sheet = wb.getSheetAt(0);

XSSFDrawing drawing = ((XSSFSheet)sheet).createDrawingPatriarch();

// Get the shapes
for (XSSFShape shape : drawing.getShapes()) {
    if (shape instanceof Picture) {
        ClientAnchor anchor = picture.getPreferredSize(); //Fails on XSSF, NPE
        }
    }

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message