Subject: | removeTextStyleChanges erases content when there is no span |
Date: | Wed, 8 Sep 2010 11:13:28 -0400 |
To: | bug-OpenOffice-OODoc [...] rt.cpan.org |
From: | TCDE Project Manager <projectmanager [...] healthdoc.cs.uwaterloo.ca> |
(I am using OpenOffice::OODoc::Text 2.243, as it appears 9/8/10 11:09:34 EST on CPAN.)
It seems that OpenOffice::OODoc::Text::removeTextStyleChanges completely empties any text:p or text:h that contains no spans.
On reading the code, I concluded that it
* moves descendants of $context out into $new_elt, erasing span boundaries as it goes
* counts the spans
* finally if there was at least one span, replaces $context in $self with $new_elt
* otherwise finally $new_elt is deleted.
If there are no spans, the descendants of $content are moved out into $new_elt anyway, but then deleted,
My work-around is to test for a span first – but my processing requirement is to remove span boundaries throughout the doc, which I attempted by grabbing all the text:p's and text:h's and removeSpanning them, resulting in lots of undesired deltion.
Is this a bug, or a feature?
---
Dr. Andrew Malton
TCDE Project
University of Waterloo