incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mba...@apache.org
Subject svn commit: r1172363 - /incubator/ooo/trunk/main/sw/source/filter/ww8/rtfexport.cxx
Date Sun, 18 Sep 2011 21:25:24 GMT
Author: mbauer
Date: Sun Sep 18 21:25:23 2011
New Revision: 1172363

URL: http://svn.apache.org/viewvc?rev=1172363&view=rev
Log:
cws mba34issues01: #i117943#: missing color attributes in RTF clipboard

Modified:
    incubator/ooo/trunk/main/sw/source/filter/ww8/rtfexport.cxx

Modified: incubator/ooo/trunk/main/sw/source/filter/ww8/rtfexport.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/filter/ww8/rtfexport.cxx?rev=1172363&r1=1172362&r2=1172363&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/filter/ww8/rtfexport.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/filter/ww8/rtfexport.cxx Sun Sep 18 21:25:23 2011
@@ -973,19 +973,27 @@ sal_uInt16 RtfExport::GetColor( const Co
 void RtfExport::InsColor( const Color& rCol )
 {
     sal_uInt16 n;
-    for (RtfColorTbl::iterator it=m_aColTbl.begin() ; it != m_aColTbl.end(); it++ )
+    bool bAutoColorInTable = 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)
+            bAutoColorInTable = true;
+    }
+            
     if (rCol.GetColor() == COL_AUTO)
+		// COL_AUTO gets value 0
         n = 0;
     else
     {
+		// other colors get values >0
         n = m_aColTbl.size();
-        // Fix for the case when first a !COL_AUTO gets inserted as #0, then
-        // gets overwritten by COL_AUTO
-        if (!n)
+        if (!bAutoColorInTable)
+			// reserve value "0" for COL_AUTO (if COL_AUTO wasn't inserted until now)
             n++;
     }
+
     m_aColTbl.insert(std::pair<sal_uInt16,Color>( n, rCol ));
 }
 



Mime
View raw message