[Libreoffice-commits] .: 5 commits - svl/inc svl/qa svl/source

Kohei Yoshida kohei at kemper.freedesktop.org
Mon Feb 28 08:08:31 PST 2011


 svl/inc/svl/zformat.hxx        |   54 +++++++++++++++-------------
 svl/qa/unit/svl.cxx            |   13 +++++-
 svl/source/numbers/zformat.cxx |   79 +++++++++++++++++++++--------------------
 3 files changed, 81 insertions(+), 65 deletions(-)

New commits:
commit 8bee4844e600720e9ee0b66bf229991a22243211
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Mon Feb 28 11:07:24 2011 -0500

    Disable this temporarily due to the objection from Thai users.

diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 1d65a0a..e44af29 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -1114,6 +1114,8 @@ sal_Unicode toUniChar(sal_uInt8 n)
 OUString SvNumberformat::LocaleType::generateCode() const
 {
     OUStringBuffer aBuf;
+#if 0
+    // TODO: We may re-enable this later. Don't remove it! --Kohei
     if (mnNumeralShape)
     {
         sal_uInt8 nVal = mnNumeralShape;
@@ -1135,6 +1137,7 @@ OUString SvNumberformat::LocaleType::generateCode() const
             nVal = nVal << 4;
         }
     }
+#endif
 
     sal_uInt16 n16 = static_cast<sal_uInt16>(meLanguage);
     for (sal_uInt8 i = 0; i < 4; ++i)
commit 6dc20c90d43f7cfa0205313ac8834c946dfe13a3
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Mon Feb 28 10:27:31 2011 -0500

    More test cases for Thai-specific format codes.

diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx
index f075924..1a2959f 100644
--- a/svl/qa/unit/svl.cxx
+++ b/svl/qa/unit/svl.cxx
@@ -265,17 +265,26 @@ void Test::testNumberFormat()
     short nType = NUMBERFORMAT_DEFINED;
     sal_uInt32 nKey;
     OUString aCode;
-    aCode = OUString(RTL_CONSTASCII_USTRINGPARAM("[$-1070000]d/mm/yyyy;@")); // Thai date format (implicit locale).
+    // Thai date format (implicit locale).
+    aCode = OUString(RTL_CONSTASCII_USTRINGPARAM("[$-1070000]d/mm/yyyy;@"));
     if (!aFormatter.PutEntry(aCode, nPos, nType, nKey))
     {
         CPPUNIT_ASSERT_MESSAGE("failed to insert format code '[$-1070000]d/mm/yyyy;@'", false);
     }
 
-    aCode = OUString(RTL_CONSTASCII_USTRINGPARAM("[$-107041E]d/mm/yyyy;@")); // Thai date format (explicit locale)
+    // Thai date format (explicit locale)
+    aCode = OUString(RTL_CONSTASCII_USTRINGPARAM("[$-107041E]d/mm/yyyy;@"));
     if (!aFormatter.PutEntry(aCode, nPos, nType, nKey))
     {
         CPPUNIT_ASSERT_MESSAGE("failed to insert format code '[$-107041E]d/mm/yyyy;@'", false);
     }
+
+    // Thai date format (using buddhist calendar type).
+    aCode = OUString(RTL_CONSTASCII_USTRINGPARAM("[~buddhist]D MMMM YYYY"));
+    if (!aFormatter.PutEntry(aCode, nPos, nType, nKey))
+    {
+        CPPUNIT_ASSERT_MESSAGE("failed to insert format code '[~buddhist]D MMMM YYYY'", false);
+    }
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
commit 3a649b1e600ca4034fa9ec8cd040e5615621bf14
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Fri Feb 25 16:46:17 2011 -0500

    Renamed GetnAnz() to GetCount(), to make it easier for us to understand.

diff --git a/svl/inc/svl/zformat.hxx b/svl/inc/svl/zformat.hxx
index 3866ba5..dd91ceb 100644
--- a/svl/inc/svl/zformat.hxx
+++ b/svl/inc/svl/zformat.hxx
@@ -145,7 +145,7 @@ public:
     const ImpSvNumberformatInfo& Info() const { return aI; }
 
     // Get count of substrings (symbols)
-    USHORT GetnAnz() const { return nAnzStrings;}
+    USHORT GetCount() const { return nAnzStrings;}
 
     Color* GetColor() const { return pColor; }
     void SetColor( Color* pCol, String& rName )
