summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedricbosdo@openoffice.org>2010-10-05 14:51:11 +0200
committerCédric Bosdonnat <cedricbosdo@openoffice.org>2010-10-05 14:54:23 +0200
commit3ea104b5e803f09114a7ebea9da7414440252d96 (patch)
treeed624e11014589d23f00a82c04c95520d0f4462e
parent8dd45f829532162a7186ff4858e0696ac20858cf (diff)
fdo #30604: Fixed some color problem in RTF export when copy/pasting
-rw-r--r--sw/source/filter/ww8/rtfexport.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index 43a0f02e0c..cc9bb82225 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 ));
}