diff options
author | Cédric Bosdonnat <cedricbosdo@openoffice.org> | 2010-11-10 09:45:11 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedricbosdo@openoffice.org> | 2010-11-15 10:11:51 +0100 |
commit | b35a7344eda5eaa1e0dcf916b48d8cf089db5562 (patch) | |
tree | 2715beeb0286574f5db35b22904aa5e5f5d9d0b0 /sax | |
parent | Misuse of RTL_CONSTASCII_STRINGPARAM instead of RTL_CONSTASCII_USTRINGPARAM (diff) | |
download | core-b35a7344eda5eaa1e0dcf916b48d8cf089db5562.tar.gz core-b35a7344eda5eaa1e0dcf916b48d8cf089db5562.zip |
Docx Export: fixed some elements ordering problem
Nested elements that weren't in the order sequence weren't appended to
the parent... and then skipped.
Diffstat (limited to 'sax')
-rw-r--r-- | sax/source/tools/fastserializer.cxx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx index 7e8394039831..5f31a232bdf4 100644 --- a/sax/source/tools/fastserializer.cxx +++ b/sax/source/tools/fastserializer.cxx @@ -30,6 +30,8 @@ #include <rtl/ustrbuf.hxx> #include <rtl/byteseq.hxx> +#include <comphelper/sequenceasvector.hxx> + #include <com/sun/star/xml/Attribute.hpp> #include <com/sun/star/xml/FastAttribute.hpp> #include <com/sun/star/xml/sax/XFastAttributeList.hpp> @@ -40,6 +42,7 @@ #include <cstdio> #endif +using ::comphelper::SequenceAsVector; using ::rtl::OString; using ::rtl::OUString; using ::rtl::OUStringBuffer; @@ -465,9 +468,13 @@ namespace sax_fastparser { void FastSaxSerializer::ForSort::setCurrentElement( sal_Int32 nElement ) { - mnCurrentElement = nElement; - if ( maData.find( nElement ) == maData.end() ) - maData[ nElement ] = Int8Sequence(); + SequenceAsVector< sal_Int32 > aOrder( maOrder ); + if( std::find( aOrder.begin(), aOrder.end(), nElement ) != aOrder.end() ) + { + mnCurrentElement = nElement; + if ( maData.find( nElement ) == maData.end() ) + maData[ nElement ] = Int8Sequence(); + } } void FastSaxSerializer::ForSort::prepend( const Int8Sequence &rWhat ) |