summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2012-11-05 18:33:42 -0600
committerNorbert Thiebaud <nthiebaud@gmail.com>2012-11-18 19:57:22 -0600
commit4e6a7df7c53389b043274be37b17679bd456d89d (patch)
tree031a128eff7f0ba5e50232e2bf743db03410371f /svl
parentead89ae2019b0533306d7b485ddcc71c57362599 (diff)
svl: aNameStandardFormat can be OUString for free
Change-Id: I61f57ed6a5aad0bf7a69319c36b080213b74ad6a
Diffstat (limited to 'svl')
-rw-r--r--svl/source/numbers/zforscan.cxx48
-rw-r--r--svl/source/numbers/zforscan.hxx2
2 files changed, 28 insertions, 22 deletions
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index b2e636489427..86e9ba62f066 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -169,9 +169,9 @@ void ImpSvNumberformatScan::InitKeywords() const
/** Extract the name of General, Standard, Whatever, ignoring leading modifiers
such as [NatNum1]. */
-static String lcl_extractStandardGeneralName( const ::rtl::OUString & rCode )
+static OUString lcl_extractStandardGeneralName( const ::rtl::OUString & rCode )
{
- String aStr;
+ OUString aStr;
const sal_Unicode* p = rCode.getStr();
const sal_Unicode* const pStop = p + rCode.getLength();
const sal_Unicode* pBeg = p; // name begins here
@@ -181,32 +181,36 @@ static String lcl_extractStandardGeneralName( const ::rtl::OUString & rCode )
{
switch (*p)
{
- case '[':
- bMod = true;
- break;
- case ']':
- if (bMod)
- {
- bMod = false;
- pBeg = p+1;
- }
- // else: would be a locale data error, easily to be spotted in
- // UI dialog
- break;
- case ';':
- if (!bMod)
- {
- bDone = true;
- --p; // put back, increment by one follows
- }
- break;
+ case '[':
+ bMod = true;
+ break;
+ case ']':
+ if (bMod)
+ {
+ bMod = false;
+ pBeg = p+1;
+ }
+ // else: would be a locale data error, easily to be spotted in
+ // UI dialog
+ break;
+ case ';':
+ if (!bMod)
+ {
+ bDone = true;
+ --p; // put back, increment by one follows
+ }
+ break;
}
++p;
if (bMod)
+ {
pBeg = p;
+ }
}
if (pBeg < p)
+ {
aStr = rCode.copy( pBeg - rCode.getStr(), p - pBeg);
+ }
return aStr;
}
@@ -1558,7 +1562,9 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString )
{
nThousand = FLAG_STANDARD_IN_FORMAT;
if ( bConvertMode )
+ {
sStrArray[i] = sNameStandardFormat;
+ }
}
nPos = nPos + sStrArray[i].Len();
i++;
diff --git a/svl/source/numbers/zforscan.hxx b/svl/source/numbers/zforscan.hxx
index 8a33ff5cc63d..557bd906e3ea 100644
--- a/svl/source/numbers/zforscan.hxx
+++ b/svl/source/numbers/zforscan.hxx
@@ -155,7 +155,7 @@ private: // ---- privater Teil
Color StandardColor[NF_MAX_DEFAULT_COLORS];
// Array der Standardfarben
Date* pNullDate; // 30Dec1899
- String sNameStandardFormat; // "Standard"
+ OUString sNameStandardFormat; // "Standard"
sal_uInt16 nStandardPrec; // default Precision for Standardformat
SvNumberFormatter* pFormatter; // Pointer auf die Formatliste