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 | |
parent | 43bc8a24deb65f24be2ecdc826fd07a0d14fdd34 (diff) |
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.
-rw-r--r-- | comphelper/inc/comphelper/sequenceasvector.hxx | 5 | ||||
-rw-r--r-- | sax/source/tools/fastserializer.cxx | 13 |
2 files changed, 15 insertions, 3 deletions
diff --git a/comphelper/inc/comphelper/sequenceasvector.hxx b/comphelper/inc/comphelper/sequenceasvector.hxx index 6fb303f0d36f..a68fa2093116 100644 --- a/comphelper/inc/comphelper/sequenceasvector.hxx +++ b/comphelper/inc/comphelper/sequenceasvector.hxx @@ -68,6 +68,11 @@ class SequenceAsVector : public ::std::vector< TElementType > types from the base! */ typedef typename ::std::vector< TElementType >::const_iterator const_iterator; + //--------------------------------------- + /** @short When inheriting from a template using typename is generally required when using + types from the base! */ + typedef typename ::std::vector< TElementType >::iterator iterator; + //------------------------------------------- // interface public: 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 ) |