summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editeng/source/items/itemtype.cxx13
1 files changed, 5 insertions, 8 deletions
diff --git a/editeng/source/items/itemtype.cxx b/editeng/source/items/itemtype.cxx
index 4b0e89424774..8a1a82ed1e64 100644
--- a/editeng/source/items/itemtype.cxx
+++ b/editeng/source/items/itemtype.cxx
@@ -155,10 +155,9 @@ XubString GetColorString( const Color& rCol )
{
XubString sStr;
- FASTBOOL bFound = sal_False;
ColorData nColData =
RGB_COLORDATA( rCol.GetRed(), rCol.GetGreen(), rCol.GetBlue() );
- sal_uInt16 nColor = 0, nColCount = 16;
+ sal_uInt16 nColor = 0;
static ColorData aColAry[] = {
COL_BLACK, COL_BLUE, COL_GREEN, COL_CYAN,
@@ -166,15 +165,13 @@ XubString GetColorString( const Color& rCol )
COL_LIGHTGRAY, COL_LIGHTBLUE, COL_LIGHTGREEN, COL_LIGHTCYAN,
COL_LIGHTRED, COL_LIGHTMAGENTA, COL_YELLOW, COL_WHITE };
- while ( !bFound && nColor < nColCount )
+ while ( nColor < sizeof(aColAry)/sizeof(ColorData) &&
+ aColAry[nColor] != nColData )
{
- if ( aColAry[nColor] == nColData )
- bFound = sal_True;
- else
- nColor++;
+ nColor += 1;
}
- if ( nColor < nColCount )
+ if ( nColor < sizeof(aColAry)/sizeof(ColorData) )
sStr = EE_RESSTR( RID_SVXITEMS_COLOR_BEGIN + nColor + 1 );
if ( !sStr.Len() )