summaryrefslogtreecommitdiff
path: root/svl/source/numbers/zforscan.cxx
diff options
context:
space:
mode:
authorLaurent BP <laurent.balland-poirier@laposte.net>2017-10-22 17:29:52 +0200
committerEike Rathke <erack@redhat.com>2017-11-01 15:30:03 +0100
commita4bf4aa86d5560bd7bd740d4a9637e5c637c9116 (patch)
treef5436fbe064f603ca6ae9defdc4ed3f6b58e0350 /svl/source/numbers/zforscan.cxx
parent30a258e92a9060061e2f8a0c7cbde2bcc511c4bb (diff)
Make StandardColor and sErrStr static
StandardColor cannot be made const because GetColor returns a pointer on it Change-Id: I974b1463012431069910db32a2cd7280b5d0b17e Reviewed-on: https://gerrit.libreoffice.org/43790 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'svl/source/numbers/zforscan.cxx')
-rw-r--r--svl/source/numbers/zforscan.cxx30
1 files changed, 19 insertions, 11 deletions
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index e5e2b7dc83ff..f845b5f2ed5d 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -101,6 +101,11 @@ const ::std::vector<OUString> ImpSvNumberformatScan::sEnglishKeyword =
"t" // NF_KEY_THAI_T Thai T modifier, speciality of Thai Excel, only used with Thai locale and converted to [NatNum1]
}; // only exception as lowercase
+::std::vector<Color> ImpSvNumberformatScan::StandardColor;
+bool ImpSvNumberformatScan::bStandardColorNeedInitialization = true;
+
+const OUString ImpSvNumberformatScan::sErrStr = "###";
+
ImpSvNumberformatScan::ImpSvNumberformatScan( SvNumberFormatter* pFormatterP )
: maNullDate( 30, 12, 1899)
, eNewLnge(LANGUAGE_DONTKNOW)
@@ -129,20 +134,23 @@ ImpSvNumberformatScan::ImpSvNumberformatScan( SvNumberFormatter* pFormatterP )
bKeywordsNeedInit = true; // locale dependent keywords
bCompatCurNeedInit = true; // locale dependent compatibility currency strings
- StandardColor[0] = Color(COL_BLACK);
- StandardColor[1] = Color(COL_LIGHTBLUE);
- StandardColor[2] = Color(COL_LIGHTGREEN);
- StandardColor[3] = Color(COL_LIGHTCYAN);
- StandardColor[4] = Color(COL_LIGHTRED);
- StandardColor[5] = Color(COL_LIGHTMAGENTA);
- StandardColor[6] = Color(COL_BROWN);
- StandardColor[7] = Color(COL_GRAY);
- StandardColor[8] = Color(COL_YELLOW);
- StandardColor[9] = Color(COL_WHITE);
+ if ( bStandardColorNeedInitialization )
+ {
+ bStandardColorNeedInitialization = false;
+ StandardColor.push_back( Color(COL_BLACK) );
+ StandardColor.push_back( Color(COL_LIGHTBLUE) );
+ StandardColor.push_back( Color(COL_LIGHTGREEN) );
+ StandardColor.push_back( Color(COL_LIGHTCYAN) );
+ StandardColor.push_back( Color(COL_LIGHTRED) );
+ StandardColor.push_back( Color(COL_LIGHTMAGENTA) );
+ StandardColor.push_back( Color(COL_BROWN) );
+ StandardColor.push_back( Color(COL_GRAY) );
+ StandardColor.push_back( Color(COL_YELLOW) );
+ StandardColor.push_back( Color(COL_WHITE) );
+ }
nStandardPrec = 2;
- sErrStr = "###";
Reset();
}