@@ -263,7 +263,7 @@ public:
     // True if 4th subformat present
     BOOL HasTextFormat() const
         {
-            return (NumFor[3].GetnAnz() > 0) ||
+            return (NumFor[3].GetCount() > 0) ||
                 (NumFor[3].Info().eScannedType == NUMBERFORMAT_TEXT);
         }
 
@@ -311,7 +311,7 @@ public:
                 // strings of the format were matched and not just the starting
                 // sequence, so we don't have to check if GetnAnz() includes
                 // [modifiers] or anything else if both counts are equal.
-                USHORT nCnt = NumFor[nNumFor].GetnAnz();
+                USHORT nCnt = NumFor[nNumFor].GetCount();
                 if ( nAllCount == nCnt )
                     return TRUE;
                 if ( nAllCount < nCnt ) // check ignoring [modifiers] and so on
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 911b511..1d65a0a 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -949,7 +949,7 @@ SvNumberformat::SvNumberformat(String& rString,
 
     if ( bCondition && !nCheckPos )
     {
-        if ( nIndex == 1 && NumFor[0].GetnAnz() == 0 &&
+        if ( nIndex == 1 && NumFor[0].GetCount() == 0 &&
                 rString.GetChar(rString.Len()-1) != ';' )
         {   // No format code => GENERAL   but not if specified empty
             String aAdd( pSc->GetStandardName() );
@@ -965,9 +965,9 @@ SvNumberformat::SvNumberformat(String& rString,
                 }
             }
         }
-        else if ( nIndex == 1 && NumFor[nIndex].GetnAnz() == 0 &&
+        else if ( nIndex == 1 && NumFor[nIndex].GetCount() == 0 &&
                 rString.GetChar(rString.Len()-1) != ';' &&
-                (NumFor[0].GetnAnz() > 1 || (NumFor[0].GetnAnz() == 1 &&
+                (NumFor[0].GetCount() > 1 || (NumFor[0].GetCount() == 1 &&
                 NumFor[0].Info().nTypeArray[0] != NF_KEY_GENERAL)) )
         {   // No trailing second subformat => GENERAL   but not if specified empty
             // and not if first subformat is GENERAL
@@ -985,7 +985,7 @@ SvNumberformat::SvNumberformat(String& rString,
                 }
             }
         }
-        else if ( nIndex == 2 && NumFor[nIndex].GetnAnz() == 0 &&
+        else if ( nIndex == 2 && NumFor[nIndex].GetCount() == 0 &&
                 rString.GetChar(rString.Len()-1) != ';' &&
                 eOp2 != NUMBERFORMAT_OP_NO )
         {   // No trailing third subformat => GENERAL   but not if specified empty
@@ -1010,7 +1010,7 @@ SvNumberformat::SvNumberformat(String& rString,
         SetComment( aComment );     // setzt sComment und sFormatstring
         rString = sFormatstring;    // geaenderten sFormatstring uebernehmen
     }
-    if (NumFor[2].GetnAnz() == 0 &&                 // kein 3. Teilstring
+    if (NumFor[2].GetCount() == 0 &&                 // kein 3. Teilstring
         eOp1 == NUMBERFORMAT_OP_GT && eOp2 == NUMBERFORMAT_OP_NO &&
         fLimit1 == 0.0 && fLimit2 == 0.0)
         eOp1 = NUMBERFORMAT_OP_GE;                  // 0 zum ersten Format dazu
@@ -1945,7 +1945,7 @@ BOOL SvNumberformat::GetOutputString(String& sString,
     USHORT nIx;
     if (eType & NUMBERFORMAT_TEXT)
         nIx = 0;
-    else if (NumFor[3].GetnAnz() > 0)
+    else if (NumFor[3].GetCount() > 0)
         nIx = 3;
     else
     {
@@ -1957,7 +1957,7 @@ BOOL SvNumberformat::GetOutputString(String& sString,
     if (rInfo.eScannedType == NUMBERFORMAT_TEXT)
     {
         BOOL bRes = FALSE;
-        const USHORT nAnz = NumFor[nIx].GetnAnz();
+        const USHORT nAnz = NumFor[nIx].GetCount();
         for (USHORT i = 0; i < nAnz; i++)
         {
             switch (rInfo.nTypeArray[i])
@@ -2217,7 +2217,7 @@ BOOL SvNumberformat::GetOutputString(double fNumber,
             fNumber = -fNumber;                 // Vorzeichen eliminieren
         *ppColor = NumFor[nIx].GetColor();
         const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info();
-        const USHORT nAnz = NumFor[nIx].GetnAnz();
+        const USHORT nAnz = NumFor[nIx].GetCount();
         if (nAnz == 0 && rInfo.eScannedType == NUMBERFORMAT_UNDEFINED)
             return FALSE;                       // leer => nichts
         else if (nAnz == 0)                     // sonst Standard-Format
@@ -2758,7 +2758,7 @@ BOOL SvNumberformat::ImpGetTimeOutput(double fNumber,
                 nHour -= 12;
         }
     }
-    const USHORT nAnz = NumFor[nIx].GetnAnz();
+    const USHORT nAnz = NumFor[nIx].GetCount();
     for (USHORT i = 0; i < nAnz; i++)
     {
         switch (rInfo.nTypeArray[i])
@@ -2852,7 +2852,7 @@ BOOL SvNumberformat::ImpIsOtherCalendar( const ImpSvNumFor& rNumFor ) const
     if ( GetCal().getUniqueID() != Gregorian::get() )
         return FALSE;
     const ImpSvNumberformatInfo& rInfo = rNumFor.Info();
-    const USHORT nAnz = rNumFor.GetnAnz();
+    const USHORT nAnz = rNumFor.GetCount();
     USHORT i;
     for ( i = 0; i < nAnz; i++ )
     {
@@ -2945,7 +2945,7 @@ BOOL SvNumberformat::ImpSwitchToSpecifiedCalendar( String& rOrgCalendar,
         double& fOrgDateTime, const ImpSvNumFor& rNumFor ) const
 {
     const ImpSvNumberformatInfo& rInfo = rNumFor.Info();
-    const USHORT nAnz = rNumFor.GetnAnz();
+    const USHORT nAnz = rNumFor.GetCount();
     for ( USHORT i = 0; i < nAnz; i++ )
     {
         if ( rInfo.nTypeArray[i] == NF_SYMBOLTYPE_CALENDAR )
@@ -3006,7 +3006,7 @@ BOOL SvNumberformat::ImpGetDateOutput(double fNumber,
     if ( ImpFallBackToGregorianCalendar( aOrgCalendar, fOrgDateTime ) )
         bOtherCalendar = FALSE;
     const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info();
-    const USHORT nAnz = NumFor[nIx].GetnAnz();
+    const USHORT nAnz = NumFor[nIx].GetCount();
     sal_Int16 nNatNum = NumFor[nIx].GetNatNum().GetNatNum();
     for (USHORT i = 0; i < nAnz; i++)
     {
@@ -3280,7 +3280,7 @@ BOOL SvNumberformat::ImpGetDateTimeOutput(double fNumber,
                 nHour -= 12;
         }
     }
-    const USHORT nAnz = NumFor[nIx].GetnAnz();
+    const USHORT nAnz = NumFor[nIx].GetCount();
     for (USHORT i = 0; i < nAnz; i++)
     {
         switch (rInfo.nTypeArray[i])
@@ -3586,7 +3586,7 @@ BOOL SvNumberformat::ImpGetNumberOutput(double fNumber,
                                         // von hinten nach vorn
                                         // editieren:
     k = sStr.Len();                     // hinter letzter Ziffer
-    j = NumFor[nIx].GetnAnz()-1;        // letztes Symbol
+    j = NumFor[nIx].GetCount()-1;        // letztes Symbol
                                         // Nachkommastellen:
     if (rInfo.nCntPost > 0)
     {
@@ -3740,7 +3740,7 @@ BOOL SvNumberformat::ImpNumberFillWithThousands(
                 // no other digit symbol follows (which was already detected
                 // during scan of format code, otherwise there would be no
                 // division), else do insert. Same in ImpNumberFill() below.
-                if ( !bDoThousands && j < NumFor[nIx].GetnAnz()-1 )
+                if ( !bDoThousands && j < NumFor[nIx].GetCount()-1 )
                     bDoThousands = ((j == 0) ||
                             (rInfo.nTypeArray[j-1] != NF_SYMBOLTYPE_DIGIT &&
                              rInfo.nTypeArray[j-1] != NF_SYMBOLTYPE_THSEP) ||
@@ -3899,7 +3899,7 @@ BOOL SvNumberformat::ImpNumberFill( String& sStr,       // number string
                 // if divided and regex [0#,],[^0#] and no other digit symbol
                 // follows (which was already detected during scan of format
                 // code, otherwise there would be no division), else do insert.
-                if ( !bDoThousands && j < NumFor[nIx].GetnAnz()-1 )
+                if ( !bDoThousands && j < NumFor[nIx].GetCount()-1 )
                     bDoThousands = ((j == 0) ||
                             (rInfo.nTypeArray[j-1] != NF_SYMBOLTYPE_DIGIT &&
                              rInfo.nTypeArray[j-1] != NF_SYMBOLTYPE_THSEP) ||
@@ -3997,7 +3997,7 @@ void SvNumberformat::GetNumForInfo( USHORT nNumFor, short& rScannedType,
         nAnzLeading = 0;
         BOOL bStop = FALSE;
         USHORT i = 0;
-        const USHORT nAnz = NumFor[nNumFor].GetnAnz();
+        const USHORT nAnz = NumFor[nNumFor].GetCount();
         while (!bStop && i < nAnz)
         {
             short nType = rInfo.nTypeArray[i];
@@ -4021,7 +4021,7 @@ const String* SvNumberformat::GetNumForString( USHORT nNumFor, USHORT nPos,
 {
     if ( nNumFor > 3 )
         return NULL;
-    USHORT nAnz = NumFor[nNumFor].GetnAnz();
+    USHORT nAnz = NumFor[nNumFor].GetCount();
     if ( !nAnz )
         return NULL;
     if ( nPos == 0xFFFF )
@@ -4063,7 +4063,7 @@ short SvNumberformat::GetNumForType( USHORT nNumFor, USHORT nPos,
 {
     if ( nNumFor > 3 )
         return 0;
-    USHORT nAnz = NumFor[nNumFor].GetnAnz();
+    USHORT nAnz = NumFor[nNumFor].GetCount();
     if ( !nAnz )
         return 0;
     if ( nPos == 0xFFFF )
@@ -4115,7 +4115,7 @@ DateFormat SvNumberformat::GetDateOrder() const
     if ( (eType & NUMBERFORMAT_DATE) == NUMBERFORMAT_DATE )
     {
         short const * const pType = NumFor[0].Info().nTypeArray;
-        USHORT nAnz = NumFor[0].GetnAnz();
+        USHORT nAnz = NumFor[0].GetCount();
         for ( USHORT j=0; j<nAnz; j++ )
         {
             switch ( pType[j] )
@@ -4155,7 +4155,7 @@ sal_uInt32 SvNumberformat::GetExactDateOrder() const
         return nRet;
     }
     short const * const pType = NumFor[0].Info().nTypeArray;
-    USHORT nAnz = NumFor[0].GetnAnz();
+    USHORT nAnz = NumFor[0].GetCount();
     int nShift = 0;
     for ( USHORT j=0; j<nAnz && nShift < 3; j++ )
     {
@@ -4248,9 +4248,9 @@ String SvNumberformat::GetMappedFormatstring(
     String aStr;
     BOOL bDefault[4];
     // 1 subformat matches all if no condition specified,
-    bDefault[0] = ( NumFor[1].GetnAnz() == 0 && eOp1 == NUMBERFORMAT_OP_NO );
+    bDefault[0] = ( NumFor[1].GetCount() == 0 && eOp1 == NUMBERFORMAT_OP_NO );
     // with 2 subformats [>=0];[<0] is implied if no condition specified
-    bDefault[1] = ( !bDefault[0] && NumFor[2].GetnAnz() == 0 &&
+    bDefault[1] = ( !bDefault[0] && NumFor[2].GetCount() == 0 &&
         eOp1 == NUMBERFORMAT_OP_GE && fLimit1 == 0.0 &&
         eOp2 == NUMBERFORMAT_OP_NO && fLimit2 == 0.0 );
     // with 3 or more subformats [>0];[<0];[=0] is implied if no condition specified,
@@ -4266,7 +4266,7 @@ String SvNumberformat::GetMappedFormatstring(
         if ( eOp1 != NUMBERFORMAT_OP_NO && eOp2 == NUMBERFORMAT_OP_NO )
             bDefault[0] = bDefault[1] = TRUE;                               // [];x
         else if ( eOp1 != NUMBERFORMAT_OP_NO && eOp2 != NUMBERFORMAT_OP_NO &&
-                NumFor[2].GetnAnz() == 0 )
+                NumFor[2].GetCount() == 0 )
             bDefault[0] = bDefault[1] = bDefault[2] = bDefault[3] = TRUE;   // [];[];;
         // nothing to do if conditions specified for every subformat
     }
@@ -4274,7 +4274,7 @@ String SvNumberformat::GetMappedFormatstring(
         bDefault[0] = FALSE;    // a single unconditional subformat is never delimited
     else
     {
-        if ( bDefault[2] && NumFor[2].GetnAnz() == 0 && NumFor[1].GetnAnz() > 0 )
+        if ( bDefault[2] && NumFor[2].GetCount() == 0 && NumFor[1].GetCount() > 0 )
             bDefault[3] = TRUE;     // special cases x;x;; and ;x;;
         for ( int i=0; i<3 && !bDefault[i]; ++i )
             bDefault[i] = TRUE;
@@ -4329,7 +4329,7 @@ String SvNumberformat::GetMappedFormatstring(
             aPrefix += 't';     // must be lowercase, otherwise taken as literal
         }
 
-        USHORT nAnz = NumFor[n].GetnAnz();
+        USHORT nAnz = NumFor[n].GetCount();
         if ( nSem && (nAnz || aPrefix.Len()) )
         {
             for ( ; nSem; --nSem )
@@ -4639,7 +4639,7 @@ xub_StrLen SvNumberformat::GetQuoteEnd( const String& rStr, xub_StrLen nPos,
 USHORT SvNumberformat::ImpGetNumForStringElementCount( USHORT nNumFor ) const
 {
     USHORT nCnt = 0;
-    USHORT nAnz = NumFor[nNumFor].GetnAnz();
+    USHORT nAnz = NumFor[nNumFor].GetCount();
     short const * const pType = NumFor[nNumFor].Info().nTypeArray;
     for ( USHORT j=0; j<nAnz; ++j )
     {
commit 6ee742a43baa0caccee68840a99bda92e77ccfee
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Fri Feb 25 13:07:15 2011 -0500

    Store locale type instead of language type.

diff --git a/svl/inc/svl/zformat.hxx b/svl/inc/svl/zformat.hxx
index 67296b7..3866ba5 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 2641285..911b511 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++ )
         {
commit f2c3c7179a131b6045eda2b0460dabdc255b42c1
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Fri Feb 25 11:46:37 2011 -0500

    Updated method documentation.

diff --git a/svl/inc/svl/zformat.hxx b/svl/inc/svl/zformat.hxx
index fb14f87..67296b7 100644
--- a/svl/inc/svl/zformat.hxx
+++ b/svl/inc/svl/zformat.hxx
@@ -502,14 +502,18 @@ private:
     };
 
     /**
-     * Parse the content of '[$-xxx] or '[$-xxxxxxxx]' and extract the
-     * language type from it.  Given the string, start parsing at position
-     * specified by nPos, and store the end position with nPos when the
-     * parsing is complete.  The nPos should point to the '$' before the
-     * parsing, and to the closing bracket after the parsing.  When the
-     * content is [$-xxx], the xxx part represents the language type (aka
-     * LCID) in hex numerals.  When the content is [$-xxxxxxxx] the last 4
-     * digits is the LCID (again in hex).
+     * Parse the content of '[$-xxx] or '[$-xxxxxxxx]' and extract the locale
+     * type from it.  Given the string, start parsing at position specified by
+     * nPos, and store the end position with nPos when the parsing is
+     * complete.  The nPos should point to the '$' before the parsing, and to
+     * the closing bracket after the parsing.  When the content is [$-xxx],
+     * the xxx part represents the language type (aka LCID) in hex numerals.
+     * When the content is [$-xxxxxxxx] the last 4 digits represent the LCID
+     * (again in hex), the next 2 digits represent the calendar type, and the
+     * 2 highest digits (if exists) is the numeral shape.
+     *
+     * @reference
+     * http://office.microsoft.com/en-us/excel-help/creating-international-number-formats-HA001034635.aspx
      *
      * @param rString input string
      * @param nPos position (see above).


More information about the Libreoffice-commits mailing list