diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-07-03 22:28:18 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-07-04 00:17:49 +0200 |
commit | cf17befa261fd64f95bb4db932ce4d7e149f4a72 (patch) | |
tree | a571ebd1bc5a24fd68752de99c141eda6a4307e4 /sax | |
parent | c59726e696b7a507f0b5e752a52e3ea7773c230f (diff) |
tdf#91378: sax, oox: avoid sending empty strings to character callbacks
This reverts the changes in FastSaxParserImpl from commit
16e8ffbd5ec1fe7b81835ea6584547669d55d751 and instead fixes the problem
of inserting string properties with empty value locally in
OOXMLDocPropHandler.
This change was not wrong in any obvious way, but it turns out there is
one doc rhbz583386-4.docx that, when imported with this change and
exported to DOCX again, results in a non-well-formed document because of
some weird SDT stuff.
That problem is rather baffling, but unfortunately the
DocxAttributeOutput usage of FastSaxSerializer::mark() makes the DOCX
export rather un-debuggable, so avoid that problem by reverting the import
change for now.
Change-Id: I0d874cbfe82d4f15d58b50116dda152341bdf7b0
Diffstat (limited to 'sax')
-rw-r--r-- | sax/source/fastparser/fastparser.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index 79ab8991af78..c866618ea4f0 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -1037,7 +1037,8 @@ void FastSaxParserImpl::parse() void FastSaxParserImpl::callbackStartElement(const xmlChar *localName , const xmlChar* prefix, const xmlChar* URI, int numNamespaces, const xmlChar** namespaces, int numAttributes, int /*defaultedAttributes*/, const xmlChar **attributes) { - sendPendingCharacters(); + if (!pendingCharacters.isEmpty()) + sendPendingCharacters(); Entity& rEntity = getEntity(); if( rEntity.maNamespaceCount.empty() ) { @@ -1144,7 +1145,8 @@ void FastSaxParserImpl::callbackStartElement(const xmlChar *localName , const xm void FastSaxParserImpl::callbackEndElement( const xmlChar*, const xmlChar*, const xmlChar* ) { - sendPendingCharacters(); + if (!pendingCharacters.isEmpty()) + sendPendingCharacters(); Entity& rEntity = getEntity(); SAL_WARN_IF(rEntity.maNamespaceCount.empty(), "sax", "Empty NamespaceCount"); if( !rEntity.maNamespaceCount.empty() ) |