View | Details | Raw Unified | Return to issue 93503
Collapse All | Expand All

(-)a/svl/source/numbers/zformat.cxx (-9 / +39 lines)
Lines 1134-1140 Link Here
1134
            return LANGUAGE_DONTKNOW;
1134
            return LANGUAGE_DONTKNOW;
1135
        ++nPos;
1135
        ++nPos;
1136
    }
1136
    }
1137
    return (nNum && (cToken == ']' || nPos == nLen)) ? (LanguageType)nNum :
1137
    return ((cToken == ']' || nPos == nLen)) ? (LanguageType)nNum :
1138
        LANGUAGE_DONTKNOW;
1138
        LANGUAGE_DONTKNOW;
1139
}
1139
}
1140
1140
Lines 1220-1225 Link Here
1220
                    {
1220
                    {
1221
                        if ( rString.GetChar(nPos) == '-' )
1221
                        if ( rString.GetChar(nPos) == '-' )
1222
                        {   // [$-xxx] locale
1222
                        {   // [$-xxx] locale
1223
                            if ( rString.GetChar(nPos+2) == '0' && rString.GetChar(nPos+3) == '7' ) // calendar type code "07" = Thai
1224
                            {
1225
                              rString.InsertAscii( "[~buddhist]", nPos+9 );
1226
                              nLen += 11;
1227
                            }
1228
                            if ( rString.GetChar(nPos+1) == 'D' ) // numeral shape code "D" = Thai digits
1229
                            {
1230
                              rString.InsertAscii( "[NatNum1]", nPos+9 );
1231
                              nLen += 9;
1232
                            }
1223
                            sSymbol.EraseAllChars('[');
1233
                            sSymbol.EraseAllChars('[');
1224
                            eSymbolType = BRACKET_SYMBOLTYPE_LOCALE;
1234
                            eSymbolType = BRACKET_SYMBOLTYPE_LOCALE;
1225
                            eState = SsGetPrefix;
1235
                            eState = SsGetPrefix;
Lines 4211-4216 Link Here
4211
            nSem++;
4221
            nSem++;
4212
4222
4213
        String aPrefix;
4223
        String aPrefix;
4224
        bool LCIDInserted = FALSE;
4214
4225
4215
        if ( !bDefaults )
4226
        if ( !bDefaults )
4216
        {
4227
        {
Lines 4244-4257 Link Here
4244
        }
4255
        }
4245
4256
4246
        const SvNumberNatNum& rNum = NumFor[n].GetNatNum();
4257
        const SvNumberNatNum& rNum = NumFor[n].GetNatNum();
4247
        // The Thai T NatNum modifier during Xcl export.
4248
        if (rNum.IsSet() && rNum.GetNatNum() == 1 &&
4249
                rKeywords[NF_KEY_THAI_T].EqualsAscii( "T") &&
4250
                MsLangId::getRealLanguage( rNum.GetLang()) ==
4251
                LANGUAGE_THAI)
4252
        {
4253
            aPrefix += 't';     // must be lowercase, otherwise taken as literal
4254
        }
4255
4258
4256
        USHORT nAnz = NumFor[n].GetnAnz();
4259
        USHORT nAnz = NumFor[n].GetnAnz();
4257
        if ( nSem && (nAnz || aPrefix.Len()) )
4260
        if ( nSem && (nAnz || aPrefix.Len()) )
Lines 4311-4316 Link Here
4311
                                aStr += '"';
4314
                                aStr += '"';
4312
                            }
4315
                            }
4313
                            break;
4316
                            break;
4317
                        case NF_SYMBOLTYPE_CALDEL :
4318
                            if ( pStr[j+1].EqualsAscii("buddhist") )
4319
                            {
4320
                                aStr.InsertAscii( "[$-", aStr.Len() );
4321
                                if ( rNum.IsSet() && rNum.GetNatNum() == 1 &&
4322
                                        MsLangId::getRealLanguage( rNum.GetLang() ) ==
4323
                                        LANGUAGE_THAI )
4324
                                {
4325
                                    aStr.InsertAscii( "D07041E]", aStr.Len() ); // date in Thai digit, Buddhist era
4326
                                }
4327
                                else
4328
                                {
4329
                                    aStr.InsertAscii( "107041E]", aStr.Len() ); // date in Arabic digit, Buddhist era
4330
                                }
4331
                                j = j+2;
4332
                            }
4333
                            LCIDInserted = TRUE;
4334
                        break;
4314
                        default:
4335
                        default:
4315
                            aStr += pStr[j];
4336
                            aStr += pStr[j];
4316
                    }
4337
                    }
Lines 4318-4323 Link Here
4318
                }
4339
                }
4319
            }
4340
            }
4320
        }
4341
        }
4342
        // The Thai T NatNum modifier during Xcl export.
4343
        if (rNum.IsSet() && rNum.GetNatNum() == 1 &&
4344
                rKeywords[NF_KEY_THAI_T].EqualsAscii( "T") &&
4345
                MsLangId::getRealLanguage( rNum.GetLang()) ==
4346
                LANGUAGE_THAI && !LCIDInserted )
4347
        {
4348
            
4349
            aStr.InsertAscii( "[$-D00041E]", 0 ); // number in Thai digit
4350
        }
4321
    }
4351
    }
4322
    for ( ; nSub<4 && bDefault[nSub]; ++nSub )
4352
    for ( ; nSub<4 && bDefault[nSub]; ++nSub )
4323
    {   // append empty subformats
4353
    {   // append empty subformats

Return to issue 93503