summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2011-02-25 13:07:15 -0500
committerKohei Yoshida <kyoshida@novell.com>2011-02-28 10:39:31 -0500
commitc03562112ffb0978cd6658ead1058616eac12b65 (patch)
tree38b9e1430ef319edad71de7d4aaa1d6703a73f78 /svl
parent6aad3e48b43a637efc372b448298102866e6dc8b (diff)
Store locale type instead of language type.
Diffstat (limited to 'svl')
-rw-r--r--svl/inc/svl/zformat.hxx28
-rw-r--r--svl/source/numbers/zformat.cxx22
2 files changed, 25 insertions, 25 deletions
diff --git a/svl/inc/svl/zformat.hxx b/svl/inc/svl/zformat.hxx
index fe59468ad67d..b04768e64783 100644
--- a/svl/inc/svl/zformat.hxx
+++ b/svl/inc/svl/zformat.hxx
@@ -175,6 +175,18 @@ private:
class SVL_DLLPUBLIC SvNumberformat
{
+ struct LocaleType
+ {
+ sal_uInt8 mnNumeralShape;
+ sal_uInt8 mnCalendarType;
+ LanguageType meLanguage;
+
+ ::rtl::OUString generateCode() const;
+
+ LocaleType();
+ LocaleType(sal_uInt32 nRawCode);
+ };
+
public:
// Ctor for Load
SvNumberformat( ImpSvNumberformatScan& rSc, LanguageType eLge );
@@ -215,7 +227,7 @@ public:
BOOL IsAdditionalStandardDefined() const
{ return nNewStandardDefined == SV_NUMBERFORMATTER_VERSION_ADDITIONAL_I18N_FORMATS; }
- LanguageType GetLanguage() const { return eLnge;}
+ LanguageType GetLanguage() const { return maLocale.meLanguage;}
const String& GetFormatstring() const { return sFormatstring; }
@@ -456,7 +468,7 @@ private:
double fLimit1; // Value for first condition
double fLimit2; // Value for second condition
ImpSvNumberformatScan& rScan; // Format code scanner
- LanguageType eLnge; // Language/country of the format
+ LocaleType maLocale; // Language/country of the format, numeral shape and calendar type from Excel.
SvNumberformatLimitOps eOp1; // Operator for first condition
SvNumberformatLimitOps eOp2; // Operator for second condition
USHORT nNewStandardDefined; // new builtin formats as of version 6
@@ -489,18 +501,6 @@ private:
xub_StrLen& nPos,
String& sSymbol );
- struct LocaleType
- {
- sal_uInt8 mnNumeralShape;
- sal_uInt8 mnCalendarType;
- LanguageType meLanguage;
-
- ::rtl::OUString generateCode() const;
-
- LocaleType();
- LocaleType(sal_uInt32 nRawCode);
- };
-
/**
* Parse the content of '[$-xxx] or '[$-xxxxxxxx]' and extract the locale
* type from it. Given the string, start parsing at position specified by
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 264128538947..911b511b94e0 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -513,17 +513,17 @@ enum BracketFormatSymbolType
SvNumberformat::SvNumberformat( ImpSvNumberformatScan& rSc, LanguageType eLge )
:
rScan(rSc),
- eLnge(eLge),
nNewStandardDefined(0),
bStarFlag( FALSE )
{
+ maLocale.meLanguage = eLge;
}
void SvNumberformat::ImpCopyNumberformat( const SvNumberformat& rFormat )
{
sFormatstring = rFormat.sFormatstring;
eType = rFormat.eType;
- eLnge = rFormat.eLnge;
+ maLocale = rFormat.maLocale;
fLimit1 = rFormat.fLimit1;
fLimit2 = rFormat.fLimit2;
eOp1 = rFormat.eOp1;
@@ -620,11 +620,11 @@ SvNumberformat::SvNumberformat(String& rString,
if (rScan.GetConvertMode())
{
- eLnge = rScan.GetNewLnge();
- eLan = eLnge; // Wechsel auch zurueckgeben
+ maLocale.meLanguage = rScan.GetNewLnge();
+ eLan = maLocale.meLanguage; // Wechsel auch zurueckgeben
}
else
- eLnge = eLan;
+ maLocale.meLanguage = eLan;
bStandard = bStan;
bIsUsed = FALSE;
fLimit1 = 0.0;
@@ -800,8 +800,8 @@ SvNumberformat::SvNumberformat(String& rString,
else
{
xub_StrLen nTmp = 2;
- LocaleType aLocale = ImpGetLocaleType( sStr, nTmp );
- if (aLocale.meLanguage == LANGUAGE_DONTKNOW)
+ maLocale = ImpGetLocaleType( sStr, nTmp );
+ if (maLocale.meLanguage == LANGUAGE_DONTKNOW)
{
bCancel = TRUE; // break for
nCheckPos = nPosOld;
@@ -809,8 +809,8 @@ SvNumberformat::SvNumberformat(String& rString,
else
{
sStr.AssignAscii( RTL_CONSTASCII_STRINGPARAM("$-") );
- sStr = sStr + aLocale.generateCode();
- NumFor[nIndex].SetNatNumLang(aLocale.meLanguage);
+ sStr = sStr + maLocale.generateCode();
+ NumFor[nIndex].SetNatNumLang(maLocale.meLanguage);
}
}
}
@@ -1593,7 +1593,7 @@ NfHackConversion SvNumberformat::Load( SvStream& rStream,
String aStr( sFormatstring );
xub_StrLen nCheckPos = 0;
SvNumberformat* pFormat = new SvNumberformat( aStr, &rScan, &rISc,
- nCheckPos, eLnge, bStandard );
+ nCheckPos, maLocale.meLanguage, bStandard );
DBG_ASSERT( !nCheckPos, "SvNumberformat::Load: NewCurrencyRescan nCheckPos" );
ImpCopyNumberformat( *pFormat );
delete pFormat;
@@ -1643,7 +1643,7 @@ void SvNumberformat::ConvertLanguage( SvNumberFormatter& rConverter,
ImpCopyNumberformat( *pFormat );
// aus Formatter/Scanner uebernommene Werte zuruecksetzen
if ( bSystem )
- eLnge = LANGUAGE_SYSTEM;
+ maLocale.meLanguage = LANGUAGE_SYSTEM;
// pColor zeigt noch auf Tabelle in temporaerem Formatter/Scanner
for ( USHORT i = 0; i < 4; i++ )
{