sc/source/filter/inc/rtfexp.hxx                     |    8 +
 sc/source/filter/rtf/rtfexp.cxx                     |  135 +++++++++++++++-----
 sw/qa/extras/uiwriter/data/tdf62032_apply_style.odt |binary
 sw/qa/extras/uiwriter/uiwriter4.cxx                 |   22 +++
 sw/source/core/doc/docfmt.cxx                       |    5 
 5 files changed, 140 insertions(+), 30 deletions(-)

New commits:
commit 998e5b53478a20ddbda66e92d8fd6ad73412ff57
Author:     luigiiucci <luigi.iu...@collabora.com>
AuthorDate: Thu Jun 15 23:31:26 2023 +0200
Commit:     Aron Budea <aron.bu...@collabora.com>
CommitDate: Fri Aug 4 00:49:01 2023 +0200

    tdf#62032 use style list level when changing style
    
    If a style S1 has a list level L1, and we
    change the style to S1 in a text node that
    has list level L2, the new text node
    list level must be L1
    
    Change-Id: Ic25b222202cb2da3153fc5c3723998c9f7f01247
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153161
    Reviewed-by: Ashod Nakashian <a...@collabora.com>
    Tested-by: Jenkins
    (cherry picked from commit c1cfe85f8bba10d367ef9ef1d6d569f53969dd34)
    (cherry picked from commit d466d3b4422e6fc6405cf17bbeee48ae52fa1d3e)

diff --git a/sw/qa/extras/uiwriter/data/tdf62032_apply_style.odt 
b/sw/qa/extras/uiwriter/data/tdf62032_apply_style.odt
new file mode 100644
index 000000000000..86cda167ee8a
Binary files /dev/null and 
b/sw/qa/extras/uiwriter/data/tdf62032_apply_style.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter4.cxx 
b/sw/qa/extras/uiwriter/uiwriter4.cxx
index fc7bd27e3124..803c4821e4a5 100644
--- a/sw/qa/extras/uiwriter/uiwriter4.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter4.cxx
@@ -292,6 +292,7 @@ public:
     void testInsertPdf();
     void testTdf143760WrapContourToOff();
     void testHatchFill();
+    void testTdf62032ApplyStyle();
 
     CPPUNIT_TEST_SUITE(SwUiWriterTest4);
     CPPUNIT_TEST(testTdf96515);
@@ -417,6 +418,7 @@ public:
     CPPUNIT_TEST(testInsertPdf);
     CPPUNIT_TEST(testTdf143760WrapContourToOff);
     CPPUNIT_TEST(testHatchFill);
+    CPPUNIT_TEST(testTdf62032ApplyStyle);
     CPPUNIT_TEST_SUITE_END();
 };
 
@@ -4140,6 +4142,26 @@ void SwUiWriterTest4::testHatchFill()
     CPPUNIT_ASSERT_EQUAL(sal_Int32(30), getProperty<sal_Int32>(getShape(1), 
"FillTransparence"));
 }
 
+void SwUiWriterTest4::testTdf62032ApplyStyle()
+{
+    SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf62032_apply_style.odt");
+    SwWrtShell* pWrtSh = pDoc->GetDocShell()->GetWrtShell();
+
+    pWrtSh->Down(/*bSelect=*/false);
+
+    uno::Sequence<beans::PropertyValue> aPropertyValues = 
comphelper::InitPropertySequence({
+        { "Style", uno::Any(OUString("A 2")) },
+        { "FamilyName", uno::Any(OUString("ParagraphStyles")) },
+    });
+    dispatchCommand(mxComponent, ".uno:StyleApply", aPropertyValues);
+
+    // Without the fix in place, it fails with:
+    // - Expected: 1.1
+    // - Actual  : 2
+    CPPUNIT_ASSERT_EQUAL(OUString("1.1"),
+                         getProperty<OUString>(getParagraph(2), 
"ListLabelString").trim());
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest4);
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 42dfd707c556..1dd846cb80e4 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1067,6 +1067,11 @@ static bool lcl_SetTextFormatColl( SwNode* pNode, void* 
pArgs )
                 pCNd->ResetAttr( RES_PARATR_LIST_ISCOUNTED );
                 pCNd->ResetAttr( RES_PARATR_LIST_ID );
             }
