Kaydet (Commit) a7455a4a authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

svl: convert ImplEnglishColors to OUString

Change-Id: I5ec8f1061aa41ac0c4bb46d9159be439892706a1
üst 566adca8
...@@ -43,27 +43,27 @@ namespace ...@@ -43,27 +43,27 @@ namespace
{ {
struct ImplEnglishColors struct ImplEnglishColors
{ {
const String* operator()() const OUString* operator()()
{ {
static const String aEnglishColors[NF_MAX_DEFAULT_COLORS] = static const OUString aEnglishColors[NF_MAX_DEFAULT_COLORS] =
{ {
String( RTL_CONSTASCII_USTRINGPARAM( "BLACK" ) ), OUString( "BLACK" ),
String( RTL_CONSTASCII_USTRINGPARAM( "BLUE" ) ), OUString( "BLUE" ),
String( RTL_CONSTASCII_USTRINGPARAM( "GREEN" ) ), OUString( "GREEN" ),
String( RTL_CONSTASCII_USTRINGPARAM( "CYAN" ) ), OUString( "CYAN" ),
String( RTL_CONSTASCII_USTRINGPARAM( "RED" ) ), OUString( "RED" ),
String( RTL_CONSTASCII_USTRINGPARAM( "MAGENTA" ) ), OUString( "MAGENTA" ),
String( RTL_CONSTASCII_USTRINGPARAM( "BROWN" ) ), OUString( "BROWN" ),
String( RTL_CONSTASCII_USTRINGPARAM( "GREY" ) ), OUString( "GREY" ),
String( RTL_CONSTASCII_USTRINGPARAM( "YELLOW" ) ), OUString( "YELLOW" ),
String( RTL_CONSTASCII_USTRINGPARAM( "WHITE" ) ) OUString( "WHITE" )
}; };
return &aEnglishColors[0]; return &aEnglishColors[0];
} }
}; };
struct theEnglishColors struct theEnglishColors
: public rtl::StaticAggregate< const String, ImplEnglishColors> {}; : public rtl::StaticAggregate< const OUString, ImplEnglishColors> {};
} }
...@@ -455,27 +455,32 @@ void ImpSvNumberformatScan::ChangeStandardPrec(sal_uInt16 nPrec) ...@@ -455,27 +455,32 @@ void ImpSvNumberformatScan::ChangeStandardPrec(sal_uInt16 nPrec)
Color* ImpSvNumberformatScan::GetColor(String& sStr) Color* ImpSvNumberformatScan::GetColor(String& sStr)
{ {
String sString = pFormatter->GetCharClass()->uppercase(sStr); String sString = pFormatter->GetCharClass()->uppercase(sStr);
OUString aString(sString);
const NfKeywordTable & rKeyword = GetKeywords(); const NfKeywordTable & rKeyword = GetKeywords();
size_t i = 0; size_t i = 0;
while (i < NF_MAX_DEFAULT_COLORS && while (i < NF_MAX_DEFAULT_COLORS && sString != rKeyword[NF_KEY_FIRSTCOLOR+i] )
sString != rKeyword[NF_KEY_FIRSTCOLOR+i] ) {
i++; i++;
}
if ( i >= NF_MAX_DEFAULT_COLORS ) if ( i >= NF_MAX_DEFAULT_COLORS )
{ {
const String* pEnglishColors = theEnglishColors::get(); const OUString* pEnglishColors = theEnglishColors::get();
size_t j = 0; size_t j = 0;
while ( j < NF_MAX_DEFAULT_COLORS && while ( j < NF_MAX_DEFAULT_COLORS && aString != pEnglishColors[j] )
sString != pEnglishColors[j] ) {
++j; ++j;
}
if ( j < NF_MAX_DEFAULT_COLORS ) if ( j < NF_MAX_DEFAULT_COLORS )
{
i = j; i = j;
}
} }
Color* pResult = NULL; Color* pResult = NULL;
if (i >= NF_MAX_DEFAULT_COLORS) if (i >= NF_MAX_DEFAULT_COLORS)
{ {
const String& rColorWord = rKeyword[NF_KEY_COLOR]; const OUString& rColorWord = OUString(rKeyword[NF_KEY_COLOR]);
xub_StrLen nPos = sString.Match(rColorWord); sal_Int32 nPos = aString.startsWith(rColorWord);
if (nPos > 0) if (nPos > 0)
{ {
sStr.Erase(0, nPos); sStr.Erase(0, nPos);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment