[Libreoffice-commits] .: sw/source

Miklos Vajna vmiklos at kemper.freedesktop.org
Thu Oct 7 07:20:59 PDT 2010


 sw/source/filter/rtf/rtfatr.cxx | 4375 ----------------------------------------
 1 file changed, 4375 deletions(-)

New commits:
commit 44732b6537aee3c5a1a1bab61c9e3253856e5471
Author: Miklos Vajna <vmiklos at frugalware.org>
Date:   Thu Oct 7 16:20:33 2010 +0200

    Remove one more file from the old RTF export code which was still there

diff --git a/sw/source/filter/rtf/rtfatr.cxx b/sw/source/filter/rtf/rtfatr.cxx
deleted file mode 100644
index a53d581..0000000
--- a/sw/source/filter/rtf/rtfatr.cxx
+++ /dev/null
@@ -1,4375 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sw.hxx"
-/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */
-
-/*
- * Dieses File enthaelt alle Ausgabe-Funktionen des RTF-Writers;
- * fuer alle Nodes, Attribute, Formate und Chars.
- */
-#include <hintids.hxx>
-
-#include <com/sun/star/i18n/ScriptType.hdl>
-#include <vcl/cvtgrf.hxx>
-#include <svl/urihelper.hxx>
-#include <svl/stritem.hxx>
-#include <svtools/rtfkeywd.hxx>
-#include <svl/whiter.hxx>
-#include <svtools/rtfout.hxx>
-#include <svl/itemiter.hxx>
-#include <editeng/fontitem.hxx>
-#include <editeng/hyznitem.hxx>
-#include <editeng/tstpitem.hxx>
-#include <editeng/lspcitem.hxx>
-#include <editeng/langitem.hxx>
-#include <editeng/keepitem.hxx>
-#include <editeng/udlnitem.hxx>
-#include <editeng/shaditem.hxx>
-#include <editeng/cmapitem.hxx>
-#include <editeng/brshitem.hxx>
-#include <editeng/protitem.hxx>
-#include <editeng/opaqitem.hxx>
-#include <editeng/ulspitem.hxx>
-#include <editeng/prntitem.hxx>
-#include <editeng/colritem.hxx>
-#include <editeng/escpitem.hxx>
-#include <editeng/fhgtitem.hxx>
-#include <editeng/spltitem.hxx>
-#include <editeng/adjitem.hxx>
-#include <editeng/lrspitem.hxx>
-#include <editeng/boxitem.hxx>
-#include <editeng/crsditem.hxx>
-#include <editeng/cntritem.hxx>
-#include <editeng/postitem.hxx>
-#include <editeng/shdditem.hxx>
-#include <editeng/wghtitem.hxx>
-#include <editeng/wrlmitem.hxx>
-#include <editeng/emphitem.hxx>
-#include <editeng/twolinesitem.hxx>
-#include <editeng/charscaleitem.hxx>
-#include <editeng/charrotateitem.hxx>
-#include <editeng/charreliefitem.hxx>
-#include <svx/xoutbmp.hxx>
-#include <editeng/paravertalignitem.hxx>
-#include <editeng/hngpnctitem.hxx>
-#include <editeng/scriptspaceitem.hxx>
-#include <editeng/forbiddenruleitem.hxx>
-#include <editeng/frmdiritem.hxx>
-#include <editeng/charhiddenitem.hxx>
-#include <unotools/charclass.hxx>
-#include <reffld.hxx>
-#include <frmatr.hxx>
-#include <charatr.hxx>
-#include <fmtfsize.hxx>
-#include <fmtpdsc.hxx>
-#include <fmtfld.hxx>
-#include <fmtflcnt.hxx>
-#include <fmtftn.hxx>
-#include <fchrfmt.hxx>
-#include <fmtautofmt.hxx>
-#include <fmtcntnt.hxx>
-#include <fmthdft.hxx>
-#include <fmtclds.hxx>
-#include <txtftn.hxx>
-#include <fmtsrnd.hxx>
-#include <fmtanchr.hxx>
-#include <charfmt.hxx>
-#include <fmtinfmt.hxx>
-#include <txtinet.hxx>
-#include <doc.hxx>
-#include <docary.hxx>
-#include <ndtxt.hxx>
-#include <pam.hxx>
-#include <paratr.hxx>
-#include <fldbas.hxx>			// fuer SwField ...
-#include <wrtrtf.hxx>
-#include <rtf.hxx>			// fuer SwPictureType
-#include <ndgrf.hxx>
-#include <grfatr.hxx>
-#include <docufld.hxx>
-#include <flddat.hxx>
-#include <pagedesc.hxx>		// fuer SwPageDesc ...
-#include <swtable.hxx>		// fuer SwPageDesc ...
-#include <docsh.hxx>
-#include <swrect.hxx>
-#include <section.hxx>
-#include <wrtswtbl.hxx>
-#include <htmltbl.hxx>
-#include <fmtclbl.hxx>
-#include <breakit.hxx>
-#include <fmtruby.hxx>
-#include <txtatr.hxx>
-#include <fltini.hxx>
-#include <fmtrowsplt.hxx>
-
-/*
- * um nicht immer wieder nach einem Update festzustellen, das irgendwelche
- * Hint-Ids dazugekommen sind, wird hier definiert, die Groesse der Tabelle
- * definiert und mit der akt. verglichen. Bei unterschieden wird der
- * Compiler schon meckern.
- *
- * diese Section und die dazugeherigen Tabellen muessen in folgenden Files
- * gepflegt werden: rtf\rtfatr.cxx, sw6\sw6atr.cxx, w4w\w4watr.cxx
- */
-#if !defined(UNX) && !defined(MSC) && !defined(PPC) && !defined(CSET) && !defined(__MWERKS__) && !defined(WTC) && !defined(__MINGW32__) && !defined(OS2)
-
-#define ATTRFNTAB_SIZE 130
-#if ATTRFNTAB_SIZE != POOLATTR_END - POOLATTR_BEGIN
-#error Attribut-Tabelle ist ungueltigt. Wurden neue Hint-IDs zugefuegt ??
-#endif
-
-#ifdef FORMAT_TABELLE
-// da sie nicht benutzt wird!
-#define FORMATTAB_SIZE 7
-#if FORMATTAB_SIZE != RES_FMT_END - RES_FMT_BEGIN
-#error Format-Tabelle ist ungueltigt. Wurden neue Hint-IDs zugefuegt ??
-#endif
-#endif
-
-#define NODETAB_SIZE 3
-#if NODETAB_SIZE != RES_NODE_END - RES_NODE_BEGIN
-#error Node-Tabelle ist ungueltigt. Wurden neue Hint-IDs zugefuegt ??
-#endif
-
-#endif
-
-#ifdef WNT
-// ueber xoutbmp.hxx wird das winuser.h angezogen. Dort gibt es ein
-// define GetProp das mit unserem SvxEscapement kollidiert!
-#undef GetProp
-#endif
-
-
-using namespace com::sun::star;
-
-//-----------------------------------------------------------------------
-
-static Writer& OutRTF_SwFmtCol( Writer& rWrt, const SfxPoolItem& rHt );
-
-//-----------------------------------------------------------------------
-
-SvStream& OutComment( Writer& rWrt, const sal_Char* pStr )
-{
-    return (rWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << pStr);
-}
-
-SvStream& OutComment( Writer& rWrt, const char* pStr, BOOL bSetFlag )
-{
-    // setze Flag, damit bei der Ausgabe von Attributen zu erkennen,
-    // ob ueberhaupt etwas ausgegeben wurde.
-    ((SwRTFWriter&)rWrt).bOutFmtAttr = bSetFlag;
-    return (rWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << pStr);
-}
-
-Writer& OutRTF_AsByteString( Writer& rWrt, const String& rStr, rtl_TextEncoding eEncoding)
-{
-    ByteString sOutStr( rStr, eEncoding );
-    rWrt.Strm() << sOutStr.GetBuffer();
-    return rWrt;
-}
-
-void OutRTF_SfxItemSet( SwRTFWriter& rWrt, const SfxItemSet& rSet,
-                        BOOL bDeep )
-{
-    bool bFrameDirOut=false;
-    bool bAdjustOut=false;
-    // erst die eigenen Attribute ausgeben
-    SvPtrarr aAsian( 0, 5 ), aCmplx( 0, 5 ), aLatin( 0, 5 );
-
-    const SfxItemPool& rPool = *rSet.GetPool();
-    SfxWhichIter aIter( rSet );
-    const SfxPoolItem* pItem;
-    FnAttrOut pOut;
-    USHORT nWhich = aIter.FirstWhich();
-    while( nWhich )
-    {
-        if( SFX_ITEM_SET == rSet.GetItemState( nWhich, bDeep, &pItem ))
-        {
-            pOut = aRTFAttrFnTab[ nWhich - RES_CHRATR_BEGIN];
-            if( pOut &&
-                ( *pItem != rPool.GetDefaultItem( nWhich )
-                    || ( rSet.GetParent() &&
-                        *pItem != rSet.GetParent()->Get( nWhich ) )
-                    || ( rWrt.GetAttrSet() &&
-                        *pItem != rWrt.GetAttrSet()->Get( nWhich ) )
-              ) )
-                ;
-            else
-                pOut = 0;
-        }
-        else if( !bDeep )
-            pOut = 0;
-        else if( 0 != ( pItem = rPool.GetPoolDefaultItem( nWhich )) )
-            pOut = aRTFAttrFnTab[ nWhich - RES_CHRATR_BEGIN];
-        else
-            pOut = 0;
-
-        if (!pOut && bDeep)
-        {
-            switch( nWhich )
-            {
-                case RES_CHRATR_FONTSIZE:
-                case RES_CHRATR_CJK_FONTSIZE:
-                case RES_CHRATR_CTL_FONTSIZE:
-                case RES_CHRATR_LANGUAGE:
-                case RES_CHRATR_CJK_LANGUAGE:
-                case RES_CHRATR_CTL_LANGUAGE:
-                    pItem = &rPool.GetDefaultItem( nWhich );
-                    pOut = aRTFAttrFnTab[ nWhich - RES_CHRATR_BEGIN];
-                    break;
-                default:
-                    break;
-            }
-        }
-
-        if( pOut )
-        {
-            void* pVoidItem = (void*)pItem;
-            switch( nWhich )
-            {
-            case RES_CHRATR_FONT:
-            case RES_CHRATR_FONTSIZE:
-            case RES_CHRATR_LANGUAGE:
-            case RES_CHRATR_POSTURE:
-            case RES_CHRATR_WEIGHT:
-                aLatin.Insert( pVoidItem, aLatin.Count() );
-                pOut = 0;
-                break;
-
-            case RES_CHRATR_CJK_FONT:
-            case RES_CHRATR_CJK_FONTSIZE:
-            case RES_CHRATR_CJK_LANGUAGE:
-            case RES_CHRATR_CJK_POSTURE:
-            case RES_CHRATR_CJK_WEIGHT:
-                aAsian.Insert( pVoidItem, aAsian.Count() );
-                pOut = 0;
-                break;
-
-            case RES_CHRATR_CTL_FONT:
-            case RES_CHRATR_CTL_FONTSIZE:
-            case RES_CHRATR_CTL_LANGUAGE:
-            case RES_CHRATR_CTL_POSTURE:
-            case RES_CHRATR_CTL_WEIGHT:
-                aCmplx.Insert( pVoidItem, aCmplx.Count() );
-                pOut = 0;
-                break;
-
-            case RES_FRAMEDIR:
-                bFrameDirOut=true;
-                break;
-            case RES_PARATR_ADJUST:
-                bAdjustOut=true;
-                break;
-            }
-        }
-
-        if (pOut)
-            (*pOut)( rWrt, *pItem );
-        nWhich = aIter.NextWhich();
-    }
-
-    //If rtlpar set and no following alignment. And alignment is not rtl then
-    //output alignment
-    if (bFrameDirOut && !bAdjustOut && !rWrt.pFlyFmt && !rWrt.bOutPageDesc)
-    {
-        pOut = aRTFAttrFnTab[ static_cast< USHORT >(RES_PARATR_ADJUST) - RES_CHRATR_BEGIN];
-        if (pOut)
-            (*pOut)(rWrt, rSet.Get(RES_PARATR_ADJUST));
-    }
-    if (rWrt.pFlyFmt && !rWrt.bOutPageDesc && !bFrameDirOut)
-    {
-        pOut = aRTFAttrFnTab[ static_cast< USHORT >(RES_FRAMEDIR) - RES_CHRATR_BEGIN];
-        if (pOut)
-            (*pOut)(rWrt, rSet.Get(RES_FRAMEDIR));
-    }
-
-    if (aAsian.Count() || aCmplx.Count() || aLatin.Count())
-    {
-        SvPtrarr* aArr[4];
-        switch (rWrt.GetCurrScriptType())
-        {
-        case i18n::ScriptType::LATIN:
-            aArr[ 0 ] = &aCmplx;
-            aArr[ 1 ] = &aAsian;
-            aArr[ 2 ] = &aLatin;
-            aArr[ 3 ] = &aLatin;
-            break;
-
-        case i18n::ScriptType::ASIAN:
-            aArr[ 0 ] = &aCmplx;
-            aArr[ 1 ] = &aLatin;
-            aArr[ 2 ] = &aLatin;
-            aArr[ 3 ] = &aAsian;
-            break;
-
-        case i18n::ScriptType::COMPLEX:
-            aArr[ 0 ] = &aLatin;
-            aArr[ 1 ] = &aLatin;
-            aArr[ 2 ] = &aAsian;
-            aArr[ 3 ] = &aCmplx;
-            break;
-
-        default:
-            return ;
-        }
-
-        //The final entry is the one that is actually in use
-        //so it uses e.g. \b \i \fs, the others are not in
-        //use and so are "associated". Both asian and western
-        //are ltr runs, with asian being the dbch varient
-        //and western being the loch/hich varient
-        bool bOutLTOR = true;
-        bool bLowLTOR = false;
-        for( int nArrCnt = 0; nArrCnt < 4; ++nArrCnt )
-        {
-            SvPtrarr* pCurArr = aArr[ nArrCnt ];
-            if (pCurArr->Count())
-            {
-                bool bInUse = (aArr[nArrCnt] == aArr[3]);
-                rWrt.SetAssociatedFlag(!bInUse);
-                if (pCurArr == &aLatin)
-                {
-                    if (bOutLTOR)
-                    {
-                        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LTRCH;
-                        bOutLTOR = false;
-                    }
-
-                    if (bLowLTOR)
-                        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LOCH;
-                    else
-                    {
-                        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_HICH;
-                        bLowLTOR = true;
-                    }
-                }
-                else if( pCurArr == &aAsian )
-                {
-                    if( bOutLTOR )
-                    {
-                        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LTRCH;
-                        bOutLTOR = false;
-                    }
-                    rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_DBCH;
-                }
-                else
-                    rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_RTLCH;
-
-                for (USHORT n = 0; n < pCurArr->Count(); ++n)
-                {
-                    pItem = (const SfxPoolItem*)(*pCurArr)[ n ];
-                    pOut = aRTFAttrFnTab[ pItem->Which() - RES_CHRATR_BEGIN];
-                    (*pOut)( rWrt, *pItem );
-                }
-            }
-        }
-    }
-}
-
-// fuer die Formate muesste eine einzige Ausgabe-Funktion genuegen !
-/*
- * Formate wie folgt ausgeben:
- * 		- gebe alle Attribute vom Format aus
- */
-
-bool SwFmtToSet(SwRTFWriter& rWrt, const SwFmt& rFmt, SfxItemSet &rSet)
-{
-    bool bOutItemSet = true;
-    rSet.SetParent(rFmt.GetAttrSet().GetParent());
-
-    switch( rFmt.Which() )
-    {
-    case RES_CONDTXTFMTCOLL:
-    case RES_TXTFMTCOLL:
-        {
-            USHORT nId = rWrt.GetId( (const SwTxtFmtColl&)rFmt );
-            if (0 == nId )
-                return false;		// Default-TextStyle nicht ausgeben !!
-
-            rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_S;
-            rWrt.OutULong( nId );
-            rWrt.bOutFmtAttr = TRUE;
-//			BYTE nLvl = ((const SwTxtFmtColl&)rFmt).GetOutlineLevel();		//#outline level,zhaojianwei
-//			if( MAXLEVEL > nLvl )
-//			{
-            if(((const SwTxtFmtColl&)rFmt).IsAssignedToListLevelOfOutlineStyle())
-            {
-                int nLvl = ((const SwTxtFmtColl&)rFmt).GetAssignedOutlineStyleLevel();	//<-end,zhaojianwei
-                USHORT nNumId = rWrt.GetNumRuleId(
-                                        *rWrt.pDoc->GetOutlineNumRule() );
-                if( USHRT_MAX != nNumId )
-                {
-                    BYTE nWWLvl = 8 >= nLvl ? static_cast<BYTE>(nLvl) : 8;
-                    rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LS;
-                    rWrt.OutULong( nNumId );
-                    rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_ILVL; rWrt.OutULong( nWWLvl );
-                    rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_OUTLINELEVEL; rWrt.OutULong( nWWLvl );
-                    if( nWWLvl != nLvl )			// RTF-kennt nur 9 Ebenen
-                    {
-                        OutComment( rWrt, OOO_STRING_SVTOOLS_RTF_SOUTLVL );
-                        rWrt.OutULong( nLvl ) << '}';
-                    }
-                }
-
-                const SwNumFmt* pNFmt = &rWrt.pDoc->GetOutlineNumRule()->Get( static_cast<USHORT>(nLvl) );
-                if( pNFmt->GetIndentAt() )
-                {
-                    SfxItemSet aSet( *rFmt.GetAttrSet().GetPool(),
-                                    rFmt.GetAttrSet().GetRanges() );
-                    aSet.SetParent( &rFmt.GetAttrSet() );
-                    SvxLRSpaceItem aLR( (SvxLRSpaceItem&)aSet.Get( RES_LR_SPACE ) );
-
-                    aLR.SetTxtLeft( aLR.GetTxtLeft() + pNFmt->GetIndentAt() );
-                    aLR.SetTxtFirstLineOfst( pNFmt->GetFirstLineIndent() );
-
-                    aSet.Put(aLR);
-                    rSet.Put(aSet);
-                    bOutItemSet = false;
-                }
-            }
-        }
-        break;
-    case RES_CHRFMT:
-        {
-            USHORT nId = rWrt.GetId( (const SwCharFmt&)rFmt );
-            if (0 == nId)
-                return false;		// Default-CharStyle nicht ausgeben !!
-
-            rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_IGNORE << OOO_STRING_SVTOOLS_RTF_CS;
-            rWrt.OutULong( nId );
-            rWrt.bOutFmtAttr = TRUE;
-        }
-        break;
-
-//	case RES_GRFFMTCOLL:
-// ?????
-    }
-
-    if (bOutItemSet)
-        rSet.Put(rFmt.GetAttrSet());
-
-    return true;
-}
-
-Writer& OutRTF_SwFmt(Writer& rWrt, const SwFmt& rFmt)
-{
-    SwRTFWriter & rRTFWrt = (SwRTFWriter&)rWrt;
-
-    SfxItemSet aSet(*rFmt.GetAttrSet().GetPool(),
-        rFmt.GetAttrSet().GetRanges() );
-    if (SwFmtToSet(rRTFWrt, rFmt, aSet))
-        OutRTF_SfxItemSet(rRTFWrt, aSet, TRUE);
-
-    return rWrt;
-}
-
-void OutRTF_SwFlyFrmFmt( SwRTFWriter& rRTFWrt )
-{
-    // ist der aktuelle Absatz in einem freifliegenden Rahmen ? Dann
-    // muessen noch die Attribute dafuer ausgegeben werden.
-    ASSERT( rRTFWrt.pFlyFmt, "wo ist das Fly-Format?" );
-
-    if( rRTFWrt.bOutFmtAttr )
-    {
-        rRTFWrt.Strm() << ' ';
-        rRTFWrt.bOutFmtAttr = false;
-    }
-    // gebe erstmal alle RTF-Spezifischen Attribute aus
-    rRTFWrt.bRTFFlySyntax = TRUE;
-    OutRTF_SwFmt( rRTFWrt, *rRTFWrt.pFlyFmt );
-
-    // dann gebe alle eigenen Attribute aus
-    {
-        // dazu erzeuge einen temp strstream, um festzustellen ob es
-        // ueberhaupt eigene Attribute gibt !
-        SvMemoryStream aTmpStrm;
-        SvStream* pSaveStrm = &rRTFWrt.Strm();
-        rRTFWrt.SetStream( &aTmpStrm );
-
-        rRTFWrt.bRTFFlySyntax = false;
-        OutRTF_SwFmt( rRTFWrt, *rRTFWrt.pFlyFmt );
-
-        rRTFWrt.SetStream( pSaveStrm );   // Stream-Pointer wieder zurueck
-
-        if ( aTmpStrm.GetEndOfData() ) // gibt es SWG spezifische Attribute?
-        {
-            aTmpStrm.Seek( 0L );
-            rRTFWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE << aTmpStrm << '}';
-        }
-    }
-//	rRTFWrt.pFlyFmt = 0;		// wieder zuruecksetzen !!
-}
-
-/* Ausgabe der Nodes */
-
-/*
- *	Ausgabe der Texte-Attribute:
- * 		Die Text-Attribute sind in einem VarArray nach ihren Start-Positionen
- * 		sortiert. Fuer den RTF-Writer ist aber auch das Ende von Bedeutung.
- *		Darum die Idee, sobald im SwpHints-Array ein Attribut mit der Start-
- *		Position gefunden wurde, in einem Sortierten-Array die Endposition
- * 		zu speichern. Sobald der Writer die Position erreicht hat, wird die
- *		schliessende Klammer ausgegeben und die Position aus dem Sort.Array
- *		geloescht.
- * 	15.3.93: Es reicht leider nicht aus nur Start und End zuspeichern, denn
- * 		im SwpHints Array stehen sie nicht nach Ende sortiert, so dass
- * 		Attribute die falsche schliessende Klammer bekommen. (z.B
- * 		Bold von 0..3, dann folgt Underline von 0..4. Dann bekommt Underline
- * 		die schliessende Klammer von Bold !!)
- *		Also muessen erst alle Attribute einer Position gesammelt, nach
- *		Ende sortiert und dann erst ausgegeben werden.
- */
-
-SV_DECL_PTRARR( SfxPoolItems, SfxPoolItem*, 4, 4 )
-class RTFEndPosLst;
-
-class SttEndPos
-{
-    // falls mehrere Attribute den gleichen Bereich umspannen, sammeln
-    SfxPoolItems aArr;
-    xub_StrLen nStart, nEnd;
-
-    SttEndPos( const SttEndPos & rSEPos );
-
-public:
-    SttEndPos( const SfxPoolItem& rAttr, xub_StrLen nStt, xub_StrLen nEnd );
-    ~SttEndPos();
-
-    xub_StrLen  GetStart() const 			{ return nStart; }
-    xub_StrLen  GetEnd() const 				{ return nEnd; }
-
-    const SfxPoolItems& GetAttrs() const	{ return aArr; }
-    void AddAttr( const SfxPoolItem& rAttr );
-    BOOL HasScriptChange() const;
-};
-
-
-SV_DECL_PTRARR_DEL( _EndPosLst, SttEndPos*, 5, 5 )
-SV_IMPL_PTRARR( _EndPosLst, SttEndPos* )
-
-class RTFEndPosLst : private _EndPosLst
-{
-    const SwTxtNode& rNode;
-    SwRTFWriter& rWrt;
-    RTFEndPosLst* pOldPosLst;
-    xub_StrLen nCurPos;
-    USHORT nCurScript;
-
-public:
-    using _EndPosLst::Count;
-    using _EndPosLst::operator[];
-    using _EndPosLst::DeleteAndDestroy;
-
-    RTFEndPosLst( SwRTFWriter& rWrt, const SwTxtNode& rNd, xub_StrLen nStart );
-    ~RTFEndPosLst();
-
-    USHORT GetCurScript() const			{ return nCurScript; }
-    BOOL MatchScriptToId( USHORT nId ) const;
-    int Insert( const SfxPoolItem& rAttr, xub_StrLen nStt, xub_StrLen nEnd );
-
-    void OutAttrs( xub_StrLen nStrPos );
-    void EndAttrs( xub_StrLen nStrPos );
-    void OutScriptChange( xub_StrLen nStrPos );
-
-    const SfxPoolItem* HasItem( USHORT nWhich ) const;
-    const SfxPoolItem& GetItem( USHORT nWhich ) const;
-    void OutFontAttrs(const SfxPoolItem &rItem);
-    void OutFontAttrs(USHORT nScript, bool bRTL);
-
-    SfxItemPool& GetPool() {return *rNode.GetSwAttrSet().GetPool(); }
-};
-
-
-SttEndPos::SttEndPos( const SfxPoolItem& rAttr,
-                        xub_StrLen nStt, xub_StrLen nEd )
-    : nStart( nStt ), nEnd( nEd )
-{
-    AddAttr( rAttr );
-}
-
-SttEndPos::~SttEndPos()
-{
-    for( USHORT n = 0, nCount = aArr.Count(); n < nCount; ++n )
-        if( RES_FLTRATTR_BEGIN <= aArr[ n ]->Which() )
-            delete aArr[ n ];
-}
-
-BOOL SttEndPos::HasScriptChange() const
-{
-    for( USHORT n = 0, nCount = aArr.Count(); n < nCount; ++n )
-        if( RES_FLTR_SCRIPTTYPE == aArr[ n ]->Which() )
-            return TRUE;
-    return FALSE;
-}
-
-void SttEndPos::AddAttr( const SfxPoolItem& rAttr )
-{
-    const SfxPoolItem* pI = &rAttr;
-    aArr.Insert(pI, aArr.Count());
-}
-
-RTFEndPosLst::RTFEndPosLst(SwRTFWriter& rWriter, const SwTxtNode& rNd,
-    xub_StrLen nStart)
-    : rNode(rNd), rWrt(rWriter), nCurPos(STRING_NOTFOUND)
-{
-    pOldPosLst = rWrt.pCurEndPosLst;
-    rWrt.pCurEndPosLst = this;
-
-    using namespace sw::util;
-    CharRuns aCharRuns(GetPseudoCharRuns(rNd, nStart));
-    cCharRunIter aEnd = aCharRuns.end();
-    xub_StrLen nSttPos = nStart;
-    for (cCharRunIter aI = aCharRuns.begin(); aI != aEnd; ++aI)
-    {
-        if (nSttPos != aI->mnEndPos)
-        {
-            SfxPoolItem* pChg = new SfxUInt32Item(RES_FLTR_SCRIPTTYPE,
-                (sal_uInt32(aI->mnScript) << 16) | static_cast<sal_uInt32>(aI->mbRTL));
-            Insert(*pChg, nSttPos, aI->mnEndPos);
-            nSttPos = aI->mnEndPos;
-        }
-    }
-}
-
-RTFEndPosLst::~RTFEndPosLst()
-{
-    rWrt.pCurEndPosLst = pOldPosLst;
-}
-
-int RTFEndPosLst::Insert( const SfxPoolItem& rAttr, xub_StrLen nStt,
-                            xub_StrLen nEnd )
-{
-    if (rAttr.Which() == RES_TXTATR_INETFMT)
-        return false;
-
-    if( nStt == nEnd )
-        return false;
-
-    USHORT nPos;
-    for( nPos = 0; nPos < Count(); ++nPos )
-    {
-        SttEndPos* pTmp = GetObject( nPos );
-        if( pTmp->GetStart() == nStt && pTmp->GetEnd() == nEnd )
-        {
-            pTmp->AddAttr( rAttr );
-            return false;		// schon vorhanden
-        }
-        if( nEnd < pTmp->GetEnd() )
-        {
-            SttEndPos* pNew = new SttEndPos( rAttr, nStt, nEnd );
-            _EndPosLst::C40_INSERT( SttEndPos, pNew, nPos );
-            return TRUE;
-        }
-    }
-
-    SttEndPos* pNew = new SttEndPos( rAttr, nStt, nEnd );
-    _EndPosLst::C40_INSERT( SttEndPos, pNew, nPos );
-    return TRUE;
-}
-
-void RTFEndPosLst::OutScriptChange( xub_StrLen nStrPos )
-{
-    SttEndPos* pStt;
-    for( USHORT n = 0, nEnd = Count(); n < nEnd; ++n )
-        if( nStrPos == (pStt = GetObject( n ))->GetStart())
-        {
-            if( pStt->HasScriptChange() )
-                OutAttrs( nStrPos );
-            break;
-        }
-}
-
-void RTFEndPosLst::OutAttrs( xub_StrLen nStrPos )
-{
-    SttEndPos* pStt;
-    nCurPos = nStrPos;
-    for( USHORT n = Count(); n ;  )
-        if( nStrPos == (pStt = (*this)[ --n ])->GetStart() )
-        {
-            rWrt.Strm() << '{';
-            for( USHORT i = 0; i < pStt->GetAttrs().Count(); ++i )
-            {
-                const SfxPoolItem* pItem = pStt->GetAttrs()[i];
-                if( RES_FLTR_SCRIPTTYPE == pItem->Which() )
-                    OutFontAttrs(*pItem);
-                else
-                    Out( aRTFAttrFnTab, *pItem, rWrt );
-            }
-        }
-
-    nCurPos = STRING_NOTFOUND;
-}
-
-//Just a little decoding hack for the RES_FLTR_SCRIPTTYPE thing
-void RTFEndPosLst::OutFontAttrs(const SfxPoolItem &rItem)
-{
-    sal_uInt32 nValue = ((const SfxUInt32Item&)rItem).GetValue();
-    sal_uInt16 nScript = static_cast<sal_uInt16>(nValue >> 16);
-    bool bBiDi = nValue & 0x1;
-    OutFontAttrs(nScript, bBiDi);
-}
-
-void RTFEndPosLst::OutFontAttrs(USHORT nScript, bool bRTL)
-{
-    // script change, write the correct attributes:
-    // start first with the Fontname
-
-    rWrt.bOutFmtAttr = TRUE;
-    nCurScript = nScript;
-    rWrt.SetCurrScriptType( nScript );
-    rWrt.SetAssociatedFlag(false);
-
-    // the font MUST be at the first position !!!
-    static const USHORT aLatinIds[] =
-    {
-        RES_CHRATR_FONT,
-        RES_CHRATR_FONTSIZE, RES_CHRATR_LANGUAGE,
-        RES_CHRATR_POSTURE,  RES_CHRATR_WEIGHT,
-        0
-    };
-    static const USHORT aAsianIds[] =
-    {
-        RES_CHRATR_CJK_FONT,
-        RES_CHRATR_CJK_FONTSIZE, RES_CHRATR_CJK_LANGUAGE,
-        RES_CHRATR_CJK_POSTURE,  RES_CHRATR_CJK_WEIGHT,
-        0
-    };
-    static const USHORT aCmplxIds[] =
-    {
-        RES_CHRATR_CTL_FONT,
-        RES_CHRATR_CTL_FONTSIZE, RES_CHRATR_CTL_LANGUAGE,
-        RES_CHRATR_CTL_POSTURE,  RES_CHRATR_CTL_WEIGHT,
-        0
-    };
-
-    /*
-     You would have thought that
-     rWrt.Strm() << (bRTL ? OOO_STRING_SVTOOLS_RTF_RTLCH : OOO_STRING_SVTOOLS_RTF_LTRCH); would be sufficent here ,
-     but looks like word needs to see the other directional token to be
-     satisified that all is kosher, otherwise it seems in ver 2003 to go and
-     semi-randomlyly stick strike through about the place. Perhaps
-     strikethrough is some ms developers "something is wrong signal" debugging
-     code that we're triggering ?
-    */
-    if (bRTL)
-    {
-        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LTRCH;
-        rWrt.Strm() << ' ';
-        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_RTLCH;
-    }
-    else
-    {
-        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_RTLCH;
-        rWrt.Strm() << ' ';
-        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LTRCH;
-    }
-
-    // size/weight/posture optional
-    const USHORT* pIdArr = 0;
-    ByteString sOut;
-    switch (nScript)
-    {
-        default:    //fall through
-            ASSERT(pIdArr, "unknown script, strange");
-        case i18n::ScriptType::LATIN:
-            rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LOCH;
-            pIdArr = aLatinIds;
-            break;
-        case i18n::ScriptType::ASIAN:
-            rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_DBCH;
-            pIdArr = aAsianIds;
-            break;
-        case i18n::ScriptType::COMPLEX:
-            pIdArr = aCmplxIds;
-            break;
-    }
-
-    for (const USHORT* pId = pIdArr; *pId; ++pId)
-    {
-        if (FnAttrOut pOut = aRTFAttrFnTab[ *pId - RES_CHRATR_BEGIN])
-        {
-            const SfxPoolItem* pItem = HasItem(*pId);
-            if (!pItem)
-                pItem = &GetPool().GetDefaultItem(*pId);
-            (*pOut)(rWrt, *pItem);
-        }
-    }
-}
-
-void RTFEndPosLst::EndAttrs( xub_StrLen nStrPos )
-{
-    xub_StrLen nClipStart=STRING_MAXLEN;
-    bool bClosed=false;
-    SttEndPos* pSEPos;
-    while( 0 != Count() && 0 != (pSEPos = GetObject( 0 )) &&
-        ( STRING_MAXLEN == nStrPos || nStrPos == pSEPos->GetEnd() ))
-    {
-        const SfxPoolItems& rAttrs = pSEPos->GetAttrs();
-        for( USHORT nAttr = rAttrs.Count(); nAttr; )
-        {
-            switch( rAttrs[ --nAttr ]->Which() )
-            {
-                case RES_TXTATR_CJK_RUBY:
-                    rWrt.Strm() << ")}{" << OOO_STRING_SVTOOLS_RTF_FLDRSLT << " }}";
-                    break;
-            }
-        }
-
-        rWrt.Strm() << '}';		// end of all attributes from this position
-        if (pSEPos->GetStart() < nClipStart)
-            nClipStart = pSEPos->GetStart();
-        bClosed=true;
-        DeleteAndDestroy( 0, 1 );
-    }
-
-    if (bClosed)
-    {
-        //If there are open ranges whose start is before this point, and whose
-        //start is after the cliping start then they have been closed whether
-        //we wanted this or not. So accept that fact and then restart then
-        //again
-        USHORT nSize = Count();
-        while (nSize > 0)
-        {
-            pSEPos = GetObject(--nSize);
-            if ( pSEPos->GetStart() < nStrPos &&
-                    pSEPos->GetStart() >= nClipStart)
-            {
-                rWrt.Strm() << '}';
-            }
-        }
-
-        nSize = Count();
-        USHORT n = 0;
-        while (n < nSize)
-        {
-            SttEndPos* pStt = (*this)[n++];
-            if (pStt->GetStart() < nStrPos && pStt->GetStart() >= nClipStart)
-            {
-                rWrt.Strm() << '{';
-                for( USHORT i = 0; i < pStt->GetAttrs().Count(); ++i )
-                {
-                    const SfxPoolItem* pItem = pStt->GetAttrs()[i];
-                    if( RES_FLTR_SCRIPTTYPE == pItem->Which() )
-                        OutFontAttrs(*pItem);
-                    else
-                        Out( aRTFAttrFnTab, *pItem, rWrt );
-                }
-            }
-        }
-    }
-}
-
-BOOL RTFEndPosLst::MatchScriptToId( USHORT nWhich ) const
-{
-    BOOL bRet = false;
-    switch( nWhich )
-    {
-    case RES_CHRATR_FONT:
-    case RES_CHRATR_FONTSIZE:
-    case RES_CHRATR_LANGUAGE:
-    case RES_CHRATR_POSTURE:
-    case RES_CHRATR_WEIGHT:
-        bRet = nCurScript == i18n::ScriptType::LATIN;
-        break;
-    case RES_CHRATR_CJK_FONT:
-    case RES_CHRATR_CJK_FONTSIZE:
-    case RES_CHRATR_CJK_LANGUAGE:
-    case RES_CHRATR_CJK_POSTURE:
-    case RES_CHRATR_CJK_WEIGHT:
-        bRet = nCurScript == i18n::ScriptType::ASIAN;
-        break;
-    case RES_CHRATR_CTL_FONT:
-    case RES_CHRATR_CTL_FONTSIZE:
-    case RES_CHRATR_CTL_LANGUAGE:
-    case RES_CHRATR_CTL_POSTURE:
-    case RES_CHRATR_CTL_WEIGHT:
-        bRet = nCurScript == i18n::ScriptType::COMPLEX;
-        break;
-    }
-    return bRet;
-}
-
-const SfxPoolItem& RTFEndPosLst::GetItem( USHORT nWhich ) const
-{
-    const SfxPoolItem* pItem = HasItem( nWhich );
-    if( !pItem )
-        pItem = &rNode.GetSwAttrSet().GetPool()->GetDefaultItem( nWhich );
-    return *pItem;
-}
-
-const SfxPoolItem* RTFEndPosLst::HasItem( USHORT nWhich ) const
-{
-    const SfxPoolItem* pItem;
-    if( RES_TXTATR_END > nWhich )
-    {
-        // it's a character/text attribute so look into the item array
-        for( USHORT n = Count(); n; )
-        {
-            SttEndPos* pTmp = GetObject( --n );
-            for( USHORT i = pTmp->GetAttrs().Count(); i; )
-            {
-                pItem = pTmp->GetAttrs()[ --i ];
-                if( pItem->Which() == nWhich )
-                    return pItem;
-
-                // look into the charfmt?
-                if( RES_TXTATR_CHARFMT == pItem->Which() &&
-                    ((SwFmtCharFmt*) pItem)->GetCharFmt() &&
-                    SFX_ITEM_SET == ((SwFmtCharFmt*) pItem)->GetCharFmt()->
-                        GetItemState( nWhich, TRUE, &pItem ))
-                    return pItem;
-            }
-        }
-    }
-
-    if( SFX_ITEM_SET != rNode.GetSwAttrSet().GetItemState(
-                                nWhich, TRUE, &pItem ))
-        pItem = 0;
-    return pItem;
-}
-
-const SfxPoolItem& SwRTFWriter::GetItem( USHORT nWhich ) const
-{
-    if( pCurEndPosLst )
-        return pCurEndPosLst->GetItem( nWhich );
-    if( pAttrSet )
-        return pAttrSet->Get( nWhich );
-
-    return pDoc->GetAttrPool().GetDefaultItem( nWhich );
-}
-
-static void OutSvxFrmDir(SwRTFWriter& rRTFWrt, const SfxPoolItem& rHt )
-{
-    // write it only for pasgedesc's - not for frames
-    SvxFrameDirectionItem aItem((const SvxFrameDirectionItem&)rHt);
-    USHORT nVal = 0;
-    const sal_Char* pStr = 0;
-    bool bRTL = false;
-
-    if (rRTFWrt.pFlyFmt)
-        aItem.SetValue(rRTFWrt.TrueFrameDirection(*rRTFWrt.pFlyFmt));
-
-    switch (aItem.GetValue())
-    {
-        case FRMDIR_ENVIRONMENT:
-            ASSERT(0, "Not expected to see FRMDIR_ENVIRONMENT here");
-            break;
-        case FRMDIR_VERT_TOP_RIGHT:
-            nVal = 1;
-            pStr = OOO_STRING_SVTOOLS_RTF_FRMTXTBRLV;
-            break;
-        case FRMDIR_HORI_RIGHT_TOP:
-            bRTL = true;
-//          nVal = 3;
-//          A val of three isn't working as expected in word :-( so leave it
-//          as normal ltr 0 textflow with rtl sect property, neither does
-//          the frame textflow
-//          pStr = OOO_STRING_SVTOOLS_RTF_FRMTXTBRL;
-            break;
-        case FRMDIR_VERT_TOP_LEFT:
-            nVal = 4;
-            pStr = OOO_STRING_SVTOOLS_RTF_FRMTXLRTBV;
-            break;
-    }
-
-    if( rRTFWrt.pFlyFmt && rRTFWrt.bRTFFlySyntax && pStr )
-    {
-        rRTFWrt.Strm() << pStr;
-        rRTFWrt.bOutFmtAttr = TRUE;
-    }
-    else if( rRTFWrt.bOutPageDesc)
-    {
-        if (nVal)
-        {
-            rRTFWrt.Strm() << OOO_STRING_SVTOOLS_RTF_STEXTFLOW;
-            rRTFWrt.OutULong( nVal );
-        }
-        if (bRTL)
-            rRTFWrt.Strm() << OOO_STRING_SVTOOLS_RTF_RTLSECT;
-        rRTFWrt.bOutFmtAttr = TRUE;
-    }
-    else if (!rRTFWrt.pFlyFmt && !rRTFWrt.bOutPageDesc)
-    {
-        rRTFWrt.Strm() << (bRTL ? OOO_STRING_SVTOOLS_RTF_RTLPAR : OOO_STRING_SVTOOLS_RTF_LTRPAR);
-        rRTFWrt.bOutFmtAttr = TRUE;
-    }
-}
-
-void OutRTF_SwRTL(SwRTFWriter& rWrt, const SwTxtNode *pNd)
-{
-    if (!pNd)
-        return;
-    SvxFrameDirection eDir = FRMDIR_ENVIRONMENT;
-    if (const SvxFrameDirectionItem* pItem = (const SvxFrameDirectionItem*)
-        pNd->GetSwAttrSet().GetItem(RES_FRAMEDIR))
-    {
-        eDir = static_cast<SvxFrameDirection>(pItem->GetValue());
-    }
-    if (eDir == FRMDIR_ENVIRONMENT)
-    {
-        SwPosition aPos(*pNd);
-        eDir =
-            static_cast<SvxFrameDirection>(rWrt.pDoc->GetTextDirection(aPos));
-    }
-    OutSvxFrmDir(rWrt, SvxFrameDirectionItem(eDir, RES_FRAMEDIR));
-}
-
-static Writer& OutRTF_SwTxtINetFmt( Writer& rWrt, const SfxPoolItem& rHt )
-{
-    const SwFmtINetFmt& rURL = (const SwFmtINetFmt&)rHt;
-    SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-    if( rURL.GetValue().Len() )
-    {
-        rWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_FIELD << '{' << OOO_STRING_SVTOOLS_RTF_IGNORE
-                    << OOO_STRING_SVTOOLS_RTF_FLDINST << " HYPERLINK ";
-
-        String sURL( rURL.GetValue() );
-        if( INET_MARK_TOKEN != sURL.GetChar(0) )
-        {
-            INetURLObject aTmp( URIHelper::simpleNormalizedMakeRelative(rWrt.GetBaseURL(),
-                                          sURL));
-
-
-            sURL = aTmp.GetURLNoMark( INetURLObject::DECODE_UNAMBIGUOUS);
-/*			if( INET_PROT_FILE == aTmp.GetProtocol() )
-            {
-                // WW97 wollen keine FILE-URL haben, sondern einen normalen
-                // Dateinamen. Aber ab WW2000 kennen sie FileURLs.
-                sURL = aTmp.GetFull();
-            }
-*/			rWrt.Strm()	<< '\"';
-            RTFOutFuncs::Out_String( rWrt.Strm(), sURL, rRTFWrt.eCurrentEncoding,
-                                    rRTFWrt.bWriteHelpFmt ) << "\" ";
-            sURL = aTmp.GetMark();
-        }
-
-        if( sURL.Len() )
-        {
-            rWrt.Strm() << "\\\\l \"";
-            sURL.Erase( 0, 1 );
-            RTFOutFuncs::Out_String( rWrt.Strm(), sURL, rRTFWrt.eCurrentEncoding,
-                                    rRTFWrt.bWriteHelpFmt ) << "\" ";
-        }
-
-        if( rURL.GetTargetFrame().Len() )
-        {
-            rWrt.Strm() << "\\\\t \"";
-            RTFOutFuncs::Out_String( rWrt.Strm(), rURL.GetTargetFrame(),
-                        rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt ) << "\" ";
-        }
-
-        rWrt.Strm() << "}{" << OOO_STRING_SVTOOLS_RTF_FLDRSLT << ' ';
-        rRTFWrt.bOutFmtAttr = false;
-
-        // und dann noch die Attributierung ausgeben
-        const SwCharFmt* pFmt;
-        const SwTxtINetFmt* pTxtAtr = rURL.GetTxtINetFmt();
-        if( pTxtAtr && 0 != ( pFmt = pTxtAtr->GetCharFmt() ))
-            OutRTF_SwFmt( rWrt, *pFmt );
-    }
-    return rWrt;
-}
-
-void HandleHyperlinks(Writer& rWrt, const SwpHints* pTxtAttrs, xub_StrLen nPos )
-{
-    USHORT nCount = pTxtAttrs ? pTxtAttrs->Count() : 0;
-    for(USHORT i = 0; i < nCount; ++i )
-    {
-        const SwTxtAttr* pHt = (*pTxtAttrs)[i];
-        const SfxPoolItem &rItem = pHt->GetAttr();
-        if (rItem.Which() == RES_TXTATR_INETFMT)
-        {
-            const xub_StrLen* pEnd;
-            if (nPos == *pHt->GetStart())
-                OutRTF_SwTxtINetFmt(rWrt, rItem);
-            if (0 != ( pEnd = pHt->GetEnd() ) && nPos == *pEnd)
-            {
-                // Hyperlinks werden als Felder geschrieben, aber der
-                // "FieldResult" // steht als Text im TextNode. Also muss bei
-                // diesen Attributen am // Ende 2 Klammern stehen!
-                rWrt.Strm() << "}}";
-            }
-        }
-    }
-}
-
-static Writer& OutRTF_SwTxtNode( Writer& rWrt, SwCntntNode& rNode )
-{
-    SwTxtNode * pNd = &((SwTxtNode&)rNode);
-    SwRTFWriter & rRTFWrt = (SwRTFWriter&)rWrt;
-    xub_StrLen nStrPos = rRTFWrt.pCurPam->GetPoint()->nContent.GetIndex();
-    RTFEndPosLst aEndPosLst( rRTFWrt, *pNd, nStrPos );
-    USHORT nAttrPos = 0;
-
-    const String& rStr = pNd->GetTxt();
-    xub_StrLen nEnde = rStr.Len();
-    if( rRTFWrt.pCurPam->GetPoint()->nNode == rRTFWrt.pCurPam->GetMark()->nNode )
-        nEnde = Min( nEnde, rRTFWrt.pCurPam->GetMark()->nContent.GetIndex() );
-
-    int bNewFmts = rRTFWrt.GetAttrSet() != &pNd->GetSwAttrSet();
-    if( bNewFmts )
-    {
-        // harte Attributierung am Node und am Vorgaenger ?
-        const SfxItemSet* pNdSet = pNd->GetpSwAttrSet();
-        if( pNdSet && rRTFWrt.GetAttrSet() && rRTFWrt.bAutoAttrSet &&
-            pNdSet->GetParent() == rRTFWrt.GetAttrSet()->GetParent() &&
-            pNdSet->Count() == rRTFWrt.GetAttrSet()->Count() )
-        {
-            // die beiden Parents sind gleich, dann teste doch mal die
-            // Attribute im Set
-
-            int bEqual = TRUE;
-            if( pNdSet->Count() )
-            {
-                SfxItemIter aIter( *rRTFWrt.GetAttrSet() );
-                const SfxPoolItem *pItem, *pCurr = aIter.GetCurItem();
-                while( TRUE )
-                {
-                    if( SFX_ITEM_SET != pNdSet->GetItemState( pCurr->Which(),
-                        false, &pItem ) || *pItem != *pCurr )
-                    {
-                        bEqual = false;
-                        break;
-                    }
-
-                    if( aIter.IsAtEnd() )
-                        break;
-                    pCurr = aIter.NextItem();
-                }
-            }
-            if (bEqual)
-                bNewFmts = false;
-        }
-        rRTFWrt.SetAttrSet( &pNd->GetSwAttrSet() );
-        rRTFWrt.bAutoAttrSet = 0 != pNdSet;
-    }
-
-    // Flag zuruecksetzen, damit nach der Ausgabe der Collection
-    // getestet werden kann, ob noch ein Blank auszugeben ist
-    rRTFWrt.bOutFmtAttr = false;
-
-    // in der Ausgabe eines Flys? Dann vorm ausgeben der AbsatzAttribute
-    // den Format-Pointer auf 0 setzen!
-    const SwFlyFrmFmt* pSaveFmt = rRTFWrt.pFlyFmt;
-
-    SfxItemSet aMergedSet(rRTFWrt.pDoc->GetAttrPool(), POOLATTR_BEGIN,
-        POOLATTR_END-1);
-    bool bDeep = false;
-
-    if( rRTFWrt.bWriteAll )
-    {
-        rRTFWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PARD << OOO_STRING_SVTOOLS_RTF_PLAIN << ' ';		// alle Attribute zuruecksetzen
-        if( rRTFWrt.bOutTable )
-            rRTFWrt.Strm() << OOO_STRING_SVTOOLS_RTF_INTBL;
-
-        // ist der aktuelle Absatz in einem freifliegenden Rahmen ? Dann
-        // muessen noch die Attribute dafuer ausgegeben werden.
-        if( pSaveFmt )
-        {
-            OutRTF_SwFlyFrmFmt( rRTFWrt );
-            rRTFWrt.pFlyFmt = 0;
-        }
-
-        rRTFWrt.OutListNum( *pNd );
-        OutRTF_SwRTL(rRTFWrt, pNd);
-        SwFmtToSet(rRTFWrt, pNd->GetAnyFmtColl(), aMergedSet);
-        bDeep = true;
-    }
-    else if( !rRTFWrt.bWriteAll && rRTFWrt.bFirstLine )
-    {
-        OutRTF_SwRTL(rRTFWrt, pNd);
-        SwFmtToSet(rRTFWrt, pNd->GetAnyFmtColl(), aMergedSet);
-        bDeep = true;
-    }
-
-    // gibt es harte Attributierung ?
-    if( pNd->HasSwAttrSet() )
-    {
-        rRTFWrt.pFlyFmt = 0;
-
-        const SfxItemSet& rNdSet = pNd->GetSwAttrSet();
-
-        const SwNumRule* pRule = pNd->GetNumRule();
-        // --> OD 2008-03-19 #refactorlists#
-        if ( pRule && pNd->IsInList() )
-        // <--
-        {
-            // --> OD 2008-03-18 #refactorlists#
-            ASSERT( pNd->GetActualListLevel() >= 0 && pNd->GetActualListLevel() < MAXLEVEL,
-                    "<OutRTF_SwTxtNode(..)> - text node does not have valid list level. Serious defect -> please inform OD" );
-            // <--
-            BYTE nLvl = static_cast< BYTE >(pNd->GetActualListLevel());
-            const SwNumFmt* pFmt = pRule->GetNumFmt( nLvl );
-            if( !pFmt )
-                pFmt = &pRule->Get( nLvl );
-
-            SfxItemSet aSet( rNdSet );
-            SvxLRSpaceItem aLR( (SvxLRSpaceItem&)rNdSet.Get( RES_LR_SPACE ) );
-
-            aLR.SetTxtLeft( aLR.GetTxtLeft() + pFmt->GetIndentAt() );
-            if( MAXLEVEL > pNd->GetActualListLevel() )
-                aLR.SetTxtFirstLineOfst( pFmt->GetFirstLineIndent() );
-            else
-                aSet.ClearItem( RES_PARATR_NUMRULE );
-            aSet.Put( aLR );
-            aMergedSet.Put(aSet);
-        }
-        else
-            aMergedSet.Put(rNdSet);
-    }
-
-    SwTxtNode *txtNode=rNode.GetTxtNode();
-    if (txtNode!=NULL && !txtNode->IsNumbered())
-    {
-        aMergedSet.ClearItem(RES_PARATR_NUMRULE);
-    }
-    OutRTF_SfxItemSet(rRTFWrt, aMergedSet, bDeep);
-
-    rRTFWrt.pFlyFmt = pSaveFmt;
-
-    rRTFWrt.bTxtAttr = true;
-    // erstmal den Start berichtigen. D.h. wird nur ein Teil vom Satz
-    // ausgegeben, so muessen auch da die Attribute stimmen!!
-    const SwTxtAttr * pHt = 0;
-    USHORT nCntAttr = pNd->HasHints() ? pNd->GetSwpHints().Count() : 0;
-    if( nCntAttr && nStrPos > *( pHt = pNd->GetSwpHints()[ 0 ] )->GetStart() )
-    {
-        // Ok, es gibt vorher Attribute, die ausgegeben werden muessen
-        do {
-            nAttrPos++;
-            if( RES_TXTATR_FIELD == pHt->Which() )		// Felder nicht
-                continue;                               // ausgeben
-
-            if( pHt->GetEnd() )
-            {
-                xub_StrLen nHtEnd = *pHt->GetEnd(), nHtStt = *pHt->GetStart();
-                if( !rRTFWrt.bWriteAll && nHtEnd <= nStrPos )
-                    continue;
-
-                // leere Hints am Anfang nicht beachten, oder ??
-                if( nHtEnd == nHtStt )
-                    continue;
-
-                // Attribut in die Liste aufnehemen
-                if( !rRTFWrt.bWriteAll )
-                {
-                    if( nHtStt < nStrPos ) nHtStt = nStrPos;
-                    if( nHtEnd >= nEnde ) nHtEnd = nEnde;
-                }
-                aEndPosLst.Insert( pHt->GetAttr(), nHtStt, nHtEnd );
-                continue;
-                // aber nicht ausgeben, das erfolgt spaeter !!
-            }
-            Out( aRTFAttrFnTab, pHt->GetAttr(), rRTFWrt );
-
-        } while( nAttrPos < nCntAttr && nStrPos >
-            *( pHt = pNd->GetSwpHints()[ nAttrPos ] )->GetStart() );
-
-        // dann gebe mal alle gesammelten Attribute von der String-Pos aus
-        aEndPosLst.OutAttrs( nStrPos );
-    }
-
-    if( rRTFWrt.bOutFmtAttr &&
-        ( nAttrPos < nCntAttr ? *pHt->GetStart() != nStrPos : TRUE ))
-        rRTFWrt.Strm() << ' ';
-
-    // das Flag gibt an, ob das SwTxtFld am Ende vom Absatz steht. Denn
-    // dann ist vor dem Absatzumbruch die schliessende Klammer auszugeben
-    xub_StrLen nChrCnt = 0;
-    for( ; nStrPos <= nEnde; nStrPos++ )
-    {
-        rRTFWrt.bOutFmtAttr = false;
-        if( nStrPos != nEnde && aEndPosLst.Count() )
-            aEndPosLst.EndAttrs( nStrPos );
-
-        // versuche nach ungefaehr 255 Zeichen eine neue Zeile zu beginnen
-        if( nChrCnt != ( nStrPos & 0xff00 ))
-        {
-            rWrt.Strm() << SwRTFWriter::sNewLine;
-            nChrCnt = nStrPos & 0xff00;
-        }
-
-        if( nAttrPos < nCntAttr && *pHt->GetStart() == nStrPos
-            && nStrPos != nEnde )
-        {
-            do {
-                BOOL bEmpty = false;
-                if( pHt->GetEnd() )
-                {
-                    if (false == (bEmpty = *pHt->GetEnd() == nStrPos))
-                    {
-                        aEndPosLst.Insert( pHt->GetAttr(), nStrPos,
-                                            *pHt->GetEnd() );
-                        continue;
-                    }
-                    rRTFWrt.Strm() << '{';
-                }
-                Out( aRTFAttrFnTab, pHt->GetAttr(), rRTFWrt );
-                if( bEmpty )
-                {
-                    rRTFWrt.Strm() << '}';
-                    rRTFWrt.bOutFmtAttr = false;
-                }
-            } while( ++nAttrPos < nCntAttr && nStrPos ==
-                *( pHt = pNd->GetSwpHints()[ nAttrPos ] )->GetStart() );
-
-            // dann gebe mal alle gesammelten Attribute von der String-Pos aus
-            aEndPosLst.OutAttrs( nStrPos );
-
-        }
-        else
-            aEndPosLst.OutScriptChange( nStrPos );
-
-        HandleHyperlinks(rWrt, pNd->GetpSwpHints(), nStrPos);
-
-        if( rRTFWrt.bOutFmtAttr )
-            rRTFWrt.Strm() << ' ';
-
-        rRTFWrt.OutBookmarks( nStrPos );
-
-        rRTFWrt.OutRedline( nStrPos);
-
-        if (nStrPos != nEnde)
-        {
-            RTFOutFuncs::Out_String(rWrt.Strm(), String(rStr.GetChar(nStrPos)),
-                rRTFWrt.eCurrentEncoding, rRTFWrt.bWriteHelpFmt);
-        }
-    }
-
-    rRTFWrt.bTxtAttr = false;
-
-    // noch eine schliesende Klammer da ??
-    if( aEndPosLst.Count() )
-        aEndPosLst.EndAttrs( USHRT_MAX );
-
-    // wenn bis zum Ende vom Node, dann auch das AbsatzEnde ausgeben
-    if( rRTFWrt.pCurPam->GetMark()->nNode.GetIndex() ==
-        rRTFWrt.pCurPam->GetPoint()->nNode.GetIndex() )
-    {
-        if( pNd->Len() != rRTFWrt.pCurPam->GetMark()->nContent.GetIndex() )
-            return rWrt;
-
-        if( rRTFWrt.bOutTable )
-        {
-            rRTFWrt.Strm() << SwRTFWriter::sNewLine;
-            return rWrt;
-        }
-    }
-
-    rRTFWrt.Strm() << SwRTFWriter::sNewLine << OOO_STRING_SVTOOLS_RTF_PAR << ' ';
-    return rRTFWrt;
-}
-
-bool IsEMF(const sal_uInt8 *pGraphicAry, unsigned long nSize)
-{
-    if (pGraphicAry && (nSize > 0x2c ))
-    {
-        // check the magic number
-        if (
-             (pGraphicAry[0x28] == 0x20 ) && (pGraphicAry[0x29] == 0x45) &&
-             (pGraphicAry[0x2a] == 0x4d ) && (pGraphicAry[0x2b] == 0x46)
-           )
-        {
-            //emf detected
-            return true;
-        }
-    }
-    return false;
-}
-
-bool StripMetafileHeader(const sal_uInt8 *&rpGraphicAry, unsigned long &rSize)
-{
-    if (rpGraphicAry && (rSize > 0x22))
-    {
-        if (
-             (rpGraphicAry[0] == 0xd7) && (rpGraphicAry[1] == 0xcd) &&
-             (rpGraphicAry[2] == 0xc6) && (rpGraphicAry[3] == 0x9a)
-           )
-        {	// we have to get rid of the metafileheader
-            rpGraphicAry += 22;
-            rSize -= 22;
-            return true;
-        }
-    }
-    return false;
-}
-
-void ExportPICT(const Size &rOrig, const Size &rRendered, const Size &rMapped,
-    const SwCropGrf &rCr, const char *pBLIPType, const sal_uInt8 *pGraphicAry,
-    unsigned long nSize, SwRTFWriter &rWrt)
-{
-    bool bIsWMF = (const char *)pBLIPType == (const char *)OOO_STRING_SVTOOLS_RTF_WMETAFILE ? true : false;
-    if (pBLIPType && nSize && pGraphicAry)
-    {
-        rWrt.Strm() << '{' << OOO_STRING_SVTOOLS_RTF_PICT;
-
-        long nXCroppedSize = rOrig.Width()-(rCr.GetLeft() + rCr.GetRight());
-        long nYCroppedSize = rOrig.Height()-(rCr.GetTop() + rCr.GetBottom());
-        /* #127543#: Graphic with a zero height or width, typically copied from webpages, caused
-        crashes. */
-        if( !nXCroppedSize )
-            nXCroppedSize = 100;
-        if( !nYCroppedSize )
-            nYCroppedSize = 100;
-
-        //Given the original size and taking cropping into account
-        //first, how much has the original been scaled to get the
-        //final rendered size
-        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICSCALEX;
-        rWrt.OutLong((100 * rRendered.Width()) / nXCroppedSize);
-        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICSCALEY;
-        rWrt.OutLong((100 * rRendered.Height()) / nYCroppedSize);
-
-        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICCROPL;
-        rWrt.OutLong(rCr.GetLeft());
-        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICCROPR;
-        rWrt.OutLong(rCr.GetRight());
-        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICCROPT;
-        rWrt.OutLong(rCr.GetTop());
-        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICCROPB;
-        rWrt.OutLong(rCr.GetBottom());
-
-        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICW;
-        rWrt.OutLong(rMapped.Width());
-        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICH;
-        rWrt.OutLong(rMapped.Height());
-
-        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICWGOAL;
-        rWrt.OutLong(rOrig.Width());
-        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_PICHGOAL;
-        rWrt.OutLong(rOrig.Height());
-
-        rWrt.Strm() << pBLIPType;
-        if (bIsWMF)
-        {
-            rWrt.OutLong(8);
-            StripMetafileHeader(pGraphicAry, nSize);
-        }
-        rWrt.Strm() << SwRTFWriter::sNewLine;
-
-        sal_uInt32 nBreak = 0;
-        for (sal_uInt32 nI = 0; nI < nSize; ++nI)
-        {
-            ByteString sNo = ByteString::CreateFromInt32(pGraphicAry[nI], 16);
-            if (sNo.Len() < 2)
-                rWrt.Strm() << '0';
-            rWrt.Strm() << sNo.GetBuffer();
-            if (++nBreak == 64)
-            {
-                rWrt.Strm() << SwRTFWriter::sNewLine;
-                nBreak = 0;
-            }
-        }
-
-        rWrt.Strm() << '}';
-    }
-}
-
-static Writer& OutRTF_SwGrfNode(Writer& rWrt, SwCntntNode & rNode)
-{
-    SwRTFWriter & rRTFWrt = (SwRTFWriter&)rWrt;
-    SwGrfNode &rNd = (SwGrfNode&)rNode;
-
-    // ist der aktuelle Absatz in einem freifliegenden Rahmen ? Dann
-    // muessen noch die Attribute dafuer ausgegeben werden.
-    if (rRTFWrt.pFlyFmt && !ExportAsInline(*rRTFWrt.pFlyFmt))
-        OutRTF_SwFlyFrmFmt(rRTFWrt);    //"classic" positioning and size export
-
-#if 1
-    SvMemoryStream aStream;
-    const sal_uInt8* pGraphicAry = 0;
-    sal_uInt32 nSize = 0;
-
-    Graphic aGraphic(rNd.GetGrf());
-
-    // If there is no graphic there is not much point in parsing it
-    if(aGraphic.GetType()==GRAPHIC_NONE)
-        return rRTFWrt;
-
-    GfxLink aGraphicLink;
-    const sal_Char* pBLIPType = 0;
-    if (aGraphic.IsLink())
-    {
-        aGraphicLink = aGraphic.GetLink();
-        nSize = aGraphicLink.GetDataSize();
-        pGraphicAry = aGraphicLink.GetData();
-        switch (aGraphicLink.GetType())
-        {
-            case GFX_LINK_TYPE_NATIVE_JPG:
-                pBLIPType = OOO_STRING_SVTOOLS_RTF_JPEGBLIP;
-                break;
-            case GFX_LINK_TYPE_NATIVE_PNG:
-                pBLIPType = OOO_STRING_SVTOOLS_RTF_PNGBLIP;
-            case GFX_LINK_TYPE_NATIVE_WMF:
-                pBLIPType =
-                    IsEMF(pGraphicAry, nSize) ? OOO_STRING_SVTOOLS_RTF_EMFBLIP : OOO_STRING_SVTOOLS_RTF_WMETAFILE;
-                break;
-            default:
-                break;
-        }
-    }
-
-    GraphicType eGraphicType = aGraphic.GetType();
-    if (!pGraphicAry)
-    {
-        if (ERRCODE_NONE == GraphicConverter::Export(aStream, aGraphic,
-            (eGraphicType == GRAPHIC_BITMAP) ? CVT_PNG : CVT_WMF))
-        {
-            pBLIPType = (eGraphicType == GRAPHIC_BITMAP) ?
-                OOO_STRING_SVTOOLS_RTF_PNGBLIP : OOO_STRING_SVTOOLS_RTF_WMETAFILE;
-            aStream.Seek(STREAM_SEEK_TO_END);
-            nSize = aStream.Tell();
-            pGraphicAry = (sal_uInt8*)aStream.GetData();
-        }
-    }
-
-    Size aMapped(eGraphicType == GRAPHIC_BITMAP ? aGraphic.GetSizePixel() : aGraphic.GetPrefSize());
-
-    const SwCropGrf &rCr = (const SwCropGrf &)rNd.GetAttr(RES_GRFATR_CROPGRF);
-
-    //Get original size in twips
-    Size aSize(sw::util::GetSwappedInSize(rNd));
-    Size aRendered(aSize);
-    if (rRTFWrt.pFlyFmt)
-    {
-        const SwFmtFrmSize& rS = rRTFWrt.pFlyFmt->GetFrmSize();
-        aRendered.Width() = rS.GetWidth();
-        aRendered.Height() = rS.GetHeight();
-    }
-
-    /*
-     If the graphic is not of type WMF then we will have to store two
-     graphics, one in the native format wrapped in shppict, and the other in
-     the wmf format wrapped in nonshppict, so as to keep wordpad happy. If its
-     a wmf already then we don't need any such wrapping
-    */
-    bool bIsWMF = (const sal_Char*)pBLIPType == (const sal_Char*)OOO_STRING_SVTOOLS_RTF_WMETAFILE ? true : false;
-    if (!bIsWMF)
-        OutComment(rRTFWrt, OOO_STRING_SVTOOLS_RTF_SHPPICT);
-
-    if (pBLIPType)
-        ExportPICT(aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, rRTFWrt);
-    else
-    {
-        aStream.Seek(0);
-        GraphicConverter::Export(aStream, aGraphic, CVT_WMF);
-        pBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE;
-        aStream.Seek(STREAM_SEEK_TO_END);
-        nSize = aStream.Tell();
-        pGraphicAry = (sal_uInt8*)aStream.GetData();
-
-        ExportPICT(aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize,
-            rRTFWrt);
-    }
-
-    if (!bIsWMF)
-    {
-        rRTFWrt.Strm() << '}' << '{' << OOO_STRING_SVTOOLS_RTF_NONSHPPICT;
-
-        aStream.Seek(0);
-        GraphicConverter::Export(aStream, aGraphic, CVT_WMF);
-        pBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE;
-        aStream.Seek(STREAM_SEEK_TO_END);
-        nSize = aStream.Tell();
-        pGraphicAry = (sal_uInt8*)aStream.GetData();
-
-        ExportPICT(aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize,
-            rRTFWrt);
-
-        rRTFWrt.Strm() << '}';
-    }
-
-
-    rRTFWrt.Strm() << SwRTFWriter::sNewLine;
-#else
-    rRTFWrt.Strm() << "{{";
-
-    // damit die eigenen Grafik-Attribute nach der PICT / import Anweisung
-    // stehen, muessen die am Anfang ausgegeben werden.
-    rRTFWrt.bOutFmtAttr = false;
-    OutRTF_SwFmt( rRTFWrt, *pNd->GetFmtColl() );
-
-    if( rRTFWrt.bOutFmtAttr )		// wurde ueberhaupt ein Attrribut
-        rRTFWrt.Strm() << "}{";		// ausgegeben ??
-
-    String aGrfNm;
-    const SwMirrorGrf& rMirror = pNd->GetSwAttrSet().GetMirrorGrf();
-    if( !pNd->IsLinkedFile() || RES_MIRROR_GRAPH_DONT != rMirror.GetValue() )
-    {
-        USHORT nErr = 1;
-        // Grafik als File-Referenz speichern (als JPEG-Grafik speichern)
-        // but only if we save into a file and have a URL
-        if( rWrt.GetOrigFileName() )
-        {
-            aGrfNm = *rWrt.GetOrigFileName();
-            pNd->SwapIn( TRUE );
-            ULONG nFlags = XOUTBMP_USE_NATIVE_IF_POSSIBLE;
-            switch( rMirror.GetValue() )
-            {
-            case RES_MIRROR_GRAPH_VERT: nFlags = XOUTBMP_MIRROR_HORZ; break;
-            case RES_MIRROR_GRAPH_HOR:    nFlags = XOUTBMP_MIRROR_VERT; break;
-            case RES_MIRROR_GRAPH_BOTH:
-                nFlags = XOUTBMP_MIRROR_VERT | XOUTBMP_MIRROR_HORZ;
-                break;
-            }
-
-            Size aMM100Size;
-            Size* pMM100Size = 0;
-            if( rRTFWrt.pFlyFmt )
-            {
-                const SwFmtFrmSize& rSize = rRTFWrt.pFlyFmt->GetFrmSize();
-                aMM100Size = OutputDevice::LogicToLogic( rSize.GetSize(),
-                                MapMode( MAP_TWIP ), MapMode( MAP_100TH_MM ));
-                pMM100Size = &aMM100Size;
-            }
-
-            nErr = XOutBitmap::WriteGraphic( pNd->GetGrf(), aGrfNm,
-                    String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "JPG" )),
-                                                    nFlags, pMM100Size );
-        }
-        if( nErr )     			// fehlerhaft, da ist nichts auszugeben
-        {
-            rRTFWrt.Strm() << "}}";
-            return rWrt;
-        }
-    }
-    else
-        pNd->GetFileFilterNms( &aGrfNm, 0 );
-
-    // MIB->JP: Warum erst AbsToRel und dann das URL-Objekt? So
-    // kommt bei relativierbaren URLs als Protokoll "unknown" raus.
-    // Ist das Absicht?
-    aGrfNm = INetURLObject::AbsToRel( aGrfNm, INetURLObject::WAS_ENCODED,
-                                    INetURLObject::DECODE_UNAMBIGUOUS);
-    INetURLObject aUrl( aGrfNm );
-    if( aUrl.GetProtocol() == INET_PROT_FILE )
-        aGrfNm = aUrl.PathToFileName();
-
-    // Bitmap als File-Referenz speichern
-    rRTFWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FIELD << OOO_STRING_SVTOOLS_RTF_FLDPRIV;
-    OutComment( rRTFWrt, OOO_STRING_SVTOOLS_RTF_FLDINST ) << "{\\\\import ";
-    RTFOutFuncs::Out_String( rWrt.Strm(), aGrfNm, rRTFWrt.eDefaultEncoding,
-                                rRTFWrt.bWriteHelpFmt );
-    rRTFWrt.Strm() << "}}{" << OOO_STRING_SVTOOLS_RTF_FLDRSLT << " }}";
-    rRTFWrt.Strm() << '}' << SwRTFWriter::sNewLine;
-#endif
-    return rRTFWrt;
-}
-
-static Writer& OutRTF_SwOLENode( Writer& rWrt, SwCntntNode & /*rNode*/ )
-{
-    SwRTFWriter & rRTFWrt = (SwRTFWriter&)rWrt;
-
-    // ist der aktuelle Absatz in einem freifliegenden Rahmen ? Dann
-    // muessen noch die Attribute dafuer ausgegeben werden.
-    if( rRTFWrt.pFlyFmt )
-        OutRTF_SwFlyFrmFmt( rRTFWrt );
-
-    rWrt.Strm() << SwRTFWriter::sNewLine << OOO_STRING_SVTOOLS_RTF_PAR;
-    return rWrt;
-}
-
-static void OutTBLBorderLine(SwRTFWriter& rWrt, const SvxBorderLine* pLine,
-    const sal_Char* pStr)
-{
-    ByteString sLineStr;
-    if( pLine->GetInWidth() )
-    {
-        // doppelte Linie
-        sLineStr = OOO_STRING_SVTOOLS_RTF_BRDRDB;
-        switch( pLine->GetInWidth() )
-        {
-        case DEF_LINE_WIDTH_0:
-            ( sLineStr += OOO_STRING_SVTOOLS_RTF_BRDRW ) += "15";
-            break;
-        case DEF_LINE_WIDTH_1:
-            ( sLineStr += OOO_STRING_SVTOOLS_RTF_BRDRW ) += "30";
-            break;
-        case DEF_LINE_WIDTH_2:
-        case DEF_LINE_WIDTH_3:
-            ( sLineStr += OOO_STRING_SVTOOLS_RTF_BRDRW ) += "45";
-            break;
-        }
-    }
-    else
-    {
-        if ( DEF_LINE_WIDTH_0 == pLine->GetOutWidth( ) )
-            // Hairline
-            sLineStr = OOO_STRING_SVTOOLS_RTF_BRDRHAIR;
-        else if( 255 >= pLine->GetOutWidth() )
-        {
-            // Simple width simple
-            sLineStr = OOO_STRING_SVTOOLS_RTF_BRDRS;
-            switch ( pLine->GetStyle( ) )
-            {
-                case DOTTED:
-                    sLineStr = OOO_STRING_SVTOOLS_RTF_BRDRDOT;
-                    break;
-                case DASHED:
-                    sLineStr = OOO_STRING_SVTOOLS_RTF_BRDRDASH;
-                    break;
-                case SOLID:
-                default:
-                    break;
-            }
-            ( sLineStr += OOO_STRING_SVTOOLS_RTF_BRDRW ) +=
-                        ByteString::CreateFromInt32( pLine->GetOutWidth() );
-        }
-        else
-            // Shouldn't happen with the OOo default width values
-            (( sLineStr = OOO_STRING_SVTOOLS_RTF_BRDRTH ) += sLineStr += OOO_STRING_SVTOOLS_RTF_BRDRW ) +=
-                        ByteString::CreateFromInt32( pLine->GetOutWidth() / 2 );
-    }
-
-    rWrt.Strm() << pStr << sLineStr.GetBuffer() << OOO_STRING_SVTOOLS_RTF_BRDRCF;
-    rWrt.OutULong( rWrt.GetId( pLine->GetColor() ) );
-}
-
-static void OutBorderLine(SwRTFWriter& rWrt, const SvxBorderLine* pLine,
-    const sal_Char* pStr, USHORT nDist)
-{
-    OutTBLBorderLine(rWrt, pLine, pStr);
-    rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_BRSP;
-    rWrt.OutULong( nDist );
-}
-
-static void OutSwTblBorder(SwRTFWriter& rWrt, const SvxBoxItem& rBox,
-    const SvxBoxItem *pDefault)
-{
-    static const USHORT aBorders[] =
-    {
-        BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT
-    };
-#ifdef __MINGW32__
-    static const char* aBorderNames[] __attribute__((section(".data"))) =
-#else
-    static const char* aBorderNames[] =
-#endif
-    {
-        OOO_STRING_SVTOOLS_RTF_CLBRDRT, OOO_STRING_SVTOOLS_RTF_CLBRDRL, OOO_STRING_SVTOOLS_RTF_CLBRDRB, OOO_STRING_SVTOOLS_RTF_CLBRDRR
-    };
-    //Yes left and top are swapped with eachother for cell padding! Because
-    //that's what the thunderingly annoying rtf export/import word xp does.
-#ifdef __MINGW32__
-    static const char* aCellPadNames[] __attribute__((section(".data"))) =
-#else
-    static const char* aCellPadNames[] =
-#endif
-    {
-        OOO_STRING_SVTOOLS_RTF_CLPADL, OOO_STRING_SVTOOLS_RTF_CLPADT, OOO_STRING_SVTOOLS_RTF_CLPADB, OOO_STRING_SVTOOLS_RTF_CLPADR
-    };
-#ifdef __MINGW32__
-    static const char* aCellPadUnits[] __attribute__((section(".data"))) =
-#else
-    static const char* aCellPadUnits[] =
-#endif
-    {
-        OOO_STRING_SVTOOLS_RTF_CLPADFL, OOO_STRING_SVTOOLS_RTF_CLPADFT, OOO_STRING_SVTOOLS_RTF_CLPADFB, OOO_STRING_SVTOOLS_RTF_CLPADFR
-    };
-    for (int i = 0; i < 4; ++i)
-    {
-        if (const SvxBorderLine* pLn = rBox.GetLine(aBorders[i]))
-            OutTBLBorderLine(rWrt, pLn, aBorderNames[i]);
-        if (!pDefault || pDefault->GetDistance(aBorders[i]) !=
-            rBox.GetDistance(aBorders[i]))
-        {
-            rWrt.Strm() << aCellPadUnits[i];
-            rWrt.OutULong(3);
-            rWrt.Strm() << aCellPadNames[i];
-            rWrt.OutULong(rBox.GetDistance(aBorders[i]));
-        }
-    }
-}
-
-static void OutSwTblBackground( SwRTFWriter& rWrt, const SvxBrushItem& rBack )
-{
-    if( !rBack.GetColor().GetTransparency() )
-    {
-        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CLCBPAT;
-        rWrt.OutULong( rWrt.GetId( rBack.GetColor() ) );
-    }
-}
-
-
-Writer& OutRTF_SwTblNode(Writer& rWrt, const SwTableNode & rNode)
-{
-    SwRTFWriter & rRTFWrt = (SwRTFWriter&)rWrt;
-    const SwTable& rTbl = rNode.GetTable();
-    SwTwips nPageSize = 0, nTblOffset = 0;
-    const bool bNewTableModel = rTbl.IsNewModel();
-
-/*
-//!!!!!!!!!!!!! for clipboard create any view if the table is complex !!!
-    if( rTbl.IsTblComplex() )
-    {
-        // then we have to create any layout
-        SFX_APP()->CreateViewFrame( *xDocSh, 0, TRUE );
-    }
-*/
-
-    const SwFrmFmt *pFmt = rTbl.GetFrmFmt();
-    ASSERT(pFmt, "Impossible");
-    {
-        Point aPt;
-        SwRect aRect( pFmt->FindLayoutRect( false, &aPt ));
-        if( aRect.IsEmpty() )
-        {
-            // dann besorge mal die Seitenbreite ohne Raender !!
-            const SwFrmFmt* pFrmFmt = rRTFWrt.pFlyFmt ? rRTFWrt.pFlyFmt :
-                const_cast<const SwDoc *>(rWrt.pDoc)
-                ->GetPageDesc(0).GetPageFmtOfNode(rNode, false);
-
-            aRect = pFrmFmt->FindLayoutRect( TRUE );
-            if( 0 == ( nPageSize = aRect.Width() ))
-            {
-                const SvxLRSpaceItem& rLR = pFrmFmt->GetLRSpace();
-                nPageSize = pFrmFmt->GetFrmSize().GetWidth() -
-                                rLR.GetLeft() - rLR.GetRight();
-            }
-        }
-        else
-            nPageSize = aRect.Width();
-    }
-
-    SwTwips nTblSz = pFmt->GetFrmSize().GetWidth();
-
-    ByteString aTblAdjust( OOO_STRING_SVTOOLS_RTF_TRQL );
-    switch (pFmt->GetHoriOrient().GetHoriOrient())
-    {
-        case text::HoriOrientation::CENTER:
-            aTblAdjust = OOO_STRING_SVTOOLS_RTF_TRQC;
-            break;
-        case text::HoriOrientation::RIGHT:
-            aTblAdjust = OOO_STRING_SVTOOLS_RTF_TRQR;
-            break;
-        case text::HoriOrientation::NONE:
-        case text::HoriOrientation::LEFT_AND_WIDTH:
-            {
-                const SvxLRSpaceItem& rLRSp = pFmt->GetLRSpace();
-                nTblOffset = rLRSp.GetLeft();
-                nPageSize -= (nTblOffset + rLRSp.GetRight());
-                aTblAdjust += OOO_STRING_SVTOOLS_RTF_TRLEFT;
-                aTblAdjust += ByteString::CreateFromInt32( nTblOffset );
-            }
-            break;
-        default:
-            break;
-    }
-
-    if (rRTFWrt.TrueFrameDirection(*pFmt) == FRMDIR_HORI_RIGHT_TOP)
-        aTblAdjust += OOO_STRING_SVTOOLS_RTF_RTLROW;
-
-    // ist die Tabelle wesentlich (PageSize + 10%) groesser als die Seite,
-    // dann sind die Box-Breiten relative Angaben.
-    BOOL bRelBoxSize = TRUE /*ALWAYS relativ (nPageSize + ( nPageSize / 10 )) < nTblSz*/;
-
-    SwWriteTable* pTableWrt;
-    const SwHTMLTableLayout *pLayout = rTbl.GetHTMLTableLayout();
-    if( pLayout && pLayout->IsExportable() )
-        pTableWrt = new SwWriteTable( pLayout );
-    else
-        pTableWrt = new SwWriteTable(rTbl.GetTabLines(), (USHORT)nPageSize,
-                                          (USHORT)nTblSz, false);
-
-    // rCols are the array of all cols of the table
-    const SwWriteTableCols& rCols = pTableWrt->GetCols();
-    USHORT nColCnt = rCols.Count();
-    SwWriteTableCellPtr* pBoxArr = new SwWriteTableCellPtr[ nColCnt ];
-    USHORT* pRowSpans = new USHORT[ nColCnt ];
-    memset( pBoxArr, 0, sizeof( pBoxArr[0] ) * nColCnt );
-    memset( pRowSpans, 0, sizeof( pRowSpans[0] ) * nColCnt );
-    const SwWriteTableRows& rRows = pTableWrt->GetRows();
-    for( USHORT nLine = 0; nLine < rRows.Count(); ++nLine )
-    {
-        USHORT nBox;
-
-        const SwWriteTableRow *pRow = rRows[ nLine ];
-        const SwWriteTableCells& rCells = pRow->GetCells();
-
-        BOOL bFixRowHeight = false;
-        
-        USHORT nBoxes = rCells.Count();
-        if (nColCnt < nBoxes)
-            nBoxes = nColCnt;
-        
-        for( nColCnt = 0, nBox = 0; nBox < rCells.Count() && nColCnt < nBoxes; ++nColCnt )
-        {
-            SwWriteTableCell* pCell = rCells[ nBox ];
-            const bool bProcessCoveredCell = bNewTableModel && 0 == pCell->GetRowSpan();
-
-            if( !pRowSpans[ nColCnt ] || bProcessCoveredCell )
-            {
-                // set new BoxPtr
-                nBox++;
-                pBoxArr[ nColCnt ] = pCell;
-                if ( !bProcessCoveredCell )
-                    pRowSpans[ nColCnt ] = pCell->GetRowSpan();
-                for( USHORT nCellSpan = pCell->GetColSpan(), nCS = 1;
-                        nCS < nCellSpan; ++nCS, ++nColCnt )
-                {
-                    ASSERT( nColCnt+1 < rCols.Count(), "More colspan than columns" );
-                    if( nColCnt+1 < rCols.Count() ) // robust against wrong colspans
-                    {
-                        pBoxArr[ nColCnt+1 ] = pBoxArr[ nColCnt ];
-                        pRowSpans[ nColCnt+1 ] = pRowSpans[ nColCnt ];
-                    }
-                }
-            }
-            if( 1 != pRowSpans[ nColCnt ] && !bNewTableModel )
-                bFixRowHeight = TRUE;
-        }
-
-        for( ; nColCnt < rCols.Count() && pRowSpans[ nColCnt ]; ++nColCnt )
-            bFixRowHeight = TRUE;
-
-        nColCnt = rCols.Count(); // A wrong cellspan-value could cause a nColCnt > rCols.Count()
-
-        // Start Tabellendefinition
-        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_TROWD << aTblAdjust.GetBuffer();
-
-        if(  rTbl.GetRowsToRepeat() > nLine )
-            rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_TRHDR;
-
-        const SwTableLine* pLine = pBoxArr[ 0 ]->GetBox()->GetUpper();
-        // Zeilenhoehe ausgeben
-        long nHeight = 0;
-        if( bFixRowHeight && rWrt.pDoc->GetRootFrm() )
-        {
-            nHeight = -pRow->GetPos();		//neg. => abs. height!
-            if( nLine )
-                nHeight += rRows[ nLine - 1 ]->GetPos();
-        }
-        else
-        {
-            const SwFmtFrmSize& rLSz = pLine->GetFrmFmt()->GetFrmSize();
-            if( ATT_VAR_SIZE != rLSz.GetHeightSizeType() && rLSz.GetHeight() )
-                nHeight = ATT_MIN_SIZE == rLSz.GetHeightSizeType()
-                                                ? rLSz.GetHeight()
-                                                : -rLSz.GetHeight();
-        }
-
-        //The rtf default is to allow a row to break, so if we are not
-        //splittable export TRKEEP
-        const SwFrmFmt *pLineFmt = pLine ? pLine->GetFrmFmt() : 0;
-        if (!pLineFmt || pLineFmt->GetRowSplit().GetValue() == 0)
-            rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_TRKEEP;
-
-        if( nHeight )
-        {
-            rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_TRRH;
-            rWrt.OutLong( nHeight );
-        }
-
-        const SvxBoxItem *pDefaultBox = 0;
-        if (nColCnt)
-        {
-            pDefaultBox = &(pBoxArr[0]->GetBox()->GetFrmFmt()->GetBox());
-
-            static const USHORT aBorders[] =
-            {
-                BOX_LINE_TOP, BOX_LINE_LEFT, BOX_LINE_BOTTOM, BOX_LINE_RIGHT
-            };
-#ifdef __MINGW32__
-            static const char* aRowPadNames[] __attribute__((section(".data"))) =
-#else
-            static const char* aRowPadNames[] =
-#endif
-            {
-                OOO_STRING_SVTOOLS_RTF_TRPADDT, OOO_STRING_SVTOOLS_RTF_TRPADDL, OOO_STRING_SVTOOLS_RTF_TRPADDB, OOO_STRING_SVTOOLS_RTF_TRPADDR
-            };
-            static const char* aRowPadUnits[] =
-            {
-                OOO_STRING_SVTOOLS_RTF_TRPADDFT, OOO_STRING_SVTOOLS_RTF_TRPADDFL, OOO_STRING_SVTOOLS_RTF_TRPADDFB, OOO_STRING_SVTOOLS_RTF_TRPADDFR
-            };
-            for (int i = 0; i < 4; ++i)
-            {
-                rWrt.Strm() << aRowPadUnits[i];
-                rWrt.OutULong(3);
-                rWrt.Strm() << aRowPadNames[i];
-                rWrt.OutULong(pDefaultBox->GetDistance(aBorders[i]));
-            }
-        }
-
-        // Breite der Boxen ausgeben
-        SwTwips nSz = 0, nCalc;
-        for( nBox = 0; nBox < nColCnt; ++nBox )
-        {
-            SwWriteTableCell* pCell = pBoxArr[ nBox ];
-            if( (nBox && pBoxArr[ nBox-1 ] == pBoxArr[ nBox ]) || (pCell == NULL) )
-                continue;
-
-            const SwFrmFmt& rFmt = *pCell->GetBox()->GetFrmFmt();
-            if( 1 < pCell->GetRowSpan() || 0 == pCell->GetRowSpan() )
-                rWrt.Strm() << ( pCell->GetRowSpan() == pRowSpans[ nBox ]
-                                ? OOO_STRING_SVTOOLS_RTF_CLVMGF
-                                : OOO_STRING_SVTOOLS_RTF_CLVMRG );
-
-            const SfxPoolItem* pItem;
-            if (SFX_ITEM_SET == rFmt.GetAttrSet().GetItemState(RES_BOX, TRUE,
-                &pItem))
-            {
-                OutSwTblBorder(rRTFWrt, (SvxBoxItem&)*pItem, pDefaultBox);
-            }
-
-// RTF kennt Schattierung in unserem Sinne nicht!
-//				if( SFX_ITEM_SET == pBoxFmt->GetAttrSet().GetItemState(
-//											RES_SHADOW, TRUE, &pItem ) )
-//					OutSwTblShadow( rRTFWrt, *pItem );
-
-            if( SFX_ITEM_SET == rFmt.GetAttrSet().GetItemState(
-                                            RES_BACKGROUND, TRUE, &pItem )
-                || 0 != ( pItem = pCell->GetBackground() )
-                || 0 != ( pItem = pRow->GetBackground() ) )
-                OutSwTblBackground( rRTFWrt, (SvxBrushItem&)*pItem );
-
-            if( SFX_ITEM_SET == rFmt.GetAttrSet().GetItemState(
-                                            RES_VERT_ORIENT, TRUE, &pItem ) )
-                switch( ((SwFmtVertOrient*)pItem)->GetVertOrient() )
-                {
-                case text::VertOrientation::CENTER:   rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CLVERTALC; break;
-                case text::VertOrientation::BOTTOM:   rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CLVERTALB; break;
-                default:            rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CLVERTALT; break;
-                }
-
-            const SwFmtFrmSize& rLSz = rFmt.GetFrmSize();
-            nSz += rLSz.GetWidth();
-            rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CELLX;
-
-            nCalc = nSz;
-            if( bRelBoxSize )
-            {
-                nCalc *= nPageSize;
-                nCalc /= nTblSz;
-            }
-            rWrt.OutLong( nTblOffset + nCalc );
-        }
-
-        // Inhalt der Boxen ausgeben
-        rWrt.Strm() << SwRTFWriter::sNewLine << OOO_STRING_SVTOOLS_RTF_PARD << OOO_STRING_SVTOOLS_RTF_INTBL;
-        for( nBox = 0; nBox < nBoxes; ++nBox )
-        {
-            SwWriteTableCell * pCell = pBoxArr[nBox];
-            
-            if( (nBox && pBoxArr[ nBox-1 ] == pBoxArr[ nBox ]) || pCell == NULL)
-                continue;
-
-            if( pCell->GetRowSpan() == pRowSpans[ nBox ] )
-            {
-                // new Box
-                const SwStartNode* pSttNd = pCell->GetBox()->GetSttNd();
-                RTFSaveData aSaveData( rRTFWrt,
-                        pSttNd->GetIndex()+1, pSttNd->EndOfSectionIndex() );
-                rRTFWrt.bOutTable = TRUE;
-                rRTFWrt.Out_SwDoc( rRTFWrt.pCurPam );
-            }
-            rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CELL;
-        }
-
-        // das wars mit der Line
-        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_ROW << OOO_STRING_SVTOOLS_RTF_PARD << ' ';
-
-        for( nBox = 0; nBox < nColCnt; ++nBox )
-            --pRowSpans[ nBox ];
-    }
-
-    delete pTableWrt;
-    delete[] pBoxArr;
-    delete[] pRowSpans;
-
-    // Pam hinter die Tabelle verschieben
-    rRTFWrt.pCurPam->GetPoint()->nNode = *rNode.EndOfSectionNode();
-    rRTFWrt.SetAttrSet( 0 );
-
-    return rWrt;
-}
-
-Writer& OutRTF_SwSectionNode( Writer& rWrt, SwSectionNode& rNode )
-{
-    SwRTFWriter & rRTFWrt = (SwRTFWriter&)rWrt;
-    const SwSection& rSect = rNode.GetSection();
-
-    // folgt dahinter noch ein SectionNode? Dann wird erst die innere
-    // Section aktiv. Hier wird die Verschachtelung aufgebrochen, weil
-    // RTF das nicht kennt
-    BOOL bPgDscWrite = false;
-    {
-        SwNodeIndex aIdx( rNode, 1 );
-        const SwNode& rNd = aIdx.GetNode();
-        if( rNd.IsSectionNode() /*&& CONTENT_SECTION ==
-            aIdx.GetNode().GetSectionNode()->GetSection().GetType()*/ )
-            return rWrt;
-
-        // falls als erstes Position ein Content- oder Tabellen-Node steht,
-        // dann kann dieser einen PageDesc gesetzt haben und der muss vor
-        // der Bereichsbeschreibung geschrieben werden!
-        // Umgekehrt muss im OutBreaks dann
-        if( rNd.IsCntntNode() )
-        {
-            bPgDscWrite = rRTFWrt.OutBreaks( ((SwCntntNode&)rNd).GetSwAttrSet() );
-            rRTFWrt.bIgnoreNextPgBreak = TRUE;
-        }
-        else if( rNd.IsTableNode() )
-        {
-            bPgDscWrite = rRTFWrt.OutBreaks( ((SwTableNode&)rNd).GetTable().
-                                            GetFrmFmt()->GetAttrSet() );
-            rRTFWrt.bIgnoreNextPgBreak = TRUE;
-        }
-    }
-
-
-//	if( CONTENT_SECTION == rSect.GetType() )
-    {
-        // als fortlaufenden Abschnittwechsel heraus schreiben
-        if( !bPgDscWrite )
-            rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_SECT << OOO_STRING_SVTOOLS_RTF_SBKNONE;
-        //JP 19.03.99 - es muss fuer den Import auf jedenfall das Cols
-        //				Token geschrieben werden. Sonst kann nicht erkannt
-        //				werden, wann ein PageDesc & eine Section gueltig ist
-        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_COLS << '1';
-        rRTFWrt.bOutFmtAttr = TRUE;
-        const SfxPoolItem* pItem;
-        const SwFrmFmt *pFmt = rSect.GetFmt();
-        ASSERT(pFmt, "Impossible");
-        const SfxItemSet& rSet = pFmt->GetAttrSet();
-        if( SFX_ITEM_SET == rSet.GetItemState( RES_COL, false, &pItem ))
-            OutRTF_SwFmtCol( rWrt, *pItem );
-        else
-        {
-            rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_COLS << '1' << OOO_STRING_SVTOOLS_RTF_COLSX;
-            rWrt.OutULong(709);
-        }
-
-        if( SFX_ITEM_SET == rSet.GetItemState( RES_COLUMNBALANCE,
-            false, &pItem ) && ((SwFmtNoBalancedColumns*)pItem)->GetValue() )
-            OutComment( rWrt, OOO_STRING_SVTOOLS_RTF_BALANCEDCOLUMN ) << '}';
-
-        if (FRMDIR_HORI_RIGHT_TOP == rRTFWrt.TrueFrameDirection(*pFmt))
-            rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_RTLSECT;
-        else
-            rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_LTRSECT;
-
-        rWrt.Strm() << SwRTFWriter::sNewLine;
-    }
-
-    return rWrt;
-}
-
-
-/* File CHRATR.HXX: */
-
-static Writer& OutRTF_SwFont( Writer& rWrt, const SfxPoolItem& rHt )
-{
-    /* trage den Font in die Font-Liste vom Writer ein und gebe hier nur
-     *  die entsprechende Nummer aus. Der Font wird spaeter ueber diese
-     * Tabelle im RTF-Dokument referenziert.
-     */
-    SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-
-    if( !rRTFWrt.bTxtAttr ||
-        ( rRTFWrt.GetEndPosLst() &&
-        rRTFWrt.GetEndPosLst()->MatchScriptToId( rHt.Which() ) ))
-    {
-        rRTFWrt.bOutFmtAttr = true;
-        const SvxFontItem&rFont = (const SvxFontItem&)rHt;
-        bool bAssoc = rRTFWrt.IsAssociatedFlag();
-        /*
-         #109522#
-         Word is a bit of a silly bugger of a program when its comes to symbol
-         font useage. If a symbol font is actually being used, i.e.  exported
-         here with bTxtAttr true then both AF and F must be set to the same
-         value
-        */
-        if (rRTFWrt.bTxtAttr && (rFont.GetCharSet() == RTL_TEXTENCODING_SYMBOL))
-        {
-            const sal_Char* pCmd = !bAssoc ? OOO_STRING_SVTOOLS_RTF_AF : OOO_STRING_SVTOOLS_RTF_F;
-            rWrt.Strm() << pCmd;
-        }
-        const sal_Char* pCmd = bAssoc ? OOO_STRING_SVTOOLS_RTF_AF : OOO_STRING_SVTOOLS_RTF_F;
-        rWrt.Strm() << pCmd;
-        rWrt.OutULong(rRTFWrt.GetId(rFont));
-        rRTFWrt.eCurrentEncoding = rtl_getTextEncodingFromWindowsCharset(sw::ms::rtl_TextEncodingToWinCharset(rFont.GetCharSet()));
-    }
-    return rWrt;
-}
-
-static Writer& OutRTF_SwPosture( Writer& rWrt, const SfxPoolItem& rHt )
-{
-    SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-
-    if( !rRTFWrt.bTxtAttr ||
-        ( rRTFWrt.GetEndPosLst() &&
-        rRTFWrt.GetEndPosLst()->MatchScriptToId( rHt.Which() ) ))
-    {
-        if (rRTFWrt.IsAssociatedFlag() && rHt.Which() == RES_CHRATR_CJK_POSTURE)
-        {
-            /*
-            #i21422#
-            Sadly in word rtf we can't retain CJK italic when we are not
-            exporting asian text as it doesn't have a seperate italic for
-            western and asian.
-            */
-            return rWrt;
-        }
-
-        const FontItalic nPosture = ((const SvxPostureItem&)rHt).GetPosture();
-        int bTxtOut = rRTFWrt.bTxtAttr && ITALIC_NONE == nPosture;
-        if( ITALIC_NORMAL == nPosture || bTxtOut )
-        {
-            rRTFWrt.bOutFmtAttr = TRUE;
-            const sal_Char* pCmd = rRTFWrt.IsAssociatedFlag() ? OOO_STRING_SVTOOLS_RTF_AI : OOO_STRING_SVTOOLS_RTF_I;
-            rWrt.Strm() << pCmd;
-        }
-        if( bTxtOut )
-            rWrt.Strm() << '0';		// wieder abschalten
-    }
-    return rWrt;
-}
-
-
-static Writer& OutRTF_SwWeight( Writer& rWrt, const SfxPoolItem& rHt )
-{
-    SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-    if( !rRTFWrt.bTxtAttr ||
-        ( rRTFWrt.GetEndPosLst() &&
-        rRTFWrt.GetEndPosLst()->MatchScriptToId( rHt.Which() ) ))
-    {
-        if (rRTFWrt.IsAssociatedFlag() && rHt.Which() == RES_CHRATR_CJK_WEIGHT)
-        {
-            /*
-            #i21422#
-            Sadly in word rtf we can't retain CJK bold when we are not
-            exporting asian text as it doesn't have a seperate bold for western
-            and asian.
-            */
-            return rWrt;
-        }
-
-        const FontWeight nBold = ((const SvxWeightItem&)rHt).GetWeight();
-        int bTxtOut = rRTFWrt.bTxtAttr && WEIGHT_NORMAL == nBold;
-        if( WEIGHT_BOLD == nBold || bTxtOut )
-        {
-            rRTFWrt.bOutFmtAttr = TRUE;
-            const sal_Char* pCmd = rRTFWrt.IsAssociatedFlag() ? OOO_STRING_SVTOOLS_RTF_AB : OOO_STRING_SVTOOLS_RTF_B;
-            rWrt.Strm() << pCmd;
-        }
-        if( bTxtOut )
-            rWrt.Strm() <<  '0';
-    }
-    return rWrt;
-}
-
-static Writer& OutRTF_SwEmphasisMark( Writer& rWrt, const SfxPoolItem& rHt )
-{
-    SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-    const sal_Char* pStr;
-    switch( ((const SvxEmphasisMarkItem&)rHt).GetEmphasisMark())
-    {
-    case EMPHASISMARK_NONE:			pStr = OOO_STRING_SVTOOLS_RTF_ACCNONE;	break;
-    case EMPHASISMARK_SIDE_DOTS:	pStr = OOO_STRING_SVTOOLS_RTF_ACCCOMMA;	break;
-    default:						pStr = OOO_STRING_SVTOOLS_RTF_ACCDOT;		break;
-    }
-
-    rRTFWrt.bOutFmtAttr = TRUE;
-    rWrt.Strm() << pStr;
-    return rWrt;
-}
-
-static Writer& OutRTF_SwTwoInOne( Writer& rWrt, const SfxPoolItem& rHt )
-{
-    if( ((SvxTwoLinesItem&)rHt).GetValue() )
-    {
-        SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-
-        sal_Unicode cStart = ((SvxTwoLinesItem&)rHt).GetStartBracket();
-        sal_Unicode cEnd = ((SvxTwoLinesItem&)rHt).GetStartBracket();
-
-        USHORT nType;
-        if( !cStart && !cEnd )
-            nType = 0;
-        else if( '{' == cStart || '}' == cEnd )
-            nType = 4;
-        else if( '<' == cStart || '>' == cEnd )
-            nType = 3;
-        else if( '[' == cStart || ']' == cEnd )
-            nType = 2;
-        else	                        // all other kind of brackets
-            nType = 1;
-
-        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_TWOINONE;
-        rWrt.OutULong( nType );
-        rRTFWrt.bOutFmtAttr = TRUE;
-    }
-    return rWrt;
-}
-
-static Writer& OutRTF_SwCharRotate( Writer& rWrt, const SfxPoolItem& rHt )
-{
-    SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-    rRTFWrt.bOutFmtAttr = TRUE;
-    rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_HORZVERT;
-    rWrt.OutLong( ((SvxCharRotateItem&)rHt).IsFitToLine() ? 1 : 0 );
-    return rWrt;
-}
-static Writer& OutRTF_SwCharScaleW( Writer& rWrt, const SfxPoolItem& rHt )
-{
-    SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-    rRTFWrt.bOutFmtAttr = TRUE;
-    rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CHARSCALEX;
-    rWrt.OutLong( ((SvxCharScaleWidthItem&)rHt).GetValue() );
-    return rWrt;
-}
-
-static Writer& OutRTF_SwCharRelief(Writer& rWrt, const SfxPoolItem& rHt)
-{
-    SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-    const SvxCharReliefItem& rAttr = (const SvxCharReliefItem&)rHt;
-    const sal_Char* pStr;
-    switch (rAttr.GetValue())
-    {
-        case RELIEF_EMBOSSED:
-            pStr = OOO_STRING_SVTOOLS_RTF_EMBO;
-            break;
-        case RELIEF_ENGRAVED:
-            pStr = OOO_STRING_SVTOOLS_RTF_IMPR;
-            break;
-        default:
-            pStr = 0;
-            break;
-    }
-
-    if (pStr)
-    {
-        rRTFWrt.bOutFmtAttr = TRUE;
-        rWrt.Strm() << pStr;
-    }
-    return rWrt;
-}
-
-
-static Writer& OutRTF_SwChrBckgrnd( Writer& rWrt, const SfxPoolItem& rHt )
-{
-    SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-    const SvxBrushItem& rBack = (const SvxBrushItem&)rHt;
-    if( !rBack.GetColor().GetTransparency() )
-    {
-        ByteString sOut( OOO_STRING_SVTOOLS_RTF_CHCBPAT );
-        sOut += ByteString::CreateFromInt32(
-                            rRTFWrt.GetId( rBack.GetColor() ));
-
-        rRTFWrt.bOutFmtAttr = TRUE;
-        rWrt.Strm() << sOut.GetBuffer();
-    }
-    return rWrt;
-}
-
-static Writer& OutRTF_SwShadowed( Writer& rWrt, const SfxPoolItem& rHt )
-{
-    SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-    const BOOL bShadow = ((const SvxShadowedItem&)rHt).GetValue();
-    int bTxtOut = rRTFWrt.bTxtAttr && !bShadow;
-    if( bShadow || bTxtOut )
-    {
-        rRTFWrt.bOutFmtAttr = TRUE;
-        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_SHAD;
-    }
-    if( bTxtOut )
-        rWrt.Strm() << '0';
-    return rWrt;
-}
-
-
-
-static Writer& OutRTF_SwContour( Writer& rWrt, const SfxPoolItem& rHt )
-{
-    SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-    const BOOL bContour = ((const SvxContourItem&)rHt).GetValue();
-    int bTxtOut = rRTFWrt.bTxtAttr && !bContour;
-    if( bContour || bTxtOut )
-    {
-        rRTFWrt.bOutFmtAttr = TRUE;
-        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_OUTL;
-    }
-    if( bTxtOut )
-        rWrt.Strm() << '0';
-    return rWrt;
-}
-
-static Writer& OutRTF_SwCrossedOut( Writer& rWrt, const SfxPoolItem& rHt )
-{
-    SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-    const FontStrikeout nStrike = ((const SvxCrossedOutItem&)rHt).GetStrikeout();
-    int bTxtOut = rRTFWrt.bTxtAttr && STRIKEOUT_NONE == nStrike;
-
-    if( (STRIKEOUT_NONE != nStrike && STRIKEOUT_DONTKNOW != nStrike) || bTxtOut )
-    {
-        rRTFWrt.bOutFmtAttr = TRUE;
-        if( STRIKEOUT_DOUBLE == nStrike )
-        {
-            rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_STRIKED;
-            if( !bTxtOut )
-                rWrt.Strm() << '1';
-        }
-        else
-            rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_STRIKE;
-    }
-    if( bTxtOut )
-        rWrt.Strm() << '0';
-    return rWrt;
-}
-
-
-
-static Writer& OutRTF_SwCaseMap( Writer& rWrt, const SfxPoolItem& rHt )
-{
-    SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-    switch( ((const SvxCaseMapItem&)rHt).GetValue() )
-    {
-    case SVX_CASEMAP_KAPITAELCHEN:
-        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_SCAPS;
-        break;
-
-    case SVX_CASEMAP_VERSALIEN:
-        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CAPS;
-        break;
-
-    case SVX_CASEMAP_NOT_MAPPED:
-        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CAPS << '0' << OOO_STRING_SVTOOLS_RTF_SCAPS << '0';		// beide aus !!
-        break;
-
-    default:
-        return rWrt;
-    }
-
-    rRTFWrt.bOutFmtAttr = TRUE;
-    return rWrt;
-}
-
-
-static Writer& OutRTF_SwUnderline( Writer& rWrt, const SfxPoolItem& rHt )
-{
-    const char* pStr = 0;
-    switch( ((const SvxUnderlineItem&)rHt).GetLineStyle() )
-    {
-        case UNDERLINE_SINGLE:
-            pStr = OOO_STRING_SVTOOLS_RTF_UL;
-            break;
-        case UNDERLINE_DOUBLE:
-            pStr = OOO_STRING_SVTOOLS_RTF_ULDB;
-            break;
-        case UNDERLINE_NONE:
-            pStr = OOO_STRING_SVTOOLS_RTF_ULNONE;
-            break;
-        case UNDERLINE_DOTTED:
-            pStr = OOO_STRING_SVTOOLS_RTF_ULD;
-            break;
-        case UNDERLINE_DASH:
-            pStr = OOO_STRING_SVTOOLS_RTF_ULDASH;
-            break;
-        case UNDERLINE_DASHDOT:
-            pStr = OOO_STRING_SVTOOLS_RTF_ULDASHD;
-            break;
-        case UNDERLINE_DASHDOTDOT:
-            pStr = OOO_STRING_SVTOOLS_RTF_ULDASHDD;
-            break;
-        case UNDERLINE_BOLD:
-            pStr = OOO_STRING_SVTOOLS_RTF_ULTH;
-            break;
-        case UNDERLINE_WAVE:
-            pStr = OOO_STRING_SVTOOLS_RTF_ULWAVE;
-            break;
-        case UNDERLINE_BOLDDOTTED:
-            pStr = OOO_STRING_SVTOOLS_RTF_ULTHD;
-            break;
-        case UNDERLINE_BOLDDASH:
-            pStr = OOO_STRING_SVTOOLS_RTF_ULTHDASH;
-            break;
-        case UNDERLINE_LONGDASH:
-            pStr = OOO_STRING_SVTOOLS_RTF_ULLDASH;
-            break;
-        case UNDERLINE_BOLDLONGDASH:
-            pStr = OOO_STRING_SVTOOLS_RTF_ULTHLDASH;
-            break;
-        case UNDERLINE_BOLDDASHDOT:
-            pStr = OOO_STRING_SVTOOLS_RTF_ULTHDASHD;
-            break;
-        case UNDERLINE_BOLDDASHDOTDOT:
-            pStr = OOO_STRING_SVTOOLS_RTF_ULTHDASHDD;
-            break;
-        case UNDERLINE_BOLDWAVE:
-            pStr = OOO_STRING_SVTOOLS_RTF_ULHWAVE;
-            break;
-        case UNDERLINE_DOUBLEWAVE:
-            pStr = OOO_STRING_SVTOOLS_RTF_ULULDBWAVE;
-            break;
-        default:
-            break;
-    }
-
-    if( pStr )
-    {
-        SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-
-        if( UNDERLINE_SINGLE == ((const SvxUnderlineItem&)rHt).GetLineStyle()
-            && ((SvxWordLineModeItem&)rRTFWrt.GetItem(
-                RES_CHRATR_WORDLINEMODE )).GetValue() )
-            pStr = OOO_STRING_SVTOOLS_RTF_ULW;
-
-        rRTFWrt.Strm() << pStr;
-        rRTFWrt.bOutFmtAttr = TRUE;
-
-        rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_ULC;
-        rWrt.OutULong( rRTFWrt.GetId(((const SvxUnderlineItem&)rHt).GetColor()) );
-
-    }
-
-    return rWrt;
-}
-
-
-
-static Writer& OutRTF_SwOverline( Writer& rWrt, const SfxPoolItem& rHt )
-{
-    const char* pStr = 0;
-    switch( ((const SvxOverlineItem&)rHt).GetLineStyle() )
-    {
-        case UNDERLINE_SINGLE:
-            pStr = OOO_STRING_SVTOOLS_RTF_OL;
-            break;
-        case UNDERLINE_DOUBLE:
-            pStr = OOO_STRING_SVTOOLS_RTF_OLDB;
-            break;
-        case UNDERLINE_NONE:
-            pStr = OOO_STRING_SVTOOLS_RTF_OLNONE;
-            break;
-        case UNDERLINE_DOTTED:
-            pStr = OOO_STRING_SVTOOLS_RTF_OLD;
-            break;
-        case UNDERLINE_DASH:
-            pStr = OOO_STRING_SVTOOLS_RTF_OLDASH;
-            break;
-        case UNDERLINE_DASHDOT:
-            pStr = OOO_STRING_SVTOOLS_RTF_OLDASHD;
-            break;
-        case UNDERLINE_DASHDOTDOT:
-            pStr = OOO_STRING_SVTOOLS_RTF_OLDASHDD;
-            break;
-        case UNDERLINE_BOLD:
-            pStr = OOO_STRING_SVTOOLS_RTF_OLTH;
-            break;
-        case UNDERLINE_WAVE:
-            pStr = OOO_STRING_SVTOOLS_RTF_OLWAVE;
-            break;
-        case UNDERLINE_BOLDDOTTED:
-            pStr = OOO_STRING_SVTOOLS_RTF_OLTHD;
-            break;
-        case UNDERLINE_BOLDDASH:
-            pStr = OOO_STRING_SVTOOLS_RTF_OLTHDASH;
-            break;
-        case UNDERLINE_LONGDASH:
-            pStr = OOO_STRING_SVTOOLS_RTF_OLLDASH;
-            break;
-        case UNDERLINE_BOLDLONGDASH:
-            pStr = OOO_STRING_SVTOOLS_RTF_OLTHLDASH;
-            break;
-        case UNDERLINE_BOLDDASHDOT:
-            pStr = OOO_STRING_SVTOOLS_RTF_OLTHDASHD;
-            break;
-        case UNDERLINE_BOLDDASHDOTDOT:
-            pStr = OOO_STRING_SVTOOLS_RTF_OLTHDASHDD;
-            break;
-        case UNDERLINE_BOLDWAVE:
-            pStr = OOO_STRING_SVTOOLS_RTF_OLHWAVE;
-            break;
-        case UNDERLINE_DOUBLEWAVE:
-            pStr = OOO_STRING_SVTOOLS_RTF_OLOLDBWAVE;
-            break;
-        default:
-            break;
-    }
-
-    if( pStr )
-    {
-        SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-        if ( rRTFWrt.bNonStandard )
-        {
-            if( UNDERLINE_SINGLE == ((const SvxOverlineItem&)rHt).GetLineStyle()
-                && ((SvxWordLineModeItem&)rRTFWrt.GetItem(
-                    RES_CHRATR_WORDLINEMODE )).GetValue() )
-                pStr = OOO_STRING_SVTOOLS_RTF_OLW;
-
-            rRTFWrt.Strm() << pStr;
-            rRTFWrt.bOutFmtAttr = TRUE;
-
-            rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_OLC;
-            rWrt.OutULong( rRTFWrt.GetId(((const SvxOverlineItem&)rHt).GetColor()) );
-        }
-
-    }
-
-    return rWrt;
-}
-
-
-
-static Writer& OutRTF_SwLanguage( Writer& rWrt, const SfxPoolItem& rHt )
-{
-    SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-    if( !rRTFWrt.bTxtAttr ||
-        ( rRTFWrt.GetEndPosLst() &&
-        rRTFWrt.GetEndPosLst()->MatchScriptToId( rHt.Which() ) ))
-    {
-
-        rRTFWrt.bOutFmtAttr = TRUE;
-        const sal_Char* p = RES_CHRATR_CJK_LANGUAGE == rHt.Which()
-                                    ? OOO_STRING_SVTOOLS_RTF_LANGFE : OOO_STRING_SVTOOLS_RTF_LANG;
-        rWrt.Strm() << p;
-        rWrt.OutULong( ((const SvxLanguageItem&)rHt).GetLanguage() );
-    }
-    return rWrt;
-}
-
-
-
-static Writer& OutRTF_SwEscapement( Writer& rWrt, const SfxPoolItem& rHt )
-{
-    SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-    const SvxEscapementItem& rEsc = (const SvxEscapementItem&)rHt;
-    const char * pUpDn;
-
-    SwTwips nH = ((SvxFontHeightItem&)rRTFWrt.GetItem(
-                                RES_CHRATR_FONTSIZE )).GetHeight();
-
-    if( 0 < rEsc.GetEsc() )
-        pUpDn = OOO_STRING_SVTOOLS_RTF_UP;
-    else if( 0 > rEsc.GetEsc() )
-    {
-        pUpDn = OOO_STRING_SVTOOLS_RTF_DN;
-        nH = -nH;				// den negativen Wert herrausrechnen
-    }
-    else
-        return rWrt;
-
-    // prozentuale Veraenderung speichern !
-    short nEsc = rEsc.GetEsc();
-    short nProp = rEsc.GetProp() * 100;
-    if( DFLT_ESC_AUTO_SUPER == nEsc )
-    {
-        nEsc = 100 - rEsc.GetProp();
-        ++nProp;
-    }
-    else if( DFLT_ESC_AUTO_SUB == nEsc )
-    {
-        nEsc = - 100 + rEsc.GetProp();
-        ++nProp;
-    }
-
-    OutComment( rWrt, OOO_STRING_SVTOOLS_RTF_UPDNPROP, TRUE );
-    rWrt.OutULong( nProp ) << '}' << pUpDn;
-
-    /*
-     * berechne aus der akt. FontSize und dem ProzentWert die Verschiebung,
-     * wobei im RTF File 1/2 Points stehen muessen, waehrend intern
-     * mit Twips gerechnet wird.
-     * Formel :			(FontSize * 1/20 ) pts         x * 2
-     *					-----------------------  = ------------
-     *					  100%       				Escapement
-     */
-
-    rWrt.OutULong( ( (long( nEsc ) * nH) + 500L ) / 1000L );
-                                                // 500L zum Aufrunden !!
-    return rWrt;
-}
-
-
-
-static Writer& OutRTF_SwSize( Writer& rWrt, const SfxPoolItem& rHt )
-{
-    SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-    if( !rRTFWrt.bTxtAttr ||
-        ( rRTFWrt.GetEndPosLst() &&
-        rRTFWrt.GetEndPosLst()->MatchScriptToId( rHt.Which() ) ))
-    {
-        if (
-             rRTFWrt.IsAssociatedFlag() &&
-             rHt.Which() == RES_CHRATR_CJK_FONTSIZE
-           )
-        {
-            /*
-            #i21422#
-            Sadly in word rtf we can't retain CJK fontsize when we are not
-            exporting asian text as it doesn't have a seperate fontsize for
-            western and asian.
-            */
-            return rWrt;
-        }
-
-        rRTFWrt.bOutFmtAttr = TRUE;
-
-        const sal_Char* pCmd = rRTFWrt.IsAssociatedFlag() ? OOO_STRING_SVTOOLS_RTF_AFS : OOO_STRING_SVTOOLS_RTF_FS;
-        rWrt.Strm() << pCmd;
-        rWrt.OutULong( ((const SvxFontHeightItem&)rHt).GetHeight() / 10 );
-    }
-    return rWrt;
-}
-
-
-
-static Writer& OutRTF_SwColor( Writer& rWrt, const SfxPoolItem& rHt )
-{
-    SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-    /* trage die Color in die Color-Liste vom Writer ein und gebe hier nur
-     * die entsprechende Nummer aus. Die Color wird spaeter ueber diese
-     * Tabelle im RTF-Dokument referenziert.
-     */
-    rRTFWrt.bOutFmtAttr = TRUE;
-    rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_CF;
-    rWrt.OutULong( rRTFWrt.GetId( ((const SvxColorItem&)rHt).GetValue() ));
-    return rWrt;
-}
-
-static Writer& OutRTF_SvxCharHiddenItem(Writer& rWrt, const SfxPoolItem& rHt)
-{
-    SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-    rRTFWrt.bOutFmtAttr = true;
-    rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_V;
-    if (!((const SvxCharHiddenItem&)rHt).GetValue())
-        rWrt.OutULong(0);
-    return rWrt;
-}
-
-extern void sw3io_ConvertToOldField( const SwField* pFld, USHORT& rWhich,
-                              ULONG& rFmt, ULONG nFFVersion );
-
-static Writer& OutRTF_SwField( Writer& rWrt, const SfxPoolItem& rHt )
-{
-    SwFmtFld & rFld = (SwFmtFld&)rHt;
-    SwRTFWriter& rRTFWrt = (SwRTFWriter&)rWrt;
-
-    const SwField* pFld = rFld.GetFld();
-
-    ByteString aFldStt( '{' );
-    ((((aFldStt += OOO_STRING_SVTOOLS_RTF_FIELD) += '{' ) += OOO_STRING_SVTOOLS_RTF_IGNORE) += OOO_STRING_SVTOOLS_RTF_FLDINST) += ' ';
-    switch( pFld->GetTyp()->Which() )
-    {
-    case RES_COMBINED_CHARS:
-        {
-            /*
-            We need a font size to fill in the defaults, if these are overridden
-            (as they generally are) by character properties then those properties
-            win.
-
-            The fontsize that is used in MS for determing the defaults is always
-            the CJK fontsize even if the text is not in that language, in OOo the
-            largest fontsize used in the field is the one we should take, but
-            whatever we do, word will actually render using the fontsize set for
-            CJK text. Nevertheless we attempt to guess whether the script is in
-            asian or western text based up on the first character and use the
-            font size of that script as our default.
-            */
-            const String& rFldPar1 = pFld->GetPar1();
-            USHORT nScript;
-            if( pBreakIt->GetBreakIter().is() )
-                nScript = pBreakIt->GetBreakIter()->getScriptType( rFldPar1, 0);
-            else
-                nScript = i18n::ScriptType::ASIAN;
-
-            long nHeight = ((SvxFontHeightItem&)rRTFWrt.GetItem(
-                GetWhichOfScript(RES_CHRATR_FONTSIZE, nScript ))).GetHeight();
-            nHeight = (nHeight + 10) / 20; //Font Size in points;
-
-            /*
-            Divide the combined char string into its up and down part. Get the
-            font size and fill in the defaults as up == half the font size and
-            down == a fifth the font size
-            */
-            xub_StrLen nAbove = (rFldPar1.Len()+1)/2;
-            rWrt.Strm() << aFldStt.GetBuffer() << "EQ \\\\o (\\\\s\\\\up ";
-            rWrt.OutLong( nHeight/2 ) << '(';
-            RTFOutFuncs::Out_String( rWrt.Strm(), rFldPar1.Copy(0,nAbove),
-                                    rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt );
-            rWrt.Strm() << "), \\\\s\\\\do ";
-            rWrt.OutLong( nHeight/5 ) << '(';
-            RTFOutFuncs::Out_String( rWrt.Strm(), rFldPar1.Copy( nAbove ),
-                                    rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt )
-                    << "))";
-        }
-        break;
-
-    case RES_DBFLD:
-            aFldStt += "MERGEFIELD ";
-            // kein break !!
-    case RES_USERFLD:
-            rWrt.Strm() << aFldStt.GetBuffer();
-            RTFOutFuncs::Out_String( rWrt.Strm(), pFld->GetTyp()->GetName(),
-                                    rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt );
-            break;
-    case RES_GETREFFLD:
-        {
-            BYTE nFldTyp = 0;
-            rWrt.Strm() << aFldStt.GetBuffer() << " REF ";
-            const SwGetRefField& rRFld = *(SwGetRefField*)pFld;
-            switch( pFld->GetSubType() )
-            {
-                case REF_SETREFATTR:
-                case REF_BOOKMARK:
-                    RTFOutFuncs::Out_String( rWrt.Strm(), rRFld.GetSetRefName(),
-                                    rRTFWrt.eDefaultEncoding, rRTFWrt.bWriteHelpFmt );
-                    nFldTyp = 3;
-                    break;
-            }
-
-            if( nFldTyp )
-            {
-                switch( pFld->GetFormat() )
-                {
-                    case REF_PAGE_PGDESC:
-                    case REF_PAGE:
-                        rWrt.Strm() << "SEITEN";
-                        nFldTyp = 37;
-                        break;
-                    case REF_UPDOWN:
-                        rWrt.Strm() << " \\p";
-                        nFldTyp = 3;
-                        break;
-                    case REF_CHAPTER:
-                        rWrt.Strm() << " \\n";
-                        break;
-                    case REF_ONLYNUMBER:
-                    case REF_ONLYCAPTION:
-                    case REF_ONLYSEQNO:
-                        break;

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list