+            else
+            {
+                // forcing reset of list level from parapgaph
+                pCNd->SetAttr(pFormat->GetFormatAttr(RES_PARATR_LIST_LEVEL));
+            }
         }
     }
 
commit c3b32a95236edeadd9450c7b989a259e82476b8f
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Tue Jul 25 15:36:52 2023 -0400
Commit:     Aron Budea <aron.bu...@collabora.com>
CommitDate: Thu Aug 3 22:37:28 2023 +0200

    sc: filter: rtf: add method "WriteFontTable"
    
    Write the font table while visiting column/row and
    get the unique index to reference it.
    
    "The \fonttbl control word introduces the font table group.
    Unique \fN control words define each font available in the document,
    and are used to reference that font throughout the document."
    
    Signed-off-by: Henry Castro <hcas...@collabora.com>
    Change-Id: I20c5d1128972f5ec9b9b2e246f466bdb173ef8a4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154906
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155261
    (cherry picked from commit 2d5732b254134da7942687ea3b1bb04859cc9c34)

diff --git a/sc/source/filter/inc/rtfexp.hxx b/sc/source/filter/inc/rtfexp.hxx
index 1c9f1bd7a4af..9d0b204540c7 100644
--- a/sc/source/filter/inc/rtfexp.hxx
+++ b/sc/source/filter/inc/rtfexp.hxx
@@ -28,12 +28,14 @@ class ScRTFExport : public ScExportBase
 {
     std::unique_ptr<sal_uLong[]>  m_pCellX;     // cumulative range in a table
     std::map<OUString, sal_Int32> m_pFontTable;
+    SvMemoryStream m_aFontStrm;
     SvMemoryStream m_aDocStrm;
 
     int                 AddFont( const SvxFontItem& rFontItem );
     void                WriteTab( SCTAB nTab );
     void                WriteRow( SCTAB nTab, SCROW nRow );
     void                WriteCell( SCTAB nTab,  SCROW nRow, SCCOL nCol );
+    void                WriteFontTable(const SvxFontItem& rFontItem, int 
nIndex);
 
 public:
 
diff --git a/sc/source/filter/rtf/rtfexp.cxx b/sc/source/filter/rtf/rtfexp.cxx
index 070308171d17..e53a488d06b5 100644
--- a/sc/source/filter/rtf/rtfexp.cxx
+++ b/sc/source/filter/rtf/rtfexp.cxx
@@ -19,6 +19,9 @@
 
 #include <scitems.hxx>
 
+#include <rtl/tencinfo.h>
+#include <osl/thread.h>
+
 #include <editeng/wghtitem.hxx>
 #include <editeng/postitem.hxx>
 #include <editeng/udlnitem.hxx>
@@ -60,6 +63,8 @@ void ScRTFExport::Write()
     rStrm.WriteChar( '{' ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_RTF );
     rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_ANSI ).WriteCharPtr( 
SAL_NEWLINE_STRING );
 
+    m_aFontStrm.WriteChar( '{' ).WriteOString( OOO_STRING_SVTOOLS_RTF_FONTTBL 
);
+
     // Data
     for ( SCTAB nTab = aRange.aStart.Tab(); nTab <= aRange.aEnd.Tab(); nTab++ )
     {
@@ -68,6 +73,9 @@ void ScRTFExport::Write()
         WriteTab( nTab );
     }
 
+    m_aFontStrm.WriteChar( '}' );
+    m_aFontStrm.Seek(0);
+    rStrm.WriteStream(m_aFontStrm);
     m_aDocStrm.Seek(0);
     rStrm.WriteStream(m_aDocStrm);
     rStrm.WriteChar( '}' ).WriteOString( SAL_NEWLINE_STRING );
@@ -148,6 +156,51 @@ void ScRTFExport::WriteRow( SCTAB nTab, SCROW nRow )
     m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_ROW ).WriteOString( 
SAL_NEWLINE_STRING );
 }
 
