cws-vmiklos01.diff: Better RTF export filter

This commit is contained in:
Miklos Vajna 2010-09-17 12:12:53 +02:00 committed by Cédric Bosdonnat
parent e0066cd371
commit c148ab4b53
3 changed files with 64 additions and 0 deletions

View file

@ -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 );

View file

@ -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 );

View file

@ -39,6 +39,7 @@
#define OOO_STRING_SVTOOLS_RTF_ALT "\\alt"
#define OOO_STRING_SVTOOLS_RTF_ANNOTATION "\\annotation"
#define OOO_STRING_SVTOOLS_RTF_ANSI "\\ansi"
#define OOO_STRING_SVTOOLS_RTF_ATNDATE "\\atndate"
#define OOO_STRING_SVTOOLS_RTF_ATNID "\\atnid"
#define OOO_STRING_SVTOOLS_RTF_AUTHOR "\\author"
#define OOO_STRING_SVTOOLS_RTF_B "\\b"
@ -976,12 +977,15 @@
#define OOO_STRING_SVTOOLS_RTF_SHPBXCOLUMN "\\shpbxcolumn"
#define OOO_STRING_SVTOOLS_RTF_SHPBXMARGIN "\\shpbxmargin"
#define OOO_STRING_SVTOOLS_RTF_SHPBXPAGE "\\shpbxpage"
#define OOO_STRING_SVTOOLS_RTF_SHPBXIGNORE "\\shpbxignore"
#define OOO_STRING_SVTOOLS_RTF_SHPBYMARGIN "\\shpbymargin"
#define OOO_STRING_SVTOOLS_RTF_SHPBYPAGE "\\shpbypage"
#define OOO_STRING_SVTOOLS_RTF_SHPBYPARA "\\shpbypara"
#define OOO_STRING_SVTOOLS_RTF_SHPBYIGNORE "\\shpbyignore"
#define OOO_STRING_SVTOOLS_RTF_SHPFBLWTXT "\\shpfblwtxt"
#define OOO_STRING_SVTOOLS_RTF_SHPFHDR "\\shpfhdr"
#define OOO_STRING_SVTOOLS_RTF_SHPGRP "\\shpgrp"
#define OOO_STRING_SVTOOLS_RTF_SHPINST "\\shpinst"
#define OOO_STRING_SVTOOLS_RTF_SHPLEFT "\\shpleft"
#define OOO_STRING_SVTOOLS_RTF_SHPLID "\\shplid"
#define OOO_STRING_SVTOOLS_RTF_SHPLOCKANCHOR "\\shplockanchor"
@ -993,6 +997,7 @@
#define OOO_STRING_SVTOOLS_RTF_SHPWRK "\\shpwrk"
#define OOO_STRING_SVTOOLS_RTF_SHPWR "\\shpwr"
#define OOO_STRING_SVTOOLS_RTF_SHPZ "\\shpz"
#define OOO_STRING_SVTOOLS_RTF_SP "\\sp"
#define OOO_STRING_SVTOOLS_RTF_SPRSBSP "\\sprsbsp"
#define OOO_STRING_SVTOOLS_RTF_SPRSLNSP "\\sprslnsp"
#define OOO_STRING_SVTOOLS_RTF_SPRSTSM "\\sprstsm"
@ -1138,4 +1143,11 @@
#define OOO_STRING_SVTOOLS_RTF_OLHWAVE "\\olhwave"
#define OOO_STRING_SVTOOLS_RTF_OLOLDBWAVE "\\ololdbwave"
// Support for nested tables
#define OOO_STRING_SVTOOLS_RTF_ITAP "\\itap"
#define OOO_STRING_SVTOOLS_RTF_NESTCELL "\\nestcell"
#define OOO_STRING_SVTOOLS_RTF_NESTTABLEPROPRS "\\nesttableprops"
#define OOO_STRING_SVTOOLS_RTF_NESTROW "\\nestrow"
#define OOO_STRING_SVTOOLS_RTF_NONESTTABLES "\\nonesttables"
#endif // _RTFKEYWD_HXX