Hi,
there's an error in POIXMLDocumentPart.read(), i.e. the depth-first recursion to
determine the relation-ids will corrupt the relation-map and therefore only 16
instead of 20 slides
are reported.
I'll apply the patch in 3.11, i.e. when Yegor has finalized POI 3.10.
Apart of that, Simanchals code tries to normalize the paragraphs - my test
implementation
looks very minimal different:
- get the content of all text-runs in the paragraph as plain text
- remove all breaks, fields and all text-runs apart of the first one
(one would need to synchronize the xmlbeans and the poi run list though)
- and set the normalized content into the first text run
I'll leave the answer to Q1/Q2 as an exercise to you ;)
Andi
On 30.01.2014 23:46, David Law wrote:
Simanchal,
may I ask a couple of stupid questions?
I've removed some dead code & what's left
in the heart of all those nested if's & for's is this:
CTRegularTextRun[] ctRegularTextRun = xslfParagraph.getXmlObject().getRArray();
for (int index = ctRegularTextRun.length - 1; index > 0; index--) {
xslfParagraph.getXmlObject().removeR(index);
}
if (ctRegularTextRun.length > 0) {
ctRegularTextRun[0].setT("");
}
First you get an Array of all CTRegularTextRuns contained in the XmlObject.
Then you remove them all from the XmlObject.
(they now only exist in the Array you just got)
Finally you set the T Element of (only!) the 1st CTRegularTextRun (if present) to
"".
Q1) Now I wonder why you need to iterate backwards through the Array?
Q2) Setting the T Element will have no effect (because you have just deleted
all R's from the XmlObject?!
All the best,
DaveLaw
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]