+void ScRTFExport::WriteFontTable(const SvxFontItem& rFontItem, int nIndex)
+{
+    m_aFontStrm.WriteChar( '{' );
+    m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_F );
+    m_aFontStrm.WriteOString( OString::number(nIndex) );
+
+    FontFamily eFamily = rFontItem.GetFamily();
+    if (eFamily == FAMILY_DONTKNOW)
+        m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_FNIL );
+    else if (eFamily == FAMILY_DECORATIVE)
+        m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_FDECOR );
+    else if (eFamily == FAMILY_MODERN)
+        m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_FMODERN );
+    else if (eFamily == FAMILY_ROMAN)
+        m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_FROMAN );
+    else if (eFamily == FAMILY_SCRIPT)
+        m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_FSCRIPT );
+    else if (eFamily == FAMILY_SWISS)
+        m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_FSWISS );
+
+    m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_FPRQ );
+
+    sal_uInt16 nVal = 0;
+    FontPitch ePitch = rFontItem.GetPitch();
+    if ( ePitch == PITCH_FIXED )
+        nVal = 1;
+    else if ( ePitch == PITCH_VARIABLE )
+        nVal = 2;
+    m_aFontStrm.WriteOString( OString::number(nVal) );
+
+    rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252;
+    rtl_TextEncoding eChrSet = rFontItem.GetCharSet();
+    if (IsStarSymbol(rFontItem.GetFamilyName()))
+        eChrSet = RTL_TEXTENCODING_UTF8;
+    else if( RTL_TEXTENCODING_DONTKNOW == eChrSet )
+        eChrSet = osl_getThreadTextEncoding();
+
+    m_aFontStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_FCHARSET );
+    m_aFontStrm.WriteOString( 
OString::number(rtl_getBestWindowsCharsetFromTextEncoding( eChrSet )) );
+
+    m_aFontStrm.WriteChar( ' ' );
+    RTFOutFuncs::Out_String( m_aFontStrm, rFontItem.GetFamilyName(), eDestEnc 
);
+    m_aFontStrm.WriteOString( ";}" );
+}
+
 int ScRTFExport::AddFont(const SvxFontItem& rFontItem)
 {
     auto nRet = m_pFontTable.size();
@@ -155,6 +208,7 @@ int ScRTFExport::AddFont(const SvxFontItem& rFontItem)
     if (itFont == m_pFontTable.end())
     {
         m_pFontTable[rFontItem.GetFamilyName()] = nRet;
+        WriteFontTable(rFontItem, nRet);
     }
     else
     {
@@ -204,11 +258,15 @@ void ScRTFExport::WriteCell( SCTAB nTab, SCROW nRow, 
SCCOL nCol )
 
     bool bResetAttr(false);
 
+    const SvxFontItem&          rFontItem       = pAttr->GetItem( ATTR_FONT );
     const SvxHorJustifyItem&    rHorJustifyItem = pAttr->GetItem( 
ATTR_HOR_JUSTIFY );
     const SvxWeightItem&        rWeightItem     = pAttr->GetItem( 
ATTR_FONT_WEIGHT );
     const SvxPostureItem&       rPostureItem    = pAttr->GetItem( 
ATTR_FONT_POSTURE );
     const SvxUnderlineItem&     rUnderlineItem  = pAttr->GetItem( 
ATTR_FONT_UNDERLINE );
 
+    m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_F )
+        .WriteOString( OString::number(AddFont(rFontItem)) );
+
     const char* pChar;
 
     switch( rHorJustifyItem.GetValue() )
commit cd96b37a41c2b59b579b07969c1ff12936b8df34
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Tue Jul 25 15:31:22 2023 -0400
Commit:     Aron Budea <aron.bu...@collabora.com>
CommitDate: Thu Aug 3 22:34:58 2023 +0200

    sc: filter: rtf: add method "AddFont"
    
    Create a map font name associated with unique index.
    
    "The \fonttbl control word introduces the font table group.
    Unique \fN control words define each font available in the document,
    and are used to reference that font throughout the document"..
    
    Signed-off-by: Henry Castro <hcas...@collabora.com>
    Change-Id: I028226cb539865f1980f953385c887a3bd4b8e3f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154905
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155260
    (cherry picked from commit 81d59f2c125dff57fdfa17b119d6007f25ef500a)

diff --git a/sc/source/filter/inc/rtfexp.hxx b/sc/source/filter/inc/rtfexp.hxx
index 14ee8ec023f7..1c9f1bd7a4af 100644
--- a/sc/source/filter/inc/rtfexp.hxx
+++ b/sc/source/filter/inc/rtfexp.hxx
@@ -19,6 +19,7 @@
 
 #pragma once
 
+#include <map>
 #include <memory>
 #include "expbase.hxx"
 #include <tools/solar.h>
@@ -26,8 +27,10 @@
 class ScRTFExport : public ScExportBase
 {
     std::unique_ptr<sal_uLong[]>  m_pCellX;     // cumulative range in a table
+    std::map<OUString, sal_Int32> m_pFontTable;
     SvMemoryStream m_aDocStrm;
 
+    int                 AddFont( const SvxFontItem& rFontItem );
     void                WriteTab( SCTAB nTab );
     void                WriteRow( SCTAB nTab, SCROW nRow );
     void                WriteCell( SCTAB nTab,  SCROW nRow, SCCOL nCol );
diff --git a/sc/source/filter/rtf/rtfexp.cxx b/sc/source/filter/rtf/rtfexp.cxx
index 152b8ff5d57f..070308171d17 100644
--- a/sc/source/filter/rtf/rtfexp.cxx
+++ b/sc/source/filter/rtf/rtfexp.cxx
@@ -22,6 +22,7 @@
 #include <editeng/wghtitem.hxx>
 #include <editeng/postitem.hxx>
 #include <editeng/udlnitem.hxx>
+#include <editeng/fontitem.hxx>
 #include <editeng/justifyitem.hxx>
 #include <svtools/rtfout.hxx>
 #include <svtools/rtfkeywd.hxx>
@@ -147,6 +148,22 @@ void ScRTFExport::WriteRow( SCTAB nTab, SCROW nRow )
     m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_ROW ).WriteOString( 
SAL_NEWLINE_STRING );
 }
 
+int ScRTFExport::AddFont(const SvxFontItem& rFontItem)
+{
+    auto nRet = m_pFontTable.size();
+    auto itFont(m_pFontTable.find(rFontItem.GetFamilyName()));
+    if (itFont == m_pFontTable.end())
+    {
+        m_pFontTable[rFontItem.GetFamilyName()] = nRet;
+    }
+    else
+    {
+        nRet = itFont->second;
+    }
+
+    return nRet;
+}
+
 void ScRTFExport::WriteCell( SCTAB nTab, SCROW nRow, SCCOL nCol )
 {
     const ScPatternAttr* pAttr = pDoc->GetPattern( nCol, nRow, nTab );
commit 3a2e38a8f3b1a324738c23ca59efc51544c2f29e
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Tue Jul 25 15:28:39 2023 -0400
Commit:     Aron Budea <aron.bu...@collabora.com>
CommitDate: Thu Aug 3 22:34:08 2023 +0200

    sc: filter: rtf: prefix m_* private members
    
    Signed-off-by: Henry Castro <hcas...@collabora.com>
    Change-Id: If8389b6e63a90616131d0dd9fbb5a7b8b96ffe3d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154904
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155259
    (cherry picked from commit 3b310294851b91ca63eb2696bbada3caaeb79c10)

diff --git a/sc/source/filter/inc/rtfexp.hxx b/sc/source/filter/inc/rtfexp.hxx
index 9a4fe43d9d02..14ee8ec023f7 100644
--- a/sc/source/filter/inc/rtfexp.hxx
+++ b/sc/source/filter/inc/rtfexp.hxx
@@ -25,7 +25,7 @@
 
 class ScRTFExport : public ScExportBase
 {
-    std::unique_ptr<sal_uLong[]>  pCellX;     // cumulative range in a table
+    std::unique_ptr<sal_uLong[]>  m_pCellX;     // cumulative range in a table
     SvMemoryStream m_aDocStrm;
 
     void                WriteTab( SCTAB nTab );
diff --git a/sc/source/filter/rtf/rtfexp.cxx b/sc/source/filter/rtf/rtfexp.cxx
index f669c289e0ba..152b8ff5d57f 100644
--- a/sc/source/filter/rtf/rtfexp.cxx
+++ b/sc/source/filter/rtf/rtfexp.cxx
@@ -46,7 +46,7 @@ void ScFormatFilterPluginImpl::ScExportRTF( SvStream& rStrm, 
ScDocument* pDoc,
 ScRTFExport::ScRTFExport( SvStream& rStrmP, ScDocument* pDocP, const ScRange& 
rRangeP )
             :
             ScExportBase( rStrmP, pDocP, rRangeP ),
-            pCellX( new sal_uLong[ pDoc->MaxCol()+2 ] )
+            m_pCellX( new sal_uLong[ pDoc->MaxCol()+2 ] )
 {
 }
 
@@ -77,12 +77,12 @@ void ScRTFExport::WriteTab( SCTAB nTab )
     m_aDocStrm.WriteChar( '{' ).WriteOString( SAL_NEWLINE_STRING );
     if ( pDoc->HasTable( nTab ) )
     {
-        memset( &pCellX[0], 0, (pDoc->MaxCol()+2) * sizeof(sal_uLong) );
+        memset( &m_pCellX[0], 0, (pDoc->MaxCol()+2) * sizeof(sal_uLong) );
         SCCOL nCol;
         SCCOL nEndCol = aRange.aEnd.Col();
         for ( nCol = aRange.aStart.Col(); nCol <= nEndCol; nCol++ )
         {
-            pCellX[nCol+1] = pCellX[nCol] + pDoc->GetColWidth( nCol, nTab );
+            m_pCellX[nCol+1] = m_pCellX[nCol] + pDoc->GetColWidth( nCol, nTab 
);
         }
 
         SCROW nEndRow = aRange.aEnd.Row();
@@ -128,7 +128,7 @@ void ScRTFExport::WriteRow( SCTAB nTab, SCROW nRow )
         if ( pChar )
             m_aDocStrm.WriteOString( pChar );
 
-        m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_CELLX ).WriteOString( 
OString::number(pCellX[nCol+1]) );
+        m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_CELLX ).WriteOString( 
OString::number(m_pCellX[nCol+1]) );
         if ( (nCol & 0x0F) == 0x0F )
             m_aDocStrm.WriteOString( SAL_NEWLINE_STRING ); // Do not let lines 
get too long
     }
commit 647235f63f550eec23835a6c0574fe3b709cee41
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Tue Jul 25 15:18:10 2023 -0400
Commit:     Aron Budea <aron.bu...@collabora.com>
CommitDate: Thu Aug 3 22:33:24 2023 +0200

    sc: filter: rtf: use a separate document stream
    
    "An RTF file has the following syntax:
    '{' <header> <document>'}' "
    
    In order to build the header:
    
    <header>
            \rtf <charset> \deff? <fonttbl> <filetbl>? <colortbl>? 
<stylesheet>? <listtables>? <revtbl>?
    
    The font table should be created while visiting the column/rows.
    
    Signed-off-by: Henry Castro <hcas...@collabora.com>
    Change-Id: Id72a3c87acab6cfc7889cf81f7e83a0d73e378a2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154903
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155258
    (cherry picked from commit 98321ad324d386a9ad14a428fae949c3d7f5e3d3)

diff --git a/sc/source/filter/inc/rtfexp.hxx b/sc/source/filter/inc/rtfexp.hxx
index 0d5e69f79d8e..9a4fe43d9d02 100644
--- a/sc/source/filter/inc/rtfexp.hxx
+++ b/sc/source/filter/inc/rtfexp.hxx
@@ -26,6 +26,7 @@
 class ScRTFExport : public ScExportBase
 {
     std::unique_ptr<sal_uLong[]>  pCellX;     // cumulative range in a table
+    SvMemoryStream m_aDocStrm;
 
     void                WriteTab( SCTAB nTab );
     void                WriteRow( SCTAB nTab, SCROW nRow );
diff --git a/sc/source/filter/rtf/rtfexp.cxx b/sc/source/filter/rtf/rtfexp.cxx
index 340e3cdab7c7..f669c289e0ba 100644
--- a/sc/source/filter/rtf/rtfexp.cxx
+++ b/sc/source/filter/rtf/rtfexp.cxx
@@ -63,16 +63,18 @@ void ScRTFExport::Write()
     for ( SCTAB nTab = aRange.aStart.Tab(); nTab <= aRange.aEnd.Tab(); nTab++ )
     {
         if ( nTab > aRange.aStart.Tab() )
-            rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_PAR );
+            m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_PAR );
         WriteTab( nTab );
     }
 
-    rStrm.WriteChar( '}' ).WriteCharPtr( SAL_NEWLINE_STRING );
+    m_aDocStrm.Seek(0);
+    rStrm.WriteStream(m_aDocStrm);
+    rStrm.WriteChar( '}' ).WriteOString( SAL_NEWLINE_STRING );
 }
 
 void ScRTFExport::WriteTab( SCTAB nTab )
 {
-    rStrm.WriteChar( '{' ).WriteCharPtr( SAL_NEWLINE_STRING );
+    m_aDocStrm.WriteChar( '{' ).WriteOString( SAL_NEWLINE_STRING );
     if ( pDoc->HasTable( nTab ) )
     {
         memset( &pCellX[0], 0, (pDoc->MaxCol()+2) * sizeof(sal_uLong) );
@@ -89,13 +91,13 @@ void ScRTFExport::WriteTab( SCTAB nTab )
             WriteRow( nTab, nRow );
         }
     }
-    rStrm.WriteChar( '}' ).WriteCharPtr( SAL_NEWLINE_STRING );
+    m_aDocStrm.WriteChar( '}' ).WriteOString( SAL_NEWLINE_STRING );
 }
 
 void ScRTFExport::WriteRow( SCTAB nTab, SCROW nRow )
 {
-    rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_TROWD ).WriteCharPtr( 
OOO_STRING_SVTOOLS_RTF_TRGAPH ).WriteCharPtr( "30" ).WriteCharPtr( 
OOO_STRING_SVTOOLS_RTF_TRLEFT ).WriteCharPtr( "-30" );
-    rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_TRRH ).WriteOString( 
OString::number(pDoc->GetRowHeight(nRow, nTab)) );
+    m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_TROWD ).WriteOString( 
OOO_STRING_SVTOOLS_RTF_TRGAPH ).WriteOString( "30" ).WriteOString( 
OOO_STRING_SVTOOLS_RTF_TRLEFT ).WriteOString( "-30" );
+    m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_TRRH ).WriteOString( 
OString::number(pDoc->GetRowHeight(nRow, nTab)) );
     SCCOL nCol;
     SCCOL nEndCol = aRange.aEnd.Col();
     for ( nCol = aRange.aStart.Col(); nCol <= nEndCol; nCol++ )
