summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@frugalware.org>2010-09-17 12:12:53 +0200
committerCédric Bosdonnat <cedricbosdo@openoffice.org>2010-09-17 13:16:04 +0200
commitc148ab4b535a6e85bdaaabd487983999c4a023d7 (patch)
tree378d743518f5bf5c8e0c0a2ee5b6d4bc4f4075f2 /sax
parente0066cd371f11a5aa2626575f6836b697c6cac7a (diff)
cws-vmiklos01.diff: Better RTF export filter
Notes
split repo tag: libs-gui_LIBREOFFICE_CREATE split repo tag: libs-gui_OOO_BUILD_3_2_99_0_PRE
Diffstat (limited to 'sax')
-rw-r--r--sax/source/tools/fastserializer.cxx45
-rw-r--r--sax/source/tools/fastserializer.hxx7
2 files changed, 52 insertions, 0 deletions
diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx
index b0318516b72c..d88e3140f956 100644
--- a/sax/source/tools/fastserializer.cxx
+++ b/sax/source/tools/fastserializer.cxx
@@ -34,6 +34,10 @@
#include <string.h>
+#if DEBUG
+#include <cstdio>
+#endif
+
using ::rtl::OString;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
@@ -321,6 +325,28 @@ namespace sax_fastparser {
maMarkStack.push( ForMerge() );
}
+#if DEBUG
+ void FastSaxSerializer::printMarkStack( )
+ {
+ ::std::stack< ForMerge > aCopy( maMarkStack );
+ int nSize = aCopy.size();
+ int i = 0;
+ while ( !aCopy.empty() )
+ {
+ fprintf( stderr, "%d\n", nSize - i );
+
+ ForMerge aMarks = aCopy.top( );
+ aMarks.print();
+
+
+ fprintf( stderr, "\n" );
+
+ aCopy.pop( );
+ i++;
+ }
+ }
+#endif
+
void FastSaxSerializer::mergeTopMarks( sax_fastparser::MergeMarksEnum eMergeType )
{
if ( maMarkStack.empty() )
@@ -360,6 +386,25 @@ namespace sax_fastparser {
return maData;
}
+#if DEBUG
+ void FastSaxSerializer::ForMerge::print( )
+ {
+ fprintf( stderr, "Data: " );
+ for ( sal_Int32 i=0, len=maData.getLength(); i < len; i++ )
+ {
+ fprintf( stderr, "%c", maData[i] );
+ }
+
+ fprintf( stderr, "\nPostponed: " );
+ for ( sal_Int32 i=0, len=maPostponed.getLength(); i < len; i++ )
+ {
+ fprintf( stderr, "%c", maPostponed[i] );
+ }
+
+ fprintf( stderr, "\n" );
+ }
+#endif
+
void FastSaxSerializer::ForMerge::prepend( const Int8Sequence &rWhat )
{
merge( maData, rWhat, false );
diff --git a/sax/source/tools/fastserializer.hxx b/sax/source/tools/fastserializer.hxx
index a98a0ff7a67d..39f471fd7009 100644
--- a/sax/source/tools/fastserializer.hxx
+++ b/sax/source/tools/fastserializer.hxx
@@ -134,6 +134,9 @@ private:
ForMerge() : maData(), maPostponed() {}
Int8Sequence& getData();
+#if DEBUG
+ void print();
+#endif
void prepend( const Int8Sequence &rWhat );
void append( const Int8Sequence &rWhat );
@@ -143,6 +146,10 @@ private:
static void merge( Int8Sequence &rTop, const Int8Sequence &rMerge, bool bAppend );
};
+#if DEBUG
+ void printMarkStack( );
+#endif
+
::std::stack< ForMerge > maMarkStack;
void writeFastAttributeList( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs );