[ooo-build-commit] .: sw/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Tue Oct 5 05:54:30 PDT 2010


 sw/source/filter/ww8/rtfexport.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 3ea104b5e803f09114a7ebea9da7414440252d96
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Tue Oct 5 14:51:11 2010 +0200

    fdo #30604: Fixed some color problem in RTF export when copy/pasting

diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index 43a0f02..cc9bb82 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -936,9 +936,12 @@ USHORT RtfExport::GetColor( const Color& rColor ) const
 void RtfExport::InsColor( const Color& rCol )
 {
     USHORT n;
+    bool bContainsAuto = false;
     for (RtfColorTbl::iterator it=m_aColTbl.begin() ; it != m_aColTbl.end(); it++ )
         if ((*it).second == rCol)
             return; // Already in the table
+        else if ((*it).second == COL_AUTO)
+            bContainsAuto = true;
     if (rCol.GetColor() == COL_AUTO)
         n = 0;
     else
@@ -948,6 +951,10 @@ void RtfExport::InsColor( const Color& rCol )
         // gets overwritten by COL_AUTO
         if (!n)
             n++;
+
+        // Fix the case where the table doesn't contain the COL_AUTO at #0
+        else if (!bContainsAuto)
+            n++;
     }
     m_aColTbl.insert(std::pair<USHORT,Color>( n, rCol ));
 }


More information about the ooo-build-commit mailing list