@@ -107,12 +109,12 @@ void ScRTFExport::WriteRow( SCTAB nTab, SCROW nRow )
         const char* pChar;
 
         if ( rMergeAttr.GetColMerge() != 0 )
-            rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_CLMGF );
+            m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_CLMGF );
         else
         {
             const ScMergeFlagAttr& rMergeFlagAttr = pAttr->GetItem( 
ATTR_MERGE_FLAG );
             if ( rMergeFlagAttr.IsHorOverlapped() )
-                rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_CLMRG );
+                m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_CLMRG );
         }
 
         switch( rVerJustifyItem.GetValue() )
@@ -124,25 +126,25 @@ void ScRTFExport::WriteRow( SCTAB nTab, SCROW nRow )
             default:                           pChar = nullptr;           
break;
         }
         if ( pChar )
-            rStrm.WriteCharPtr( pChar );
+            m_aDocStrm.WriteOString( pChar );
 
-        rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_CELLX ).WriteOString( 
OString::number(pCellX[nCol+1]) );
+        m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_CELLX ).WriteOString( 
OString::number(pCellX[nCol+1]) );
         if ( (nCol & 0x0F) == 0x0F )
-            rStrm.WriteCharPtr( SAL_NEWLINE_STRING ); // Do not let lines get 
too long
+            m_aDocStrm.WriteOString( SAL_NEWLINE_STRING ); // Do not let lines 
get too long
     }
