Change Z-index of XSLFShape

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Change Z-index of XSLFShape

jsaunders2011@gmail.com
I need to be able to programmatically control a shape's Z-index on a powerpoint slide. How can this be accomplished using apache poi?

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Change Z-index of XSLFShape

Andreas Beeker
Currently there's no API for it. You need to manipulate the xmlbeans shape array directly, i.e. change the index/order of the shape objects. As the xmlbeans are referenced by the POI usermodel classes and you would change their base underneath, this might lead to unexpected results when saving the file.
Andi
Reply | Threaded
Open this post in threaded view
|

HSLF TableCell getRowSpan() isMerged()

Teresa Kim
Hi

I upgraded Apache POI to 3.16 beta2 version and was testing two methods
especially in HSLP module:

TableCell getRowSpan(), and isMerged()

I have a table with row spaned and column spaned and called those two
methods, and I got as a response for all cells
isMerged => false, getRowSpan() => 0, although some cells have been merged.

Could you please confirm if those two methods are checking for first if
a tablecell is merged and secondly it returns the number of cells of
being spanned/merged?

I attach the example PPT table and codes for what I have been testing:

HSLFTable shape = (HSLFTable) sh;

for (int r = 0; r < table.getNumberOfRows(); r++) {

             for (int c = 0; c < table.getNumberOfColumns(); c++) {
                 HSLFTableCell tableCell = table.getCell(r,c);
                   System.out.println("merged:" + tableCell.isMerged() +
"," + tableCell.getRowSpan() + "," + tableCell.getGridSpan() + "," +
tableCell.getRawText());
                   System.out.println("Row and Column:" + "," + r + ","
+ c);

                   }
}

Thanks
T.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

table_test.ppt (162K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: HSLF TableCell getRowSpan() isMerged()

kiwiwings
Hi,

thank you for the sample file, I've just fixed the grid/rowspan code, but need to do a few more tests before I commit it.

> Could you please confirm if those two methods are checking for first if a tablecell is merged and secondly it returns the number of cells of being spanned/merged?
isMerged doesn't work for HSLF, as you don't get cells returned on places where you would get merged cells back with XSLF - see also the comment in HSLFTableCell.isMerged() ...
As noted above the row/gridspan calculation was erroneous and returned mostly "1" even when spanned.

Andi




signature.asc (495 bytes) Download Attachment