[Libreoffice-commits] core.git: svl/source
Stephan Bergmann
sbergman at redhat.com
Tue Aug 16 08:46:28 UTC 2016
svl/source/numbers/zforscan.cxx | 42 +++++++++++-----------------------------
1 file changed, 12 insertions(+), 30 deletions(-)
New commits:
commit b4f2af4bb8d060423b3c50a7026e5045ff64c432
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Aug 16 10:45:59 2016 +0200
loplugin:stringstatic
Change-Id: Icb05f681aa549a975ae4a1dee749e20ad4a215f0
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index d0a462e..3642e91 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -26,7 +26,6 @@
#include <unotools/charclass.hxx>
#include <unotools/localedatawrapper.hxx>
#include <unotools/numberformatcodewrapper.hxx>
-#include <rtl/instance.hxx>
#include <svl/zforlist.hxx>
#include <svl/zformat.hxx>
@@ -40,34 +39,6 @@ using namespace svt;
const sal_Unicode cNoBreakSpace = 0xA0;
const sal_Unicode cNarrowNoBreakSpace = 0x202F;
-namespace
-{
- struct ImplEnglishColors
- {
- const OUString* operator()()
- {
- static const OUString aEnglishColors[NF_MAX_DEFAULT_COLORS] =
- {
- OUString( "BLACK" ),
- OUString( "BLUE" ),
- OUString( "GREEN" ),
- OUString( "CYAN" ),
- OUString( "RED" ),
- OUString( "MAGENTA" ),
- OUString( "BROWN" ),
- OUString( "GREY" ),
- OUString( "YELLOW" ),
- OUString( "WHITE" )
- };
- return &aEnglishColors[0];
- }
- };
-
- struct theEnglishColors
- : public rtl::StaticAggregate< const OUString, ImplEnglishColors> {};
-
-}
-
ImpSvNumberformatScan::ImpSvNumberformatScan( SvNumberFormatter* pFormatterP )
: eNewLnge(LANGUAGE_DONTKNOW)
, eTmpLnge(LANGUAGE_DONTKNOW)
@@ -470,7 +441,18 @@ Color* ImpSvNumberformatScan::GetColor(OUString& sStr)
}
if ( i >= NF_MAX_DEFAULT_COLORS )
{
- const OUString* pEnglishColors = theEnglishColors::get();
+ static OUStringLiteral const pEnglishColors[NF_MAX_DEFAULT_COLORS] = {
+ OUStringLiteral( "BLACK" ),
+ OUStringLiteral( "BLUE" ),
+ OUStringLiteral( "GREEN" ),
+ OUStringLiteral( "CYAN" ),
+ OUStringLiteral( "RED" ),
+ OUStringLiteral( "MAGENTA" ),
+ OUStringLiteral( "BROWN" ),
+ OUStringLiteral( "GREY" ),
+ OUStringLiteral( "YELLOW" ),
+ OUStringLiteral( "WHITE" )
+ };
size_t j = 0;
while ( j < NF_MAX_DEFAULT_COLORS && sString != pEnglishColors[j] )
{
More information about the Libreoffice-commits
mailing list