-    rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_PARD ).WriteCharPtr( 
OOO_STRING_SVTOOLS_RTF_PLAIN ).WriteCharPtr( OOO_STRING_SVTOOLS_RTF_INTBL 
).WriteCharPtr( SAL_NEWLINE_STRING );
+    m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_PARD ).WriteOString( 
OOO_STRING_SVTOOLS_RTF_PLAIN ).WriteOString( OOO_STRING_SVTOOLS_RTF_INTBL 
).WriteOString( SAL_NEWLINE_STRING );
 
-    sal_uLong nStrmPos = rStrm.Tell();
+    sal_uLong nStrmPos = m_aDocStrm.Tell();
     for ( nCol = aRange.aStart.Col(); nCol <= nEndCol; nCol++ )
     {
         WriteCell( nTab, nRow, nCol );
-        if ( rStrm.Tell() - nStrmPos > 255 )
+        if ( m_aDocStrm.Tell() - nStrmPos > 255 )
         {   // Do not let lines get too long
-            rStrm.WriteCharPtr( SAL_NEWLINE_STRING );
-            nStrmPos = rStrm.Tell();
+            m_aDocStrm.WriteOString( SAL_NEWLINE_STRING );
+            nStrmPos = m_aDocStrm.Tell();
         }
     }
-    rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_ROW ).WriteCharPtr( 
SAL_NEWLINE_STRING );
+    m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_ROW ).WriteOString( 
SAL_NEWLINE_STRING );
 }
 
 void ScRTFExport::WriteCell( SCTAB nTab, SCROW nRow, SCCOL nCol )
@@ -152,7 +154,7 @@ void ScRTFExport::WriteCell( SCTAB nTab, SCROW nRow, SCCOL 
nCol )
     const ScMergeFlagAttr& rMergeFlagAttr = pAttr->GetItem( ATTR_MERGE_FLAG );
     if ( rMergeFlagAttr.IsHorOverlapped() )
     {
-        rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_CELL );
+        m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_CELL );
         return ;
     }
 
@@ -204,30 +206,30 @@ void ScRTFExport::WriteCell( SCTAB nTab, SCROW nRow, 
SCCOL nCol )
         case SvxCellHorJustify::Repeat:
         default:                        pChar = OOO_STRING_SVTOOLS_RTF_QL;  
break;
     }
-    rStrm.WriteCharPtr( pChar );
+    m_aDocStrm.WriteOString( pChar );
 
     if ( rWeightItem.GetWeight() >= WEIGHT_BOLD )
     {   // bold
         bResetAttr = true;
-        rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_B );
+        m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_B );
     }
     if ( rPostureItem.GetPosture() != ITALIC_NONE )
     {   // italic
         bResetAttr = true;
-        rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_I );
+        m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_I );
     }
     if ( rUnderlineItem.GetLineStyle() != LINESTYLE_NONE )
     {   // underline
         bResetAttr = true;
-        rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_UL );
+        m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_UL );
     }
 
-    rStrm.WriteChar( ' ' );
-    RTFOutFuncs::Out_String( rStrm, aContent );
-    rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_CELL );
+    m_aDocStrm.WriteChar( ' ' );
+    RTFOutFuncs::Out_String( m_aDocStrm, aContent );
+    m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_CELL );
 
     if ( bResetAttr )
-        rStrm.WriteCharPtr( OOO_STRING_SVTOOLS_RTF_PLAIN );
+        m_aDocStrm.WriteOString( OOO_STRING_SVTOOLS_RTF_PLAIN );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to