LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/sc/source/filter/oox - numberformatsbuffer.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 128 141 90.8 %
Date: 2013-07-09 Functions: 24 26 92.3 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include "numberformatsbuffer.hxx"
      21             : 
      22             : #include <com/sun/star/container/XNameAccess.hpp>
      23             : #include <com/sun/star/i18n/NumberFormatIndex.hpp>
      24             : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
      25             : #include <com/sun/star/util/XNumberFormatTypes.hpp>
      26             : #include <com/sun/star/util/XNumberFormats.hpp>
      27             : #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
      28             : #include <officecfg/Setup.hxx>
      29             : #include <officecfg/System.hxx>
      30             : #include <rtl/strbuf.hxx>
      31             : #include <rtl/string.hxx>
      32             : #include <osl/thread.h>
      33             : #include <rtl/ustrbuf.hxx>
      34             : #include <svl/intitem.hxx>
      35             : #include "oox/core/filterbase.hxx"
      36             : #include "oox/helper/attributelist.hxx"
      37             : #include "oox/helper/propertymap.hxx"
      38             : #include "biffinputstream.hxx"
      39             : #include "scitems.hxx"
      40             : #include "document.hxx"
      41             : #include "ftools.hxx"
      42             : 
      43             : namespace oox {
      44             : namespace xls {
      45             : 
      46             : // ============================================================================
      47             : 
      48             : using namespace ::com::sun::star::container;
      49             : using namespace ::com::sun::star::lang;
      50             : using namespace ::com::sun::star::uno;
      51             : using namespace ::com::sun::star::util;
      52             : 
      53             : 
      54             : // ============================================================================
      55             : 
      56             : namespace {
      57             : 
      58             : /** Stores the number format used in Calc for an Excel built-in number format. */
      59             : struct BuiltinFormat
      60             : {
      61             :     sal_Int32           mnNumFmtId;         /// Built-in number format index.
      62             :     const sal_Char*     mpcFmtCode;         /// Format string, UTF-8, may be 0 (mnPredefId is used then).
      63             :     sal_Int16           mnPredefId;         /// Predefined format index, if mpcFmtCode is 0.
      64             :     sal_Int32           mnReuseId;          /// Use this format, if mpcFmtCode is 0 and mnPredefId is -1.
      65             : };
      66             : 
      67             : /** Defines a literal built-in number format. */
      68             : #define NUMFMT_STRING( INDEX, FORMATCODE ) \
      69             :     { INDEX, FORMATCODE, -1, -1 }
      70             : 
      71             : /** Defines a built-in number format that maps to an own predefined format. */
      72             : #define NUMFMT_PREDEF( INDEX, PREDEFINED ) \
      73             :     { INDEX, 0, ::com::sun::star::i18n::NumberFormatIndex::PREDEFINED, -1 }
      74             : 
      75             : /** Defines a built-in number format that is the same as the specified in nReuseId. */
      76             : #define NUMFMT_REUSE( INDEX, REUSED_INDEX ) \
      77             :     { INDEX, 0, -1, REUSED_INDEX }
      78             : 
      79             : /** Terminates a built-in number format table. */
      80             : #define NUMFMT_ENDTABLE() \
      81             :     { -1, 0, -1, -1 }
      82             : 
      83             : /** Defines builtin date and time formats 14...22.
      84             :     @param SYSTEMDATE  Complete short system date (for formats 14 and 22).
      85             :     @param DAY  Day format (for formats 15 and 16).
      86             :     @param DAYSEP  Separator between day and month (for formats 15 and 16).
      87             :     @param MONTH  Month format (for formats 15...17).
      88             :     @param MONTHSEP  Separator between month and year (for formats 15 and 17).
      89             :     @param YEAR  Year format (for formats 15 and 17).
      90             :     @param HOUR12  Hour format for 12-hour AM/PM formats (formats 18 and 19).
      91             :     @param HOUR24  Hour format for 24-hour formats (formats 20...22). */
      92             : #define NUMFMT_ALLDATETIMES( SYSTEMDATE, DAY, DAYSEP, MONTH, MONTHSEP, YEAR, HOUR12, HOUR24 ) \
      93             :     NUMFMT_STRING(  14, SYSTEMDATE ), \
      94             :     NUMFMT_STRING(  15, DAY DAYSEP MONTH MONTHSEP YEAR ), \
      95             :     NUMFMT_STRING(  16, DAY DAYSEP MONTH ), \
      96             :     NUMFMT_STRING(  17, MONTH MONTHSEP YEAR ), \
      97             :     NUMFMT_STRING(  18, HOUR12 ":mm AM/PM" ), \
      98             :     NUMFMT_STRING(  19, HOUR12 ":mm:ss AM/PM" ), \
      99             :     NUMFMT_STRING(  20, HOUR24 ":mm" ), \
     100             :     NUMFMT_STRING(  21, HOUR24 ":mm:ss" ), \
     101             :     NUMFMT_STRING(  22, SYSTEMDATE " " HOUR24 ":mm" )
     102             : 
     103             : /** Defines builtin time formats INDEX and INDEX+1 for CJK locales.
     104             :     @param INDEX  First number format index.
     105             :     @param HOURFORMAT  Hour format.
     106             :     @param HOUR  Hour symbol.
     107             :     @param MINUTE  Minute symbol.
     108             :     @param SECOND  Second symbol. */
     109             : #define NUMFMT_TIME_CJK( INDEX, HOURFORMAT, HOUR, MINUTE, SECOND ) \
     110             :     NUMFMT_STRING( INDEX + 0, HOURFORMAT "\"" HOUR "\"mm\"" MINUTE "\"" ), \
     111             :     NUMFMT_STRING( INDEX + 1, HOURFORMAT "\"" HOUR "\"mm\"" MINUTE "\"ss\"" SECOND "\"" )
     112             : 
     113             : /** Defines builtin time formats 32...35 for CJK locales.
     114             :     @param HOUR12  Hour format for 12-hour AM/PM formats (formats 34 and 35).
     115             :     @param HOUR24  Hour format for 24-hour formats (formats 32 and 33).
     116             :     @param HOUR  Hour symbol.
     117             :     @param MINUTE  Minute symbol.
     118             :     @param SECOND  Second symbol. */
     119             : #define NUMFMT_ALLTIMES_CJK( HOUR12, HOUR24, HOUR, MINUTE, SECOND ) \
     120             :     NUMFMT_TIME_CJK( 32, HOUR24, HOUR, MINUTE, SECOND ), \
     121             :     NUMFMT_TIME_CJK( 34, "AM/PM" HOUR12, HOUR, MINUTE, SECOND )
     122             : 
     123             : /** Defines builtin currency formats INDEX...INDEX+3 in the following format:
     124             :     "symbol, [minus], number".
     125             :     @param INDEX  First number format index.
     126             :     @param SYMBOL  Currency symbol.
     127             :     @param SPACE  Space character(s) between currency symbol and number.
     128             :     @param MODIF  Leading modifier for each portion (e.g. "t" for Thai formats). */
     129             : #define NUMFMT_CURRENCY_SYMBOL_MINUS_NUMBER( INDEX, SYMBOL, SPACE, MODIF ) \
     130             :     NUMFMT_STRING( INDEX + 0, MODIF SYMBOL SPACE "#,##0;"            MODIF SYMBOL SPACE "-#,##0" ), \
     131             :     NUMFMT_STRING( INDEX + 1, MODIF SYMBOL SPACE "#,##0;"    "[RED]" MODIF SYMBOL SPACE "-#,##0" ), \
     132             :     NUMFMT_STRING( INDEX + 2, MODIF SYMBOL SPACE "#,##0.00;"         MODIF SYMBOL SPACE "-#,##0.00" ), \
     133             :     NUMFMT_STRING( INDEX + 3, MODIF SYMBOL SPACE "#,##0.00;" "[RED]" MODIF SYMBOL SPACE "-#,##0.00" )
     134             : 
     135             : /** Defines builtin accounting formats INDEX...INDEX+3 in the following format:
     136             :     "symbol, [minus], number".
     137             :     @param INDEX  First number format index.
     138             :     @param SYMBOL  Currency symbol.
     139             :     @param SPACE  Space character(s) between currency symbol and number. */
     140             : #define NUMFMT_ACCOUNTING_SYMBOL_MINUS_NUMBER( INDEX, SYMBOL, SPACE ) \
     141             :     NUMFMT_STRING( INDEX + 0, "_ "              "* #,##0_ ;"    "_ "              "* -#,##0_ ;"    "_ "              "* \"-\"_ ;"    "_ @_ " ), \
     142             :     NUMFMT_STRING( INDEX + 1, "_ " SYMBOL SPACE "* #,##0_ ;"    "_ " SYMBOL SPACE "* -#,##0_ ;"    "_ " SYMBOL SPACE "* \"-\"_ ;"    "_ @_ " ), \
     143             :     NUMFMT_STRING( INDEX + 2, "_ "              "* #,##0.00_ ;" "_ "              "* -#,##0.00_ ;" "_ "              "* \"-\"?\?_ ;" "_ @_ " ), \
     144             :     NUMFMT_STRING( INDEX + 3, "_ " SYMBOL SPACE "* #,##0.00_ ;" "_ " SYMBOL SPACE "* -#,##0.00_ ;" "_ " SYMBOL SPACE "* \"-\"?\?_ ;" "_ @_ " )
     145             : 
     146             : /** Defines builtin currency formats 5...8 (with currency symbol), 37...40
     147             :     (blind currency symbol), and 41...44 (accounting), in the following format:
     148             :     "symbol, [minus], number".
     149             :     @param SYMBOL  Currency symbol.
     150             :     @param SPACE  Space character(s) between currency symbol and number. */
     151             : #define NUMFMT_ALLCURRENCIES_SYMBOL_MINUS_NUMBER( SYMBOL, SPACE ) \
     152             :     NUMFMT_CURRENCY_SYMBOL_MINUS_NUMBER( 5, SYMBOL, SPACE, "" ), \
     153             :     NUMFMT_CURRENCY_SYMBOL_MINUS_NUMBER( 37, "", "", "" ), \
     154             :     NUMFMT_ACCOUNTING_SYMBOL_MINUS_NUMBER( 41, SYMBOL, SPACE )
     155             : 
     156             : /** Defines builtin currency formats INDEX...INDEX+3 in the following format:
     157             :     "symbol, number, [minus]".
     158             :     @param INDEX  First number format index.
     159             :     @param SYMBOL  Currency symbol.
     160             :     @param SPACE  Space character(s) between currency symbol and number.
     161             :     @param MODIF  Leading modifier for each portion (e.g. "t" for Thai formats). */
     162             : #define NUMFMT_CURRENCY_SYMBOL_NUMBER_MINUS( INDEX, SYMBOL, SPACE, MODIF ) \
     163             :     NUMFMT_STRING( INDEX + 0, MODIF SYMBOL SPACE "#,##0_-;"            MODIF SYMBOL SPACE "#,##0-" ), \
     164             :     NUMFMT_STRING( INDEX + 1, MODIF SYMBOL SPACE "#,##0_-;"    "[RED]" MODIF SYMBOL SPACE "#,##0-" ), \
     165             :     NUMFMT_STRING( INDEX + 2, MODIF SYMBOL SPACE "#,##0.00_-;"         MODIF SYMBOL SPACE "#,##0.00-" ), \
     166             :     NUMFMT_STRING( INDEX + 3, MODIF SYMBOL SPACE "#,##0.00_-;" "[RED]" MODIF SYMBOL SPACE "#,##0.00-" )
     167             : 
     168             : /** Defines builtin accounting formats INDEX...INDEX+3 in the following format:
     169             :     "symbol, number, [minus]".
     170             :     @param INDEX  First number format index.
     171             :     @param SYMBOL  Currency symbol.
     172             :     @param SPACE  Space character(s) between currency symbol and number. */
     173             : #define NUMFMT_ACCOUNTING_SYMBOL_NUMBER_MINUS( INDEX, SYMBOL, SPACE ) \
     174             :     NUMFMT_STRING( INDEX + 0, "_-"              "* #,##0_-;"    "_-"              "* #,##0-;"    "_-"              "* \"-\"_-;"    "_-@_-" ), \
     175             :     NUMFMT_STRING( INDEX + 1, "_-" SYMBOL SPACE "* #,##0_-;"    "_-" SYMBOL SPACE "* #,##0-;"    "_-" SYMBOL SPACE "* \"-\"_-;"    "_-@_-" ), \
     176             :     NUMFMT_STRING( INDEX + 2, "_-"              "* #,##0.00_-;" "_-"              "* #,##0.00-;" "_-"              "* \"-\"?\?_-;" "_-@_-" ), \
     177             :     NUMFMT_STRING( INDEX + 3, "_-" SYMBOL SPACE "* #,##0.00_-;" "_-" SYMBOL SPACE "* #,##0.00-;" "_-" SYMBOL SPACE "* \"-\"?\?_-;" "_-@_-" )
     178             : 
     179             : /** Defines builtin currency formats 5...8 (with currency symbol), 37...40
     180             :     (blind currency symbol), and 41...44 (accounting), in the following format:
     181             :     "symbol, number, [minus]".
     182             :     @param SYMBOL  Currency symbol.
     183             :     @param SPACE  Space character(s) between currency symbol and number. */
     184             : #define NUMFMT_ALLCURRENCIES_SYMBOL_NUMBER_MINUS( SYMBOL, SPACE ) \
     185             :     NUMFMT_CURRENCY_SYMBOL_NUMBER_MINUS( 5, SYMBOL, SPACE, "" ), \
     186             :     NUMFMT_CURRENCY_SYMBOL_NUMBER_MINUS( 37, "", "", "" ), \
     187             :     NUMFMT_ACCOUNTING_SYMBOL_NUMBER_MINUS( 41, SYMBOL, SPACE )
     188             : 
     189             : /** Defines builtin currency formats INDEX...INDEX+3 in the following format:
     190             :     "number, symbol, [minus]".
     191             :     @param INDEX  First number format index.
     192             :     @param SYMBOL  Currency symbol.
     193             :     @param SPACE  Space character(s) between number and currency symbol.
     194             :     @param MODIF  Leading modifier for each portion (e.g. "t" for Thai formats). */
     195             : #define NUMFMT_CURRENCY_NUMBER_SYMBOL_MINUS( INDEX, SYMBOL, SPACE, MODIF ) \
     196             :     NUMFMT_STRING( INDEX + 0, MODIF "#,##0"    SPACE SYMBOL "_-;"         MODIF "#,##0"    SPACE SYMBOL "-" ), \
     197             :     NUMFMT_STRING( INDEX + 1, MODIF "#,##0"    SPACE SYMBOL "_-;" "[RED]" MODIF "#,##0"    SPACE SYMBOL "-" ), \
     198             :     NUMFMT_STRING( INDEX + 2, MODIF "#,##0.00" SPACE SYMBOL "_-;"         MODIF "#,##0.00" SPACE SYMBOL "-" ), \
     199             :     NUMFMT_STRING( INDEX + 3, MODIF "#,##0.00" SPACE SYMBOL "_-;" "[RED]" MODIF "#,##0.00" SPACE SYMBOL "-" )
     200             : 
     201             : /** Defines builtin accounting formats INDEX...INDEX+3 in the following format:
     202             :     "number, symbol, [minus]".
     203             :     @param INDEX  First number format index.
     204             :     @param SYMBOL  Currency symbol.
     205             :     @param BLINDS  Blind currency symbol.
     206             :     @param SPACE  Space character(s) between number and currency symbol. */
     207             : #define NUMFMT_ACCOUNTING_NUMBER_SYMBOL_MINUS( INDEX, SYMBOL, BLINDS, SPACE ) \
     208             :     NUMFMT_STRING( INDEX + 0, "_-* #,##0"    SPACE BLINDS "_-;_-* #,##0"    SPACE BLINDS "-;_-* \"-\""    SPACE BLINDS "_-;_-@_-" ), \
     209             :     NUMFMT_STRING( INDEX + 1, "_-* #,##0"    SPACE SYMBOL "_-;_-* #,##0"    SPACE SYMBOL "-;_-* \"-\""    SPACE SYMBOL "_-;_-@_-" ), \
     210             :     NUMFMT_STRING( INDEX + 2, "_-* #,##0.00" SPACE BLINDS "_-;_-* #,##0.00" SPACE BLINDS "-;_-* \"-\"?\?" SPACE BLINDS "_-;_-@_-" ), \
     211             :     NUMFMT_STRING( INDEX + 3, "_-* #,##0.00" SPACE SYMBOL "_-;_-* #,##0.00" SPACE SYMBOL "-;_-* \"-\"?\?" SPACE SYMBOL "_-;_-@_-" )
     212             : 
     213             : /** Defines builtin currency formats 5...8 (with currency symbol), 37...40
     214             :     (blind currency symbol), and 41...44 (accounting), in the following format:
     215             :     "number, symbol, [minus]".
     216             :     @param SYMBOL  Currency symbol.
     217             :     @param BLINDS  Blind currency symbol.
     218             :     @param SPACE  Space character(s) between number and currency symbol. */
     219             : #define NUMFMT_ALLCURRENCIES_NUMBER_SYMBOL_MINUS( SYMBOL, BLINDS, SPACE ) \
     220             :     NUMFMT_CURRENCY_NUMBER_SYMBOL_MINUS( 5, SYMBOL, SPACE, "" ), \
     221             :     NUMFMT_CURRENCY_NUMBER_SYMBOL_MINUS( 37, BLINDS, SPACE, "" ), \
     222             :     NUMFMT_ACCOUNTING_NUMBER_SYMBOL_MINUS( 41, SYMBOL, BLINDS, SPACE )
     223             : 
     224             : /** Defines builtin currency formats INDEX...INDEX+3 in the following format:
     225             :     "[minus], symbol, number".
     226             :     @param INDEX  First number format index.
     227             :     @param SYMBOL  Currency symbol.
     228             :     @param SPACE  Space character(s) between currency symbol and number.
     229             :     @param MODIF  Leading modifier for each portion (e.g. "t" for Thai formats). */
     230             : #define NUMFMT_CURRENCY_MINUS_SYMBOL_NUMBER( INDEX, SYMBOL, SPACE, MODIF ) \
     231             :     NUMFMT_STRING( INDEX + 0, MODIF SYMBOL SPACE "#,##0;"            MODIF "-" SYMBOL SPACE "#,##0" ), \
     232             :     NUMFMT_STRING( INDEX + 1, MODIF SYMBOL SPACE "#,##0;"    "[RED]" MODIF "-" SYMBOL SPACE "#,##0" ), \
     233             :     NUMFMT_STRING( INDEX + 2, MODIF SYMBOL SPACE "#,##0.00;"         MODIF "-" SYMBOL SPACE "#,##0.00" ), \
     234             :     NUMFMT_STRING( INDEX + 3, MODIF SYMBOL SPACE "#,##0.00;" "[RED]" MODIF "-" SYMBOL SPACE "#,##0.00" )
     235             : 
     236             : /** Defines builtin accounting formats INDEX...INDEX+3 in the following order:
     237             :     "[minus], symbol, number".
     238             :     @param INDEX  First number format index.
     239             :     @param SYMBOL  Currency symbol.
     240             :     @param SPACE  Space character(s) between currency symbol and number. */
     241             : #define NUMFMT_ACCOUNTING_MINUS_SYMBOL_NUMBER( INDEX, SYMBOL, SPACE ) \
     242             :     NUMFMT_STRING( INDEX + 0, "_-"              "* #,##0_-;"    "-"              "* #,##0_-;"    "_-"              "* \"-\"_-;"    "_-@_-" ), \
     243             :     NUMFMT_STRING( INDEX + 1, "_-" SYMBOL SPACE "* #,##0_-;"    "-" SYMBOL SPACE "* #,##0_-;"    "_-" SYMBOL SPACE "* \"-\"_-;"    "_-@_-" ), \
     244             :     NUMFMT_STRING( INDEX + 2, "_-"              "* #,##0.00_-;" "-"              "* #,##0.00_-;" "_-"              "* \"-\"?\?_-;" "_-@_-" ), \
     245             :     NUMFMT_STRING( INDEX + 3, "_-" SYMBOL SPACE "* #,##0.00_-;" "-" SYMBOL SPACE "* #,##0.00_-;" "_-" SYMBOL SPACE "* \"-\"?\?_-;" "_-@_-" )
     246             : 
     247             : /** Defines builtin currency formats 5...8 (with currency symbol), 37...40
     248             :     (blind currency symbol), and 41...44 (accounting), in the following order:
     249             :     "[minus], symbol, number".
     250             :     @param SYMBOL  Currency symbol.
     251             :     @param SPACE  Space character(s) between currency symbol and number. */
     252             : #define NUMFMT_ALLCURRENCIES_MINUS_SYMBOL_NUMBER( SYMBOL, SPACE ) \
     253             :     NUMFMT_CURRENCY_MINUS_SYMBOL_NUMBER( 5, SYMBOL, SPACE, "" ), \
     254             :     NUMFMT_CURRENCY_MINUS_SYMBOL_NUMBER( 37, "", "", "" ), \
     255             :     NUMFMT_ACCOUNTING_MINUS_SYMBOL_NUMBER( 41, SYMBOL, SPACE )
     256             : 
     257             : /** Defines builtin currency formats INDEX...INDEX+3 in the following format:
     258             :     "[minus], number, symbol".
     259             :     @param INDEX  First number format index.
     260             :     @param SYMBOL  Currency symbol.
     261             :     @param SPACE  Space character(s) between number and currency symbol.
     262             :     @param MODIF  Leading modifier for each portion (e.g. "t" for Thai formats). */
     263             : #define NUMFMT_CURRENCY_MINUS_NUMBER_SYMBOL( INDEX, SYMBOL, SPACE, MODIF ) \
     264             :     NUMFMT_STRING( INDEX + 0, MODIF "#,##0"    SPACE SYMBOL ";"         MODIF "-#,##0"    SPACE SYMBOL ), \
     265             :     NUMFMT_STRING( INDEX + 1, MODIF "#,##0"    SPACE SYMBOL ";" "[RED]" MODIF "-#,##0"    SPACE SYMBOL ), \
     266             :     NUMFMT_STRING( INDEX + 2, MODIF "#,##0.00" SPACE SYMBOL ";"         MODIF "-#,##0.00" SPACE SYMBOL ), \
     267             :     NUMFMT_STRING( INDEX + 3, MODIF "#,##0.00" SPACE SYMBOL ";" "[RED]" MODIF "-#,##0.00" SPACE SYMBOL )
     268             : 
     269             : /** Defines builtin accounting formats INDEX...INDEX+3 in the following format:
     270             :     "[minus], number, symbol".
     271             :     @param INDEX  First number format index.
     272             :     @param SYMBOL  Currency symbol.
     273             :     @param BLINDS  Blind currency symbol.
     274             :     @param SPACE  Space character(s) between number and currency symbol. */
     275             : #define NUMFMT_ACCOUNTING_MINUS_NUMBER_SYMBOL( INDEX, SYMBOL, BLINDS, SPACE ) \
     276             :     NUMFMT_STRING( INDEX + 0, "_-* #,##0"    SPACE BLINDS "_-;-* #,##0"    SPACE BLINDS "_-;_-* \"-\""    SPACE BLINDS "_-;_-@_-" ), \
     277             :     NUMFMT_STRING( INDEX + 1, "_-* #,##0"    SPACE SYMBOL "_-;-* #,##0"    SPACE SYMBOL "_-;_-* \"-\""    SPACE SYMBOL "_-;_-@_-" ), \
     278             :     NUMFMT_STRING( INDEX + 2, "_-* #,##0.00" SPACE BLINDS "_-;-* #,##0.00" SPACE BLINDS "_-;_-* \"-\"?\?" SPACE BLINDS "_-;_-@_-" ), \
     279             :     NUMFMT_STRING( INDEX + 3, "_-* #,##0.00" SPACE SYMBOL "_-;-* #,##0.00" SPACE SYMBOL "_-;_-* \"-\"?\?" SPACE SYMBOL "_-;_-@_-" )
     280             : 
     281             : /** Defines builtin currency formats 5...8 (with currency symbol), 37...40
     282             :     (blind currency symbol), and 41...44 (accounting), in the following format:
     283             :     "[minus], number, symbol".
     284             :     @param SYMBOL  Currency symbol.
     285             :     @param BLINDS  Blind currency symbol.
     286             :     @param SPACE  Space character(s) between number and currency symbol. */
     287             : #define NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( SYMBOL, BLINDS, SPACE ) \
     288             :     NUMFMT_CURRENCY_MINUS_NUMBER_SYMBOL( 5, SYMBOL, SPACE, "" ), \
     289             :     NUMFMT_CURRENCY_MINUS_NUMBER_SYMBOL( 37, BLINDS, SPACE, "" ), \
     290             :     NUMFMT_ACCOUNTING_MINUS_NUMBER_SYMBOL( 41, SYMBOL, BLINDS, SPACE )
     291             : 
     292             : /** Defines builtin currency formats INDEX...INDEX+3 in the following format:
     293             :     "[opening parenthesis], symbol, number, [closing parenthesis].".
     294             :     @param INDEX  First number format index.
     295             :     @param SYMBOL  Currency symbol.
     296             :     @param SPACE  Space character(s) between currency symbol and number.
     297             :     @param MODIF  Leading modifier for each portion (e.g. "t" for Thai formats). */
     298             : #define NUMFMT_CURRENCY_OPEN_SYMBOL_NUMBER_CLOSE( INDEX, SYMBOL, SPACE, MODIF ) \
     299             :     NUMFMT_STRING( INDEX + 0, MODIF SYMBOL SPACE "#,##0_);"            MODIF "(" SYMBOL SPACE "#,##0)" ), \
     300             :     NUMFMT_STRING( INDEX + 1, MODIF SYMBOL SPACE "#,##0_);"    "[RED]" MODIF "(" SYMBOL SPACE "#,##0)" ), \
     301             :     NUMFMT_STRING( INDEX + 2, MODIF SYMBOL SPACE "#,##0.00_);"         MODIF "(" SYMBOL SPACE "#,##0.00)" ), \
     302             :     NUMFMT_STRING( INDEX + 3, MODIF SYMBOL SPACE "#,##0.00_);" "[RED]" MODIF "(" SYMBOL SPACE "#,##0.00)" )
     303             : 
     304             : /** Defines builtin accounting formats INDEX...INDEX+3 in the following format:
     305             :     "[opening parenthesis], symbol, number, [closing parenthesis].".
     306             :     @param INDEX  First number format index.
     307             :     @param SYMBOL  Currency symbol.
     308             :     @param SPACE  Space character(s) between currency symbol and number. */
     309             : #define NUMFMT_ACCOUNTING_OPEN_SYMBOL_NUMBER_CLOSE( INDEX, SYMBOL, SPACE ) \
     310             :     NUMFMT_STRING( INDEX + 0, "_("              "* #,##0_);"    "_("              "* (#,##0);"    "_("              "* \"-\"_);"    "_(@_)" ), \
     311             :     NUMFMT_STRING( INDEX + 1, "_(" SYMBOL SPACE "* #,##0_);"    "_(" SYMBOL SPACE "* (#,##0);"    "_(" SYMBOL SPACE "* \"-\"_);"    "_(@_)" ), \
     312             :     NUMFMT_STRING( INDEX + 2, "_("              "* #,##0.00_);" "_("              "* (#,##0.00);" "_("              "* \"-\"?\?_);" "_(@_)" ), \
     313             :     NUMFMT_STRING( INDEX + 3, "_(" SYMBOL SPACE "* #,##0.00_);" "_(" SYMBOL SPACE "* (#,##0.00);" "_(" SYMBOL SPACE "* \"-\"?\?_);" "_(@_)" )
     314             : 
     315             : /** Defines builtin currency formats 5...8 (with currency symbol), 37...40
     316             :     (blind currency symbol), and 41...44 (accounting), in the following format:
     317             :     "[opening parenthesis], symbol, number, [closing parenthesis].".
     318             :     @param SYMBOL  Currency symbol.
     319             :     @param SPACE  Space character(s) between currency symbol and number. */
     320             : #define NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( SYMBOL, SPACE ) \
     321             :     NUMFMT_CURRENCY_OPEN_SYMBOL_NUMBER_CLOSE( 5, SYMBOL, SPACE, "" ), \
     322             :     NUMFMT_CURRENCY_OPEN_SYMBOL_NUMBER_CLOSE( 37, "", "", "" ), \
     323             :     NUMFMT_ACCOUNTING_OPEN_SYMBOL_NUMBER_CLOSE( 41, SYMBOL, SPACE )
     324             : 
     325             : /** Defines builtin currency formats INDEX...INDEX+3 in the following format:
     326             :     "[opening parenthesis], number, symbol, [closing parenthesis].".
     327             :     @param INDEX  First number format index.
     328             :     @param SYMBOL  Currency symbol.
     329             :     @param SPACE  Space character(s) between number and currency symbol.
     330             :     @param MODIF  Leading modifier for each portion (e.g. "t" for Thai formats). */
     331             : #define NUMFMT_CURRENCY_OPEN_NUMBER_SYMBOL_CLOSE( INDEX, SYMBOL, SPACE, MODIF ) \
     332             :     NUMFMT_STRING( INDEX + 0, MODIF "#,##0"    SPACE SYMBOL "_);"         MODIF "(#,##0"    SPACE SYMBOL ")" ), \
     333             :     NUMFMT_STRING( INDEX + 1, MODIF "#,##0"    SPACE SYMBOL "_);" "[RED]" MODIF "(#,##0"    SPACE SYMBOL ")" ), \
     334             :     NUMFMT_STRING( INDEX + 2, MODIF "#,##0.00" SPACE SYMBOL "_);"         MODIF "(#,##0.00" SPACE SYMBOL ")" ), \
     335             :     NUMFMT_STRING( INDEX + 3, MODIF "#,##0.00" SPACE SYMBOL "_);" "[RED]" MODIF "(#,##0.00" SPACE SYMBOL ")" )
     336             : 
     337             : /** Defines builtin accounting formats INDEX...INDEX+3 in the following format:
     338             :     "[opening parenthesis], number, symbol, [closing parenthesis].".
     339             :     @param INDEX  First number format index.
     340             :     @param SYMBOL  Currency symbol.
     341             :     @param BLINDS  Blind currency symbol.
     342             :     @param SPACE  Space character(s) between number and currency symbol. */
     343             : #define NUMFMT_ACCOUNTING_OPEN_NUMBER_SYMBOL_CLOSE( INDEX, SYMBOL, BLINDS, SPACE ) \
     344             :     NUMFMT_STRING( INDEX + 0, "_ * #,##0_)"    SPACE BLINDS "_ ;_ * (#,##0)"    SPACE BLINDS "_ ;_ * \"-\"_)"    SPACE BLINDS "_ ;_ @_ " ), \
     345             :     NUMFMT_STRING( INDEX + 1, "_ * #,##0_)"    SPACE SYMBOL "_ ;_ * (#,##0)"    SPACE SYMBOL "_ ;_ * \"-\"_)"    SPACE SYMBOL "_ ;_ @_ " ), \
     346             :     NUMFMT_STRING( INDEX + 2, "_ * #,##0.00_)" SPACE BLINDS "_ ;_ * (#,##0.00)" SPACE BLINDS "_ ;_ * \"-\"?\?_)" SPACE BLINDS "_ ;_ @_ " ), \
     347             :     NUMFMT_STRING( INDEX + 3, "_ * #,##0.00_)" SPACE SYMBOL "_ ;_ * (#,##0.00)" SPACE SYMBOL "_ ;_ * \"-\"?\?_)" SPACE SYMBOL "_ ;_ @_ " )
     348             : 
     349             : /** Defines builtin currency formats 5...8 (with currency symbol), 37...40
     350             :     (blind currency symbol), and 41...44 (accounting), in the following format:
     351             :     "[opening parenthesis], number, symbol, [closing parenthesis].".
     352             :     @param SYMBOL  Currency symbol.
     353             :     @param BLINDS  Blind currency symbol.
     354             :     @param SPACE  Space character(s) between number and currency symbol. */
     355             : #define NUMFMT_ALLCURRENCIES_OPEN_NUMBER_SYMBOL_CLOSE( SYMBOL, BLINDS, SPACE ) \
     356             :     NUMFMT_CURRENCY_OPEN_NUMBER_SYMBOL_CLOSE( 5, SYMBOL, SPACE, "" ), \
     357             :     NUMFMT_CURRENCY_OPEN_NUMBER_SYMBOL_CLOSE( 37, BLINDS, SPACE, "" ), \
     358             :     NUMFMT_ACCOUNTING_OPEN_NUMBER_SYMBOL_CLOSE( 41, SYMBOL, BLINDS, SPACE )
     359             : 
     360             : // currency unit characters
     361             : #define UTF8_BAHT           "\340\270\277"
     362             : #define UTF8_COLON          "\342\202\241"
     363             : #define UTF8_CURR_AR_AE     "\330\257.\330\245."
     364             : #define UTF8_CURR_AR_BH     "\330\257.\330\250."
     365             : #define UTF8_CURR_AR_DZ     "\330\257.\330\254."
     366             : #define UTF8_CURR_AR_EG     "\330\254.\331\205."
     367             : #define UTF8_CURR_AR_IQ     "\330\257.\330\271."
     368             : #define UTF8_CURR_AR_JO     "\330\257.\330\247."
     369             : #define UTF8_CURR_AR_KW     "\330\257.\331\203."
     370             : #define UTF8_CURR_AR_LB     "\331\204.\331\204."
     371             : #define UTF8_CURR_AR_LY     "\330\257.\331\204."
     372             : #define UTF8_CURR_AR_MA     "\330\257.\331\205."
     373             : #define UTF8_CURR_AR_OM     "\330\261.\330\271."
     374             : #define UTF8_CURR_AR_QA     "\330\261.\331\202."
     375             : #define UTF8_CURR_AR_SA     "\330\261.\330\263."
     376             : #define UTF8_CURR_AR_SY     "\331\204.\330\263."
     377             : #define UTF8_CURR_AR_TN     "\330\257.\330\252."
     378             : #define UTF8_CURR_AR_YE     "\330\261.\331\212."
     379             : #define UTF8_CURR_BN_IN     "\340\246\237\340\246\276"
     380             : #define UTF8_CURR_FA_IR     "\330\261\331\212\330\247\331\204"
     381             : #define UTF8_CURR_GU_IN     "\340\252\260\340\253\202"
     382             : #define UTF8_CURR_HI_IN     "\340\244\260\340\245\201"
     383             : #define UTF8_CURR_KN_IN     "\340\262\260\340\263\202"
     384             : #define UTF8_CURR_ML_IN     "\340\264\225"
     385             : #define UTF8_CURR_PA_IN     "\340\250\260\340\251\201"
     386             : #define UTF8_CURR_TA_IN     "\340\256\260\340\257\202"
     387             : #define UTF8_CURR_TE_IN     "\340\260\260\340\261\202"
     388             : #define UTF8_DONG           "\342\202\253"
     389             : #define UTF8_EURO           "\342\202\254"
     390             : #define UTF8_POUND_GB       "\302\243"
     391             : #define UTF8_RUFIYAA        "\336\203"
     392             : #define UTF8_SHEQEL         "\342\202\252"
     393             : #define UTF8_TUGRUG         "\342\202\256"
     394             : #define UTF8_WON            "\342\202\251"
     395             : #define UTF8_YEN_CN         "\357\277\245"
     396             : #define UTF8_YEN_JP         "\302\245"
     397             : 
     398             : // Unicode characters for currency units
     399             : #define UTF8_CCARON_LC      "\304\215"
     400             : #define UTF8_LSTROKE_LC     "\305\202"
     401             : // Armenian
     402             : #define UTF8_HY_DA_LC       "\325\244"
     403             : #define UTF8_HY_REH_LC      "\326\200"
     404             : // Cyrillic
     405             : #define UTF8_CYR_G_LC       "\320\263"
     406             : #define UTF8_CYR_L_LC       "\320\273"
     407             : #define UTF8_CYR_M_LC       "\320\274"
     408             : #define UTF8_CYR_N_LC       "\320\275"
     409             : #define UTF8_CYR_O_LC       "\320\276"
     410             : #define UTF8_CYR_R_LC       "\321\200"
     411             : #define UTF8_CYR_S_LC       "\321\201"
     412             : #define UTF8_CYR_W_LC       "\320\262"
     413             : 
     414             : // Japanese/Chinese date/time characters
     415             : #define UTF8_CJ_YEAR        "\345\271\264"
     416             : #define UTF8_CJ_MON         "\346\234\210"
     417             : #define UTF8_CJ_DAY         "\346\227\245"
     418             : #define UTF8_CJ_HOUR        "\346\231\202"
     419             : #define UTF8_CJ_MIN         "\345\210\206"
     420             : #define UTF8_CJ_SEC         "\347\247\222"
     421             : 
     422             : // Chinese Simplified date/time characters
     423             : #define UTF8_CS_YEAR        "\345\271\264"
     424             : #define UTF8_CS_MON         "\346\234\210"
     425             : #define UTF8_CS_DAY         "\346\227\245"
     426             : #define UTF8_CS_HOUR        "\346\227\266"
     427             : #define UTF8_CS_MIN         "\345\210\206"
     428             : #define UTF8_CS_SEC         "\347\247\222"
     429             : 
     430             : // Korean date/time characters
     431             : #define UTF8_KO_YEAR        "\353\205\204"
     432             : #define UTF8_KO_MON         "\354\233\224"
     433             : #define UTF8_KO_DAY         "\354\235\274"
     434             : #define UTF8_KO_HOUR        "\354\213\234"
     435             : #define UTF8_KO_MIN         "\353\266\204"
     436             : #define UTF8_KO_SEC         "\354\264\210"
     437             : 
     438             : // ----------------------------------------------------------------------------
     439             : 
     440             : /** Default number format table. Last parent of all other tables, used for unknown locales. */
     441             : static const BuiltinFormat spBuiltinFormats_BASE[] =
     442             : {
     443             :     // 0..13 numeric and currency formats
     444             :     NUMFMT_PREDEF(   0, NUMBER_STANDARD ),          // General
     445             :     NUMFMT_PREDEF(   1, NUMBER_INT ),               // 0
     446             :     NUMFMT_PREDEF(   2, NUMBER_DEC2 ),              // 0.00
     447             :     NUMFMT_PREDEF(   3, NUMBER_1000INT ),           // #,##0
     448             :     NUMFMT_PREDEF(   4, NUMBER_1000DEC2 ),          // #,##0.00
     449             :     NUMFMT_PREDEF(   5, CURRENCY_1000INT ),         // #,##0[symbol]
     450             :     NUMFMT_PREDEF(   6, CURRENCY_1000INT_RED ),     // #,##0[symbol];[RED]-#,##0[symbol]
     451             :     NUMFMT_PREDEF(   7, CURRENCY_1000DEC2 ),        // #,##0.00[symbol]
     452             :     NUMFMT_PREDEF(   8, CURRENCY_1000DEC2_RED ),    // #,##0.00[symbol];[RED]-#,##0.00[symbol]
     453             :     NUMFMT_PREDEF(   9, PERCENT_INT ),              // 0%
     454             :     NUMFMT_PREDEF(  10, PERCENT_DEC2 ),             // 0.00%
     455             :     NUMFMT_PREDEF(  11, SCIENTIFIC_000E00 ),        // 0.00E+00
     456             :     NUMFMT_PREDEF(  12, FRACTION_1 ),               // # ?/?
     457             :     NUMFMT_PREDEF(  13, FRACTION_2 ),               // # ??/??
     458             : 
     459             :     // 14...22 date and time formats
     460             :     NUMFMT_PREDEF(  14, DATE_SYS_DDMMYYYY ),
     461             :     NUMFMT_PREDEF(  15, DATE_SYS_DMMMYY ),
     462             :     NUMFMT_PREDEF(  16, DATE_SYS_DDMMM ),
     463             :     NUMFMT_PREDEF(  17, DATE_SYS_MMYY ),
     464             :     NUMFMT_PREDEF(  18, TIME_HHMMAMPM ),
     465             :     NUMFMT_PREDEF(  19, TIME_HHMMSSAMPM ),
     466             :     NUMFMT_PREDEF(  20, TIME_HHMM ),
     467             :     NUMFMT_PREDEF(  21, TIME_HHMMSS ),
     468             :     NUMFMT_PREDEF(  22, DATETIME_SYSTEM_SHORT_HHMM ),
     469             : 
     470             :     // 23...36 international formats
     471             :     NUMFMT_REUSE(   23, 0 ),
     472             :     NUMFMT_REUSE(   24, 0 ),
     473             :     NUMFMT_REUSE(   25, 0 ),
     474             :     NUMFMT_REUSE(   26, 0 ),
     475             :     NUMFMT_REUSE(   27, 14 ),
     476             :     NUMFMT_REUSE(   28, 14 ),
     477             :     NUMFMT_REUSE(   29, 14 ),
     478             :     NUMFMT_REUSE(   30, 14 ),
     479             :     NUMFMT_REUSE(   31, 14 ),
     480             :     NUMFMT_REUSE(   32, 21 ),
     481             :     NUMFMT_REUSE(   33, 21 ),
     482             :     NUMFMT_REUSE(   34, 21 ),
     483             :     NUMFMT_REUSE(   35, 21 ),
     484             :     NUMFMT_REUSE(   36, 14 ),
     485             : 
     486             :     // 37...44 accounting formats, defaults without currency symbol here
     487             :     NUMFMT_CURRENCY_MINUS_SYMBOL_NUMBER( 37, "", "", "" ),
     488             :     NUMFMT_ACCOUNTING_MINUS_SYMBOL_NUMBER( 41, "", "" ),
     489             : 
     490             :     // 45...49 more special formats
     491             :     NUMFMT_STRING(  45, "mm:ss" ),
     492             :     NUMFMT_STRING(  46, "[h]:mm:ss" ),
     493             :     NUMFMT_STRING(  47, "mm:ss.0" ),
     494             :     NUMFMT_STRING(  48, "##0.0E+0" ),
     495             :     NUMFMT_PREDEF(  49, TEXT ),
     496             : 
     497             :     // 50...81 international formats
     498             :     NUMFMT_REUSE(   50, 14 ),
     499             :     NUMFMT_REUSE(   51, 14 ),
     500             :     NUMFMT_REUSE(   52, 14 ),
     501             :     NUMFMT_REUSE(   53, 14 ),
     502             :     NUMFMT_REUSE(   54, 14 ),
     503             :     NUMFMT_REUSE(   55, 14 ),
     504             :     NUMFMT_REUSE(   56, 14 ),
     505             :     NUMFMT_REUSE(   57, 14 ),
     506             :     NUMFMT_REUSE(   58, 14 ),
     507             :     NUMFMT_REUSE(   59, 1 ),
     508             :     NUMFMT_REUSE(   60, 2 ),
     509             :     NUMFMT_REUSE(   61, 3 ),
     510             :     NUMFMT_REUSE(   62, 4 ),
     511             :     NUMFMT_REUSE(   63, 5 ),
     512             :     NUMFMT_REUSE(   64, 6 ),
     513             :     NUMFMT_REUSE(   65, 7 ),
     514             :     NUMFMT_REUSE(   66, 8 ),
     515             :     NUMFMT_REUSE(   67, 9 ),
     516             :     NUMFMT_REUSE(   68, 10 ),
     517             :     NUMFMT_REUSE(   69, 12 ),
     518             :     NUMFMT_REUSE(   70, 13 ),
     519             :     NUMFMT_REUSE(   71, 14 ),
     520             :     NUMFMT_REUSE(   72, 14 ),
     521             :     NUMFMT_REUSE(   73, 15 ),
     522             :     NUMFMT_REUSE(   74, 16 ),
     523             :     NUMFMT_REUSE(   75, 17 ),
     524             :     NUMFMT_REUSE(   76, 20 ),
     525             :     NUMFMT_REUSE(   77, 21 ),
     526             :     NUMFMT_REUSE(   78, 22 ),
     527             :     NUMFMT_REUSE(   79, 45 ),
     528             :     NUMFMT_REUSE(   80, 46 ),
     529             :     NUMFMT_REUSE(   81, 47 ),
     530             : 
     531             :     // 82...163 not used, must not occur in a file (Excel may crash)
     532             : 
     533             :     NUMFMT_ENDTABLE()
     534             : };
     535             : 
     536             : // ----------------------------------------------------------------------------
     537             : 
     538             : /** Arabic, U.A.E. */
     539             : static const BuiltinFormat spBuiltinFormats_ar_AE[] =
     540             : {
     541             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     542             :     NUMFMT_ALLCURRENCIES_SYMBOL_NUMBER_MINUS( "\"" UTF8_CURR_AR_AE "\"", " " ),
     543             :     NUMFMT_ENDTABLE()
     544             : };
     545             : 
     546             : /** Arabic, Bahrain. */
     547             : static const BuiltinFormat spBuiltinFormats_ar_BH[] =
     548             : {
     549             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     550             :     NUMFMT_ALLCURRENCIES_SYMBOL_NUMBER_MINUS( "\"" UTF8_CURR_AR_BH "\"", " " ),
     551             :     NUMFMT_ENDTABLE()
     552             : };
     553             : 
     554             : /** Arabic, Algeria. */
     555             : static const BuiltinFormat spBuiltinFormats_ar_DZ[] =
     556             : {
     557             :     NUMFMT_ALLDATETIMES( "DD-MM-YYYY", "DD", "-", "MMM", "-", "YY", "h", "h" ),
     558             :     NUMFMT_ALLCURRENCIES_SYMBOL_NUMBER_MINUS( "\"" UTF8_CURR_AR_DZ "\"", " " ),
     559             :     NUMFMT_ENDTABLE()
     560             : };
     561             : 
     562             : /** Arabic, Egypt. */
     563             : static const BuiltinFormat spBuiltinFormats_ar_EG[] =
     564             : {
     565             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     566             :     NUMFMT_ALLCURRENCIES_SYMBOL_NUMBER_MINUS( "\"" UTF8_CURR_AR_EG "\"", " " ),
     567             :     NUMFMT_ENDTABLE()
     568             : };
     569             : 
     570             : /** Arabic, Iraq. */
     571             : static const BuiltinFormat spBuiltinFormats_ar_IQ[] =
     572             : {
     573             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     574             :     NUMFMT_ALLCURRENCIES_SYMBOL_NUMBER_MINUS( "\"" UTF8_CURR_AR_IQ "\"", " " ),
     575             :     NUMFMT_ENDTABLE()
     576             : };
     577             : 
     578             : /** Arabic, Jordan. */
     579             : static const BuiltinFormat spBuiltinFormats_ar_JO[] =
     580             : {
     581             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     582             :     NUMFMT_ALLCURRENCIES_SYMBOL_NUMBER_MINUS( "\"" UTF8_CURR_AR_JO "\"", " " ),
     583             :     NUMFMT_ENDTABLE()
     584             : };
     585             : 
     586             : /** Arabic, Kuwait. */
     587             : static const BuiltinFormat spBuiltinFormats_ar_KW[] =
     588             : {
     589             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     590             :     NUMFMT_ALLCURRENCIES_SYMBOL_NUMBER_MINUS( "\"" UTF8_CURR_AR_KW "\"", " " ),
     591             :     NUMFMT_ENDTABLE()
     592             : };
     593             : 
     594             : /** Arabic, Lebanon. */
     595             : static const BuiltinFormat spBuiltinFormats_ar_LB[] =
     596             : {
     597             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     598             :     NUMFMT_ALLCURRENCIES_SYMBOL_NUMBER_MINUS( "\"" UTF8_CURR_AR_LB "\"", " " ),
     599             :     NUMFMT_ENDTABLE()
     600             : };
     601             : 
     602             : /** Arabic, Libya. */
     603             : static const BuiltinFormat spBuiltinFormats_ar_LY[] =
     604             : {
     605             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     606             :     NUMFMT_ALLCURRENCIES_SYMBOL_NUMBER_MINUS( "\"" UTF8_CURR_AR_LY "\"", " " ),
     607             :     NUMFMT_ENDTABLE()
     608             : };
     609             : 
     610             : /** Arabic, Morocco. */
     611             : static const BuiltinFormat spBuiltinFormats_ar_MA[] =
     612             : {
     613             :     NUMFMT_ALLDATETIMES( "DD-MM-YYYY", "DD", "-", "MMM", "-", "YY", "h", "h" ),
     614             :     NUMFMT_ALLCURRENCIES_SYMBOL_NUMBER_MINUS( "\"" UTF8_CURR_AR_MA "\"", " " ),
     615             :     NUMFMT_ENDTABLE()
     616             : };
     617             : 
     618             : /** Arabic, Oman. */
     619             : static const BuiltinFormat spBuiltinFormats_ar_OM[] =
     620             : {
     621             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     622             :     NUMFMT_ALLCURRENCIES_SYMBOL_NUMBER_MINUS( "\"" UTF8_CURR_AR_OM "\"", " " ),
     623             :     NUMFMT_ENDTABLE()
     624             : };
     625             : 
     626             : /** Arabic, Qatar. */
     627             : static const BuiltinFormat spBuiltinFormats_ar_QA[] =
     628             : {
     629             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     630             :     NUMFMT_ALLCURRENCIES_SYMBOL_NUMBER_MINUS( "\"" UTF8_CURR_AR_QA "\"", " " ),
     631             :     NUMFMT_ENDTABLE()
     632             : };
     633             : 
     634             : /** Arabic, Saudi Arabia. */
     635             : static const BuiltinFormat spBuiltinFormats_ar_SA[] =
     636             : {
     637             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     638             :     NUMFMT_ALLCURRENCIES_SYMBOL_NUMBER_MINUS( "\"" UTF8_CURR_AR_SA "\"", " " ),
     639             :     NUMFMT_ENDTABLE()
     640             : };
     641             : 
     642             : /** Arabic, Syria. */
     643             : static const BuiltinFormat spBuiltinFormats_ar_SY[] =
     644             : {
     645             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     646             :     NUMFMT_ALLCURRENCIES_SYMBOL_NUMBER_MINUS( "\"" UTF8_CURR_AR_SY "\"", " " ),
     647             :     NUMFMT_ENDTABLE()
     648             : };
     649             : 
     650             : /** Arabic, Tunisia. */
     651             : static const BuiltinFormat spBuiltinFormats_ar_TN[] =
     652             : {
     653             :     NUMFMT_ALLDATETIMES( "DD-MM-YYYY", "DD", "-", "MMM", "-", "YY", "h", "h" ),
     654             :     NUMFMT_ALLCURRENCIES_SYMBOL_NUMBER_MINUS( "\"" UTF8_CURR_AR_TN "\"", " " ),
     655             :     NUMFMT_ENDTABLE()
     656             : };
     657             : 
     658             : /** Arabic, Yemen. */
     659             : static const BuiltinFormat spBuiltinFormats_ar_YE[] =
     660             : {
     661             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     662             :     NUMFMT_ALLCURRENCIES_SYMBOL_NUMBER_MINUS( "\"" UTF8_CURR_AR_YE "\"", " " ),
     663             :     NUMFMT_ENDTABLE()
     664             : };
     665             : 
     666             : /** Belarusian, Belarus. */
     667             : static const BuiltinFormat spBuiltinFormats_be_BY[] =
     668             : {
     669             :     // space character is group separator, literal spaces must be quoted
     670             :     NUMFMT_ALLDATETIMES( "DD.MM.YYYY", "DD", ".", "MMM", ".", "YY", "h", "h" ),
     671             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( "\"" UTF8_CYR_R_LC ".\"", "_" UTF8_CYR_R_LC "_.", "\\ " ),
     672             :     NUMFMT_ENDTABLE()
     673             : };
     674             : 
     675             : /** Bulgarian, Bulgaria. */
     676             : static const BuiltinFormat spBuiltinFormats_bg_BG[] =
     677             : {
     678             :     // space character is group separator, literal spaces must be quoted
     679             :     NUMFMT_ALLDATETIMES( "DD.M.YYYY", "DD", ".", "MMM", ".", "YY", "h", "hh" ),
     680             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( "\"" UTF8_CYR_L_LC UTF8_CYR_W_LC "\"", "_" UTF8_CYR_L_LC "_" UTF8_CYR_W_LC, "\\ " ),
     681             :     NUMFMT_ENDTABLE()
     682             : };
     683             : 
     684             : /** Bengali, India. */
     685             : static const BuiltinFormat spBuiltinFormats_bn_IN[] =
     686             : {
     687             :     NUMFMT_ALLDATETIMES( "DD-MM-YY", "DD", "-", "MMM", "-", "YY", "h", "hh" ),
     688             :     NUMFMT_ALLCURRENCIES_SYMBOL_MINUS_NUMBER( "\"" UTF8_CURR_BN_IN "\"", " " ),
     689             :     NUMFMT_ENDTABLE()
     690             : };
     691             : 
     692             : /** Czech, Czech Republic. */
     693             : static const BuiltinFormat spBuiltinFormats_cs_CZ[] =
     694             : {
     695             :     // space character is group separator, literal spaces must be quoted
     696             :     NUMFMT_ALLDATETIMES( "D.M.YYYY", "D", ".", "MMM", ".", "YY", "h", "h" ),
     697             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( "\"K" UTF8_CCARON_LC "\"", "_K_" UTF8_CCARON_LC, "\\ " ),
     698             :     NUMFMT_ENDTABLE()
     699             : };
     700             : 
     701             : /** Danish, Denmark. */
     702             : static const BuiltinFormat spBuiltinFormats_da_DK[] =
     703             : {
     704             :     NUMFMT_ALLDATETIMES( "DD-MM-YYYY", "DD", "-", "MMM", "-", "YY", "h", "hh" ),
     705             :     NUMFMT_ALLCURRENCIES_SYMBOL_MINUS_NUMBER( "\"kr\"", " " ),
     706             :     NUMFMT_ENDTABLE()
     707             : };
     708             : 
     709             : /** German, Austria. */
     710             : static const BuiltinFormat spBuiltinFormats_de_AT[] =
     711             : {
     712             :     NUMFMT_ALLDATETIMES( "DD.MM.YYYY", "DD", ".", "MMM", ".", "YY", "h", "hh" ),
     713             :     NUMFMT_ALLCURRENCIES_MINUS_SYMBOL_NUMBER( UTF8_EURO, " " ),
     714             :     NUMFMT_ENDTABLE()
     715             : };
     716             : 
     717             : /** German, Switzerland. */
     718             : static const BuiltinFormat spBuiltinFormats_de_CH[] =
     719             : {
     720             :     NUMFMT_ALLDATETIMES( "DD.MM.YYYY", "DD", ". ", "MMM", " ", "YY", "h", "hh" ),
     721             :     NUMFMT_ALLCURRENCIES_SYMBOL_MINUS_NUMBER( "\"SFr.\"", " " ),
     722             :     NUMFMT_ENDTABLE()
     723             : };
     724             : 
     725             : /** German, Germany. */
     726             : static const BuiltinFormat spBuiltinFormats_de_DE[] =
     727             : {
     728             :     NUMFMT_ALLDATETIMES( "DD.MM.YYYY", "DD", ". ", "MMM", " ", "YY", "h", "hh" ),
     729             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( UTF8_EURO, "_" UTF8_EURO, " " ),
     730             :     NUMFMT_ENDTABLE()
     731             : };
     732             : 
     733             : /** German, Liechtenstein. */
     734             : static const BuiltinFormat spBuiltinFormats_de_LI[] =
     735             : {
     736             :     NUMFMT_ALLDATETIMES( "DD.MM.YYYY", "DD", ". ", "MMM", " ", "YY", "h", "hh" ),
     737             :     NUMFMT_ALLCURRENCIES_SYMBOL_MINUS_NUMBER( "\"CHF\"", " " ),
     738             :     NUMFMT_ENDTABLE()
     739             : };
     740             : 
     741             : /** German, Luxembourg. */
     742             : static const BuiltinFormat spBuiltinFormats_de_LU[] =
     743             : {
     744             :     NUMFMT_ALLDATETIMES( "DD.MM.YYYY", "DD", ".", "MMM", ".", "YY", "h", "hh" ),
     745             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( UTF8_EURO, "_" UTF8_EURO, " " ),
     746             :     NUMFMT_ENDTABLE()
     747             : };
     748             : 
     749             : /** Divehi, Maldives. */
     750             : static const BuiltinFormat spBuiltinFormats_div_MV[] =
     751             : {
     752             :     NUMFMT_ALLDATETIMES( "DD/MM/YY", "DD", "-", "MMM", "-", "YY", "h", "hh" ),
     753             :     NUMFMT_ALLCURRENCIES_NUMBER_SYMBOL_MINUS( "\"" UTF8_RUFIYAA ".\"", "_" UTF8_RUFIYAA "_.", " " ),
     754             :     NUMFMT_ENDTABLE()
     755             : };
     756             : 
     757             : /** Greek, Greece. */
     758             : static const BuiltinFormat spBuiltinFormats_el_GR[] =
     759             : {
     760             :     NUMFMT_ALLDATETIMES( "D/M/YYYY", "D", "-", "MMM", "-", "YY", "h", "h" ),
     761             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( UTF8_EURO, "_" UTF8_EURO, " " ),
     762             :     NUMFMT_ENDTABLE()
     763             : };
     764             : 
     765             : /** English, Australia. */
     766             : static const BuiltinFormat spBuiltinFormats_en_AU[] =
     767             : {
     768             :     NUMFMT_ALLDATETIMES( "D/MM/YYYY", "D", "-", "MMM", "-", "YY", "h", "h" ),
     769             :     NUMFMT_ALLCURRENCIES_MINUS_SYMBOL_NUMBER( "$", "" ),
     770             :     NUMFMT_ENDTABLE()
     771             : };
     772             : 
     773             : /** English, Belize. */
     774             : static const BuiltinFormat spBuiltinFormats_en_BZ[] =
     775             : {
     776             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     777             :     NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( "\"BZ$\"", "" ),
     778             :     NUMFMT_ENDTABLE()
     779             : };
     780             : 
     781             : /** English, Canada. */
     782             : static const BuiltinFormat spBuiltinFormats_en_CA[] =
     783             : {
     784             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "h", "h" ),
     785             :     NUMFMT_ALLCURRENCIES_MINUS_SYMBOL_NUMBER( "$", "" ),
     786             :     NUMFMT_ENDTABLE()
     787             : };
     788             : 
     789             : /** English, Caribbean. */
     790             : static const BuiltinFormat spBuiltinFormats_en_CB[] =
     791             : {
     792             :     NUMFMT_ALLDATETIMES( "MM/DD/YYYY", "DD", "-", "MMM", "-", "YY", "h", "h" ),
     793             :     NUMFMT_ALLCURRENCIES_MINUS_SYMBOL_NUMBER( "$", "" ),
     794             :     NUMFMT_ENDTABLE()
     795             : };
     796             : 
     797             : /** English, United Kingdom. */
     798             : static const BuiltinFormat spBuiltinFormats_en_GB[] =
     799             : {
     800             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "h", "hh" ),
     801             :     NUMFMT_ALLCURRENCIES_MINUS_SYMBOL_NUMBER( UTF8_POUND_GB, "" ),
     802             :     NUMFMT_ENDTABLE()
     803             : };
     804             : 
     805             : /** English, Ireland. */
     806             : static const BuiltinFormat spBuiltinFormats_en_IE[] =
     807             : {
     808             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "h", "hh" ),
     809             :     NUMFMT_ALLCURRENCIES_MINUS_SYMBOL_NUMBER( UTF8_EURO, "" ),
     810             :     NUMFMT_ENDTABLE()
     811             : };
     812             : 
     813             : /** English, Jamaica. */
     814             : static const BuiltinFormat spBuiltinFormats_en_JM[] =
     815             : {
     816             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     817             :     NUMFMT_ALLCURRENCIES_MINUS_SYMBOL_NUMBER( "\"J$\"", "" ),
     818             :     NUMFMT_ENDTABLE()
     819             : };
     820             : 
     821             : /** English, New Zealand. */
     822             : static const BuiltinFormat spBuiltinFormats_en_NZ[] =
     823             : {
     824             :     NUMFMT_ALLDATETIMES( "D/MM/YYYY", "D", "-", "MMM", "-", "YY", "h", "h" ),
     825             :     NUMFMT_ALLCURRENCIES_MINUS_SYMBOL_NUMBER( "$", "" ),
     826             :     NUMFMT_ENDTABLE()
     827             : };
     828             : 
     829             : /** English, Philippines. */
     830             : static const BuiltinFormat spBuiltinFormats_en_PH[] =
     831             : {
     832             :     NUMFMT_ALLDATETIMES( "M/D/YYYY", "D", "-", "MMM", "-", "YY", "h", "h" ),
     833             :     NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( "\"Php\"", "" ),
     834             :     NUMFMT_ENDTABLE()
     835             : };
     836             : 
     837             : /** English, Trinidad and Tobago. */
     838             : static const BuiltinFormat spBuiltinFormats_en_TT[] =
     839             : {
     840             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     841             :     NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( "\"TT$\"", "" ),
     842             :     NUMFMT_ENDTABLE()
     843             : };
     844             : 
     845             : /** English, USA. */
     846             : static const BuiltinFormat spBuiltinFormats_en_US[] =
     847             : {
     848             :     NUMFMT_ALLDATETIMES( "M/D/YYYY", "D", "-", "MMM", "-", "YY", "h", "h" ),
     849             :     NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( "$", "" ),
     850             :     NUMFMT_ENDTABLE()
     851             : };
     852             : 
     853             : /** English, South Africa. */
     854             : static const BuiltinFormat spBuiltinFormats_en_ZA[] =
     855             : {
     856             :     NUMFMT_ALLDATETIMES( "YYYY/MM/DD", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     857             :     NUMFMT_ALLCURRENCIES_SYMBOL_MINUS_NUMBER( "\\R", " " ),
     858             :     NUMFMT_ENDTABLE()
     859             : };
     860             : 
     861             : /** English, Zimbabwe. */
     862             : static const BuiltinFormat spBuiltinFormats_en_ZW[] =
     863             : {
     864             :     NUMFMT_ALLDATETIMES( "M/D/YYYY", "D", "-", "MMM", "-", "YY", "h", "h" ),
     865             :     NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( "\"Z$\"", "" ),
     866             :     NUMFMT_ENDTABLE()
     867             : };
     868             : 
     869             : /** Spanish, Argentina. */
     870             : static const BuiltinFormat spBuiltinFormats_es_AR[] =
     871             : {
     872             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     873             :     NUMFMT_ALLCURRENCIES_SYMBOL_MINUS_NUMBER( "$", " " ),
     874             :     NUMFMT_ENDTABLE()
     875             : };
     876             : 
     877             : /** Spanish, Bolivia. */
     878             : static const BuiltinFormat spBuiltinFormats_es_BO[] =
     879             : {
     880             :     // slashes must be quoted to prevent conversion to minus
     881             :     NUMFMT_ALLDATETIMES( "DD\\/MM\\/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     882             :     NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( "\"$b\"", " " ),
     883             :     NUMFMT_ENDTABLE()
     884             : };
     885             : 
     886             : /** Spanish, Chile. */
     887             : static const BuiltinFormat spBuiltinFormats_es_CL[] =
     888             : {
     889             :     NUMFMT_ALLDATETIMES( "DD-MM-YYYY", "DD", "-", "MMM", "-", "YY", "h", "h" ),
     890             :     NUMFMT_ALLCURRENCIES_MINUS_SYMBOL_NUMBER( "$", " " ),
     891             :     NUMFMT_ENDTABLE()
     892             : };
     893             : 
     894             : /** Spanish, Colombia. */
     895             : static const BuiltinFormat spBuiltinFormats_es_CO[] =
     896             : {
     897             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     898             :     NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( "$", " " ),
     899             :     NUMFMT_ENDTABLE()
     900             : };
     901             : 
     902             : /** Spanish, Costa Rica. */
     903             : static const BuiltinFormat spBuiltinFormats_es_CR[] =
     904             : {
     905             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     906             :     NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( UTF8_COLON, "" ),
     907             :     NUMFMT_ENDTABLE()
     908             : };
     909             : 
     910             : /** Spanish, Dominican Republic. */
     911             : static const BuiltinFormat spBuiltinFormats_es_DO[] =
     912             : {
     913             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     914             :     NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( "\"RD$\"", "" ),
     915             :     NUMFMT_ENDTABLE()
     916             : };
     917             : 
     918             : /** Spanish, Ecuador. */
     919             : static const BuiltinFormat spBuiltinFormats_es_EC[] =
     920             : {
     921             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "h", "h" ),
     922             :     NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( "$", " " ),
     923             :     NUMFMT_ENDTABLE()
     924             : };
     925             : 
     926             : /** Spanish, Spain. */
     927             : static const BuiltinFormat spBuiltinFormats_es_ES[] =
     928             : {
     929             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "h", "h" ),
     930             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( UTF8_EURO, "_" UTF8_EURO, " " ),
     931             :     NUMFMT_ENDTABLE()
     932             : };
     933             : 
     934             : /** Spanish, Guatemala. */
     935             : static const BuiltinFormat spBuiltinFormats_es_GT[] =
     936             : {
     937             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     938             :     NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( "\\Q", "" ),
     939             :     NUMFMT_ENDTABLE()
     940             : };
     941             : 
     942             : /** Spanish, Honduras. */
     943             : static const BuiltinFormat spBuiltinFormats_es_HN[] =
     944             : {
     945             :     // slashes must be quoted to prevent conversion to minus
     946             :     NUMFMT_ALLDATETIMES( "DD\\/MM\\/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     947             :     NUMFMT_ALLCURRENCIES_SYMBOL_MINUS_NUMBER( "\"L.\"", " " ),
     948             :     NUMFMT_ENDTABLE()
     949             : };
     950             : 
     951             : /** Spanish, Mexico. */
     952             : static const BuiltinFormat spBuiltinFormats_es_MX[] =
     953             : {
     954             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     955             :     NUMFMT_ALLCURRENCIES_MINUS_SYMBOL_NUMBER( "$", "" ),
     956             :     NUMFMT_ENDTABLE()
     957             : };
     958             : 
     959             : /** Spanish, Nicaragua. */
     960             : static const BuiltinFormat spBuiltinFormats_es_NI[] =
     961             : {
     962             :     // slashes must be quoted to prevent conversion to minus
     963             :     NUMFMT_ALLDATETIMES( "DD\\/MM\\/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     964             :     NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( "\"C$\"", " " ),
     965             :     NUMFMT_ENDTABLE()
     966             : };
     967             : 
     968             : /** Spanish, Panama. */
     969             : static const BuiltinFormat spBuiltinFormats_es_PA[] =
     970             : {
     971             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     972             :     NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( "\"B/.\"", " " ),
     973             :     NUMFMT_ENDTABLE()
     974             : };
     975             : 
     976             : /** Spanish, Peru. */
     977             : static const BuiltinFormat spBuiltinFormats_es_PE[] =
     978             : {
     979             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     980             :     NUMFMT_ALLCURRENCIES_SYMBOL_MINUS_NUMBER( "\"S/.\"", " " ),
     981             :     NUMFMT_ENDTABLE()
     982             : };
     983             : 
     984             : /** Spanish, Puerto Rico. */
     985             : static const BuiltinFormat spBuiltinFormats_es_PR[] =
     986             : {
     987             :     // slashes must be quoted to prevent conversion to minus
     988             :     NUMFMT_ALLDATETIMES( "DD\\/MM\\/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     989             :     NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( "$", " " ),
     990             :     NUMFMT_ENDTABLE()
     991             : };
     992             : 
     993             : /** Spanish, Paraguay. */
     994             : static const BuiltinFormat spBuiltinFormats_es_PY[] =
     995             : {
     996             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
     997             :     NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( "\"Gs\"", " " ),
     998             :     NUMFMT_ENDTABLE()
     999             : };
    1000             : 
    1001             : /** Spanish, El Salvador. */
    1002             : static const BuiltinFormat spBuiltinFormats_es_SV[] =
    1003             : {
    1004             :     // slashes must be quoted to prevent conversion to minus
    1005             :     NUMFMT_ALLDATETIMES( "DD\\/MM\\/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
    1006             :     NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( "$", "" ),
    1007             :     NUMFMT_ENDTABLE()
    1008             : };
    1009             : 
    1010             : /** Spanish, Uruguay. */
    1011             : static const BuiltinFormat spBuiltinFormats_es_UY[] =
    1012             : {
    1013             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
    1014             :     NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( "\"$U\"", " " ),
    1015             :     NUMFMT_ENDTABLE()
    1016             : };
    1017             : 
    1018             : /** Spanish, Venezuela. */
    1019             : static const BuiltinFormat spBuiltinFormats_es_VE[] =
    1020             : {
    1021             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
    1022             :     NUMFMT_ALLCURRENCIES_SYMBOL_MINUS_NUMBER( "Bs", " " ),
    1023             :     NUMFMT_ENDTABLE()
    1024             : };
    1025             : 
    1026             : /** Estonian, Estonia. */
    1027             : static const BuiltinFormat spBuiltinFormats_et_EE[] =
    1028             : {
    1029             :     // space character is group separator, literal spaces must be quoted
    1030             :     NUMFMT_ALLDATETIMES( "D.MM.YYYY", "D", ".", "MMM", ".", "YY", "h", "h" ),
    1031             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( "\"kr\"", "_k_r", "\\ " ),
    1032             :     NUMFMT_ENDTABLE()
    1033             : };
    1034             : 
    1035             : /** Farsi, Iran. */
    1036             : static const BuiltinFormat spBuiltinFormats_fa_IR[] =
    1037             : {
    1038             :     NUMFMT_ALLDATETIMES( "YYYY/MM/DD", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
    1039             :     NUMFMT_ALLCURRENCIES_SYMBOL_NUMBER_MINUS( "\"" UTF8_CURR_FA_IR "\"", " " ),
    1040             :     NUMFMT_ENDTABLE()
    1041             : };
    1042             : 
    1043             : /** Finnish, Finland. */
    1044             : static const BuiltinFormat spBuiltinFormats_fi_FI[] =
    1045             : {
    1046             :     // space character is group separator, literal spaces must be quoted
    1047             :     NUMFMT_STRING(  9, "0\\ %" ),
    1048             :     NUMFMT_STRING( 10, "0.00\\ %" ),
    1049             :     NUMFMT_ALLDATETIMES( "D.M.YYYY", "D", ".", "MMM", ".", "YY", "h", "h" ),
    1050             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( UTF8_EURO, "_" UTF8_EURO, "\\ " ),
    1051             :     NUMFMT_ENDTABLE()
    1052             : };
    1053             : 
    1054             : /** Faroese, Faroe Islands. */
    1055             : static const BuiltinFormat spBuiltinFormats_fo_FO[] =
    1056             : {
    1057             :     NUMFMT_ALLDATETIMES( "DD-MM-YYYY", "DD", "-", "MMM", "-", "YY", "h", "hh" ),
    1058             :     NUMFMT_ALLCURRENCIES_SYMBOL_MINUS_NUMBER( "\"kr\"", " " ),
    1059             :     NUMFMT_ENDTABLE()
    1060             : };
    1061             : 
    1062             : /** French, Belgium. */
    1063             : static const BuiltinFormat spBuiltinFormats_fr_BE[] =
    1064             : {
    1065             :     NUMFMT_ALLDATETIMES( "D/MM/YYYY", "D", "-", "MMM", "-", "YY", "h", "h" ),
    1066             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( UTF8_EURO, "_" UTF8_EURO, " " ),
    1067             :     NUMFMT_ENDTABLE()
    1068             : };
    1069             : 
    1070             : /** French, Canada. */
    1071             : static const BuiltinFormat spBuiltinFormats_fr_CA[] =
    1072             : {
    1073             :     // space character is group separator, literal spaces must be quoted
    1074             :     NUMFMT_ALLDATETIMES( "YYYY-MM-DD", "DD", "-", "MMM", "-", "YY", "h", "hh" ),
    1075             :     NUMFMT_ALLCURRENCIES_OPEN_NUMBER_SYMBOL_CLOSE( "$", "_$", "\\ " ),
    1076             :     NUMFMT_ENDTABLE()
    1077             : };
    1078             : 
    1079             : /** French, Switzerland. */
    1080             : static const BuiltinFormat spBuiltinFormats_fr_CH[] =
    1081             : {
    1082             :     NUMFMT_ALLDATETIMES( "DD.MM.YYYY", "DD", ".", "MMM", ".", "YY", "h", "hh" ),
    1083             :     NUMFMT_ALLCURRENCIES_SYMBOL_MINUS_NUMBER( "\"SFr.\"", " " ),
    1084             :     NUMFMT_ENDTABLE()
    1085             : };
    1086             : 
    1087             : /** French, France. */
    1088             : static const BuiltinFormat spBuiltinFormats_fr_FR[] =
    1089             : {
    1090             :     // space character is group separator, literal spaces must be quoted
    1091             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "h", "hh" ),
    1092             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( UTF8_EURO, "_" UTF8_EURO, "\\ " ),
    1093             :     NUMFMT_ENDTABLE()
    1094             : };
    1095             : 
    1096             : /** French, Luxembourg. */
    1097             : static const BuiltinFormat spBuiltinFormats_fr_LU[] =
    1098             : {
    1099             :     // space character is group separator, literal spaces must be quoted
    1100             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "h", "hh" ),
    1101             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( UTF8_EURO, "_" UTF8_EURO, "\\ " ),
    1102             :     NUMFMT_ENDTABLE()
    1103             : };
    1104             : 
    1105             : /** French, Monaco. */
    1106             : static const BuiltinFormat spBuiltinFormats_fr_MC[] =
    1107             : {
    1108             :     // space character is group separator, literal spaces must be quoted
    1109             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "h", "hh" ),
    1110             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( UTF8_EURO, "_" UTF8_EURO, "\\ " ),
    1111             :     NUMFMT_ENDTABLE()
    1112             : };
    1113             : 
    1114             : /** Galizian, Spain. */
    1115             : static const BuiltinFormat spBuiltinFormats_gl_ES[] =
    1116             : {
    1117             :     NUMFMT_ALLDATETIMES( "DD/MM/YY", "DD", "-", "MMM", "-", "YY", "h", "h" ),
    1118             :     NUMFMT_ALLCURRENCIES_MINUS_SYMBOL_NUMBER( UTF8_EURO, " " ),
    1119             :     NUMFMT_ENDTABLE()
    1120             : };
    1121             : 
    1122             : /** Gujarati, India. */
    1123             : static const BuiltinFormat spBuiltinFormats_gu_IN[] =
    1124             : {
    1125             :     NUMFMT_ALLDATETIMES( "DD-MM-YY", "DD", "-", "MMM", "-", "YY", "h", "hh" ),
    1126             :     NUMFMT_ALLCURRENCIES_SYMBOL_MINUS_NUMBER( "\"" UTF8_CURR_GU_IN "\"", " " ),
    1127             :     NUMFMT_ENDTABLE()
    1128             : };
    1129             : 
    1130             : /** Hebrew, Israel. */
    1131             : static const BuiltinFormat spBuiltinFormats_he_IL[] =
    1132             : {
    1133             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "h", "hh" ),
    1134             :     NUMFMT_ALLCURRENCIES_SYMBOL_MINUS_NUMBER( UTF8_SHEQEL, " " ),
    1135             :     NUMFMT_ENDTABLE()
    1136             : };
    1137             : 
    1138             : /** Hindi, India. */
    1139             : static const BuiltinFormat spBuiltinFormats_hi_IN[] =
    1140             : {
    1141             :     NUMFMT_ALLDATETIMES( "DD-MM-YYYY", "DD", "-", "MMM", "-", "YY", "h", "hh" ),
    1142             :     NUMFMT_ALLCURRENCIES_SYMBOL_MINUS_NUMBER( "\"" UTF8_CURR_HI_IN "\"", " " ),
    1143             :     NUMFMT_ENDTABLE()
    1144             : };
    1145             : 
    1146             : /** Croatian, Bosnia and Herzegowina. */
    1147             : static const BuiltinFormat spBuiltinFormats_hr_BA[] =
    1148             : {
    1149             :     NUMFMT_ALLDATETIMES( "D.M.YYYY", "D", ".", "MMM", ".", "YY", "h", "h" ),
    1150             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( "\"KM\"", "_K_M", " " ),
    1151             :     NUMFMT_ENDTABLE()
    1152             : };
    1153             : 
    1154             : /** Croatian, Croatia. */
    1155             : static const BuiltinFormat spBuiltinFormats_hr_HR[] =
    1156             : {
    1157             :     NUMFMT_ALLDATETIMES( "D.M.YYYY", "D", ".", "MMM", ".", "YY", "h", "h" ),
    1158             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( "\"kn\"", "_k_n", " " ),
    1159             :     NUMFMT_ENDTABLE()
    1160             : };
    1161             : 
    1162             : /** Hungarian, Hungary. */
    1163             : static const BuiltinFormat spBuiltinFormats_hu_HU[] =
    1164             : {
    1165             :     // space character is group separator, literal spaces must be quoted
    1166             :     // MMM is rendered differently in Calc and Excel (see #i41488#)
    1167             :     NUMFMT_ALLDATETIMES( "YYYY.MM.DD", "DD", ".", "MMM", ".", "YY", "h", "h" ),
    1168             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( "\"Ft\"", "_F_t", "\\ " ),
    1169             :     NUMFMT_ENDTABLE()
    1170             : };
    1171             : 
    1172             : /** Armenian, Armenia. */
    1173             : static const BuiltinFormat spBuiltinFormats_hy_AM[] =
    1174             : {
    1175             :     NUMFMT_ALLDATETIMES( "DD.MM.YYYY", "DD", ".", "MMM", ".", "YY", "h", "h" ),
    1176             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( "\"" UTF8_HY_DA_LC UTF8_HY_REH_LC ".\"", "_" UTF8_HY_DA_LC "_" UTF8_HY_REH_LC "_.", " " ),
    1177             :     NUMFMT_ENDTABLE()
    1178             : };
    1179             : 
    1180             : /** Indonesian, Indonesia. */
    1181             : static const BuiltinFormat spBuiltinFormats_id_ID[] =
    1182             : {
    1183             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "h", "h" ),
    1184             :     NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( "\"Rp\"", "" ),
    1185             :     NUMFMT_ENDTABLE()
    1186             : };
    1187             : 
    1188             : /** Icelandic, Iceland. */
    1189             : static const BuiltinFormat spBuiltinFormats_is_IS[] =
    1190             : {
    1191             :     NUMFMT_ALLDATETIMES( "D.M.YYYY", "D", ".", "MMM", ".", "YY", "h", "hh" ),
    1192             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( "\"kr.\"", "_k_r_.", " " ),
    1193             :     NUMFMT_ENDTABLE()
    1194             : };
    1195             : 
    1196             : /** Italian, Switzerland. */
    1197             : static const BuiltinFormat spBuiltinFormats_it_CH[] =
    1198             : {
    1199             :     NUMFMT_ALLDATETIMES( "DD.MM.YYYY", "DD", ".", "MMM", ".", "YY", "h", "hh" ),
    1200             :     NUMFMT_ALLCURRENCIES_SYMBOL_MINUS_NUMBER( "\"SFr.\"", " " ),
    1201             :     NUMFMT_ENDTABLE()
    1202             : };
    1203             : 
    1204             : /** Italian, Italy. */
    1205             : static const BuiltinFormat spBuiltinFormats_it_IT[] =
    1206             : {
    1207             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "h", "h" ),
    1208             :     NUMFMT_ALLCURRENCIES_MINUS_SYMBOL_NUMBER( UTF8_EURO, " " ),
    1209             :     NUMFMT_ENDTABLE()
    1210             : };
    1211             : 
    1212             : /** Georgian, Georgia. */
    1213             : static const BuiltinFormat spBuiltinFormats_ka_GE[] =
    1214             : {
    1215             :     // space character is group separator, literal spaces must be quoted
    1216             :     NUMFMT_ALLDATETIMES( "DD.MM.YYYY", "DD", ".", "MMM", ".", "YY", "h", "h" ),
    1217             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( "\"Lari\"", "_L_a_r_i", "\\ " ),
    1218             :     NUMFMT_ENDTABLE()
    1219             : };
    1220             : 
    1221             : /** Kazakh, Kazakhstan. */
    1222             : static const BuiltinFormat spBuiltinFormats_kk_KZ[] =
    1223             : {
    1224             :     // space character is group separator, literal spaces must be quoted
    1225             :     NUMFMT_ALLDATETIMES( "DD.MM.YYYY", "DD", ".", "MMM", ".", "YY", "h", "h" ),
    1226             :     NUMFMT_ALLCURRENCIES_MINUS_SYMBOL_NUMBER( "\\T", "" ),
    1227             :     NUMFMT_ENDTABLE()
    1228             : };
    1229             : 
    1230             : /** Kannada, India. */
    1231             : static const BuiltinFormat spBuiltinFormats_kn_IN[] =
    1232             : {
    1233             :     NUMFMT_ALLDATETIMES( "DD-MM-YY", "DD", "-", "MMM", "-", "YY", "h", "hh" ),
    1234             :     NUMFMT_ALLCURRENCIES_SYMBOL_MINUS_NUMBER( "\"" UTF8_CURR_KN_IN "\"", " " ),
    1235             :     NUMFMT_ENDTABLE()
    1236             : };
    1237             : 
    1238             : /** Kyrgyz, Kyrgyzstan. */
    1239             : static const BuiltinFormat spBuiltinFormats_ky_KG[] =
    1240             : {
    1241             :     // space character is group separator, literal spaces must be quoted
    1242             :     NUMFMT_ALLDATETIMES( "DD.MM.YY", "DD", ".", "MMM", ".", "YY", "h", "h" ),
    1243             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( "\"" UTF8_CYR_S_LC UTF8_CYR_O_LC UTF8_CYR_M_LC "\"", "_" UTF8_CYR_S_LC "_" UTF8_CYR_O_LC "_" UTF8_CYR_M_LC, "\\ " ),
    1244             :     NUMFMT_ENDTABLE()
    1245             : };
    1246             : 
    1247             : /** Lithuanian, Lithuania. */
    1248             : static const BuiltinFormat spBuiltinFormats_lt_LT[] =
    1249             : {
    1250             :     NUMFMT_ALLDATETIMES( "YYYY.MM.DD", "DD", ".", "MMM", ".", "YY", "h", "hh" ),
    1251             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( "\"Lt\"", "_L_t", " " ),
    1252             :     NUMFMT_ENDTABLE()
    1253             : };
    1254             : 
    1255             : /** Latvian, Latvia. */
    1256             : static const BuiltinFormat spBuiltinFormats_lv_LV[] =
    1257             : {
    1258             :     // space character is group separator, literal spaces must be quoted
    1259             :     NUMFMT_ALLDATETIMES( "YYYY.MM.DD", "DD", ".", "MMM", ".", "YY", "h", "h" ),
    1260             :     NUMFMT_ALLCURRENCIES_MINUS_SYMBOL_NUMBER( "\"Ls\"", "\\ " ),
    1261             :     NUMFMT_ENDTABLE()
    1262             : };
    1263             : 
    1264             : /** Malayalam, India. */
    1265             : static const BuiltinFormat spBuiltinFormats_ml_IN[] =
    1266             : {
    1267             :     NUMFMT_ALLDATETIMES( "DD-MM-YY", "DD", "-", "MMM", "-", "YY", "h", "hh" ),
    1268             :     NUMFMT_ALLCURRENCIES_SYMBOL_MINUS_NUMBER( "\"" UTF8_CURR_ML_IN "\"", " " ),
    1269             :     NUMFMT_ENDTABLE()
    1270             : };
    1271             : 
    1272             : /** Mongolian, Mongolia. */
    1273             : static const BuiltinFormat spBuiltinFormats_mn_MN[] =
    1274             : {
    1275             :     NUMFMT_ALLDATETIMES( "YY.MM.DD", "DD", ".", "MMM", ".", "YY", "h", "h" ),
    1276             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( UTF8_TUGRUG, "_" UTF8_TUGRUG, "" ),
    1277             :     NUMFMT_ENDTABLE()
    1278             : };
    1279             : 
    1280             : /** Malay, Brunei Darussalam. */
    1281             : static const BuiltinFormat spBuiltinFormats_ms_BN[] =
    1282             : {
    1283             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "h", "h" ),
    1284             :     NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( "$", "" ),
    1285             :     NUMFMT_ENDTABLE()
    1286             : };
    1287             : 
    1288             : /** Malay, Malaysia. */
    1289             : static const BuiltinFormat spBuiltinFormats_ms_MY[] =
    1290             : {
    1291             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "h", "h" ),
    1292             :     NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( "\\R", "" ),
    1293             :     NUMFMT_ENDTABLE()
    1294             : };
    1295             : 
    1296             : /** Maltese, Malta. */
    1297             : static const BuiltinFormat spBuiltinFormats_mt_MT[] =
    1298             : {
    1299             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "h", "hh" ),
    1300             :     NUMFMT_ALLCURRENCIES_MINUS_SYMBOL_NUMBER( "\"Lm\"", "" ),
    1301             :     NUMFMT_ENDTABLE()
    1302             : };
    1303             : 
    1304             : /** Dutch, Belgium. */
    1305             : static const BuiltinFormat spBuiltinFormats_nl_BE[] =
    1306             : {
    1307             :     // slashes must be quoted to prevent conversion to minus
    1308             :     NUMFMT_ALLDATETIMES( "D\\/MM\\/YYYY", "D", "\\/", "MMM", "\\/", "YY", "h", "h" ),
    1309             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( UTF8_EURO, "_" UTF8_EURO, " " ),
    1310             :     NUMFMT_ENDTABLE()
    1311             : };
    1312             : 
    1313             : /** Dutch, Netherlands. */
    1314             : static const BuiltinFormat spBuiltinFormats_nl_NL[] =
    1315             : {
    1316             :     NUMFMT_ALLDATETIMES( "D-M-YYYY", "D", "-", "MMM", "-", "YY", "h", "h" ),
    1317             :     NUMFMT_ALLCURRENCIES_SYMBOL_NUMBER_MINUS( UTF8_EURO, " " ),
    1318             :     NUMFMT_ENDTABLE()
    1319             : };
    1320             : 
    1321             : /** Norwegian (Bokmal and Nynorsk), Norway. */
    1322             : static const BuiltinFormat spBuiltinFormats_no_NO[] =
    1323             : {
    1324             :     // space character is group separator, literal spaces must be quoted
    1325             :     NUMFMT_ALLDATETIMES( "DD.MM.YYYY", "DD", ".", "MMM", ".", "YY", "h", "hh" ),
    1326             :     NUMFMT_ALLCURRENCIES_SYMBOL_MINUS_NUMBER( "\"kr\"", "\\ " ),
    1327             :     NUMFMT_ENDTABLE()
    1328             : };
    1329             : 
    1330             : /** Punjabi, India. */
    1331             : static const BuiltinFormat spBuiltinFormats_pa_IN[] =
    1332             : {
    1333             :     NUMFMT_ALLDATETIMES( "DD-MM-YY", "DD", "-", "MMM", "-", "YY", "hh", "hh" ),
    1334             :     NUMFMT_ALLCURRENCIES_SYMBOL_MINUS_NUMBER( "\"" UTF8_CURR_PA_IN "\"", " " ),
    1335             :     NUMFMT_ENDTABLE()
    1336             : };
    1337             : 
    1338             : /** Polish, Poland. */
    1339             : static const BuiltinFormat spBuiltinFormats_pl_PL[] =
    1340             : {
    1341             :     // space character is group separator, literal spaces must be quoted
    1342             :     // MMM is rendered differently in Calc and Excel (see #i72300#)
    1343             :     NUMFMT_ALLDATETIMES( "YYYY-MM-DD", "DD", "-", "MMM", "-", "YY", "h", "hh" ),
    1344             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( "\"z" UTF8_LSTROKE_LC "\"", "_z_" UTF8_LSTROKE_LC, "\\ " ),
    1345             :     NUMFMT_ENDTABLE()
    1346             : };
    1347             : 
    1348             : /** Portugese, Brazil. */
    1349             : static const BuiltinFormat spBuiltinFormats_pt_BR[] =
    1350             : {
    1351             :     NUMFMT_ALLDATETIMES( "D/M/YYYY", "D", "/", "MMM", "/", "YY", "h", "hh" ),
    1352             :     NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( "\"R$\"", " " ),
    1353             :     NUMFMT_ENDTABLE()
    1354             : };
    1355             : 
    1356             : /** Portugese, Portugal. */
    1357             : static const BuiltinFormat spBuiltinFormats_pt_PT[] =
    1358             : {
    1359             :     NUMFMT_ALLDATETIMES( "DD-MM-YYYY", "DD", "-", "MMM", "-", "YY", "h", "h" ),
    1360             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( UTF8_EURO, "_" UTF8_EURO, " " ),
    1361             :     NUMFMT_ENDTABLE()
    1362             : };
    1363             : 
    1364             : /** Romanian, Romania. */
    1365             : static const BuiltinFormat spBuiltinFormats_ro_RO[] =
    1366             : {
    1367             :     // space character is group separator, literal spaces must be quoted (but see #i75367#)
    1368             :     NUMFMT_ALLDATETIMES( "DD.MM.YYYY", "DD", ".", "MMM", ".", "YY", "h", "hh" ),
    1369             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( "\"lei\"", "_l_e_i", "\\ " ),
    1370             :     NUMFMT_ENDTABLE()
    1371             : };
    1372             : 
    1373             : /** Russian, Russian Federation. */
    1374             : static const BuiltinFormat spBuiltinFormats_ru_RU[] =
    1375             : {
    1376             :     // space character is group separator, literal spaces must be quoted
    1377             :     NUMFMT_ALLDATETIMES( "DD.MM.YYYY", "DD", ".", "MMM", ".", "YY", "h", "h" ),
    1378             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( "\"" UTF8_CYR_R_LC ".\"", "_" UTF8_CYR_R_LC "_.", "" ),
    1379             :     NUMFMT_ENDTABLE()
    1380             : };
    1381             : 
    1382             : /** Slovak, Slovakia. */
    1383             : static const BuiltinFormat spBuiltinFormats_sk_SK[] =
    1384             : {
    1385             :     // space character is group separator, literal spaces must be quoted
    1386             :     NUMFMT_ALLDATETIMES( "D.M.YYYY", "D", ".", "MMM", ".", "YY", "h", "h" ),
    1387             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( "\"Sk\"", "_S_k", "\\ " ),
    1388             :     NUMFMT_ENDTABLE()
    1389             : };
    1390             : 
    1391             : /** Slovenian, Slovenia. */
    1392             : static const BuiltinFormat spBuiltinFormats_sl_SI[] =
    1393             : {
    1394             :     NUMFMT_ALLDATETIMES( "D.M.YYYY", "D", ".", "MMM", ".", "YY", "h", "h" ),
    1395             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( "\"SIT\"", "_S_I_T", " " ),
    1396             :     NUMFMT_ENDTABLE()
    1397             : };
    1398             : 
    1399             : /** Swedish, Finland. */
    1400             : static const BuiltinFormat spBuiltinFormats_sv_FI[] =
    1401             : {
    1402             :     // space character is group separator, literal spaces must be quoted
    1403             :     NUMFMT_STRING(  9, "0\\ %" ),
    1404             :     NUMFMT_STRING( 10, "0.00\\ %" ),
    1405             :     NUMFMT_ALLDATETIMES( "D.M.YYYY", "D", ".", "MMM", ".", "YY", "h", "hh" ),
    1406             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( UTF8_EURO, "_" UTF8_EURO, "\\ " ),
    1407             :     NUMFMT_ENDTABLE()
    1408             : };
    1409             : 
    1410             : /** Swedish, Sweden. */
    1411             : static const BuiltinFormat spBuiltinFormats_sv_SE[] =
    1412             : {
    1413             :     // space character is group separator, literal spaces must be quoted
    1414             :     NUMFMT_ALLDATETIMES( "YYYY-MM-DD", "DD", "-", "MMM", "-", "YY", "h", "hh" ),
    1415             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( "\"kr\"", "_k_r", "\\ " ),
    1416             :     NUMFMT_ENDTABLE()
    1417             : };
    1418             : 
    1419             : /** Swahili, Tanzania. */
    1420             : static const BuiltinFormat spBuiltinFormats_sw_TZ[] =
    1421             : {
    1422             :     NUMFMT_ALLDATETIMES( "M/D/YYYY", "D", "-", "MMM", "-", "YY", "h", "h" ),
    1423             :     NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( "\\S", "" ),
    1424             :     NUMFMT_ENDTABLE()
    1425             : };
    1426             : 
    1427             : /** Tamil, India. */
    1428             : static const BuiltinFormat spBuiltinFormats_ta_IN[] =
    1429             : {
    1430             :     NUMFMT_ALLDATETIMES( "DD-MM-YYYY", "DD", "-", "MMM", "-", "YY", "h", "hh" ),
    1431             :     NUMFMT_ALLCURRENCIES_SYMBOL_MINUS_NUMBER( "\"" UTF8_CURR_TA_IN "\"", " " ),
    1432             :     NUMFMT_ENDTABLE()
    1433             : };
    1434             : 
    1435             : /** Telugu, India. */
    1436             : static const BuiltinFormat spBuiltinFormats_te_IN[] =
    1437             : {
    1438             :     NUMFMT_ALLDATETIMES( "DD-MM-YY", "DD", "-", "MMM", "-", "YY", "h", "hh" ),
    1439             :     NUMFMT_ALLCURRENCIES_SYMBOL_MINUS_NUMBER( "\"" UTF8_CURR_TE_IN "\"", " " ),
    1440             :     NUMFMT_ENDTABLE()
    1441             : };
    1442             : 
    1443             : /** Thai, Thailand. */
    1444             : static const BuiltinFormat spBuiltinFormats_th_TH[] =
    1445             : {
    1446             :     NUMFMT_ALLDATETIMES( "D/M/YYYY", "D", "-", "MMM", "-", "YY", "h", "h" ),
    1447             :     NUMFMT_ALLCURRENCIES_MINUS_SYMBOL_NUMBER( UTF8_BAHT, "" ),
    1448             :     NUMFMT_CURRENCY_OPEN_SYMBOL_NUMBER_CLOSE( 63, UTF8_BAHT, "", "t" ),
    1449             :     NUMFMT_STRING( 59, "t0" ),
    1450             :     NUMFMT_STRING( 60, "t0.00" ),
    1451             :     NUMFMT_STRING( 61, "t#,##0" ),
    1452             :     NUMFMT_STRING( 62, "t#,##0.00" ),
    1453             :     NUMFMT_STRING( 67, "t0%" ),
    1454             :     NUMFMT_STRING( 68, "t0.00%" ),
    1455             :     NUMFMT_STRING( 69, "t# ?/?" ),
    1456             :     NUMFMT_STRING( 70, "t# ?\?/?\?" ),
    1457             :     NUMFMT_STRING( 71, "tD/M/EE" ),
    1458             :     NUMFMT_STRING( 72, "tD-MMM-E" ),
    1459             :     NUMFMT_STRING( 73, "tD-MMM" ),
    1460             :     NUMFMT_STRING( 74, "tMMM-E" ),
    1461             :     NUMFMT_STRING( 75, "th:mm" ),
    1462             :     NUMFMT_STRING( 76, "th:mm:ss" ),
    1463             :     NUMFMT_STRING( 77, "tD/M/EE h:mm" ),
    1464             :     NUMFMT_STRING( 78, "tmm:ss" ),
    1465             :     NUMFMT_STRING( 79, "t[h]:mm:ss" ),
    1466             :     NUMFMT_STRING( 80, "tmm:ss.0" ),
    1467             :     NUMFMT_STRING( 81, "D/M/E" ),
    1468             :     NUMFMT_ENDTABLE()
    1469             : };
    1470             : 
    1471             : /** Turkish, Turkey. */
    1472             : static const BuiltinFormat spBuiltinFormats_tr_TR[] =
    1473             : {
    1474             :     NUMFMT_ALLDATETIMES( "DD.MM.YYYY", "DD", ".", "MMM", ".", "YY", "h", "hh" ),
    1475             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( "\"TL\"", "_T_L", " " ),
    1476             :     NUMFMT_ENDTABLE()
    1477             : };
    1478             : 
    1479             : /** Tatar, Russian Federation. */
    1480             : static const BuiltinFormat spBuiltinFormats_tt_RU[] =
    1481             : {
    1482             :     // space character is group separator, literal spaces must be quoted
    1483             :     NUMFMT_ALLDATETIMES( "DD.MM.YYYY", "DD", ".", "MMM", ".", "YY", "h", "h" ),
    1484             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( "\"" UTF8_CYR_R_LC ".\"", "_" UTF8_CYR_R_LC "_.", "\\ " ),
    1485             :     NUMFMT_ENDTABLE()
    1486             : };
    1487             : 
    1488             : /** Ukrainian, Ukraine. */
    1489             : static const BuiltinFormat spBuiltinFormats_uk_UA[] =
    1490             : {
    1491             :     // space character is group separator, literal spaces must be quoted
    1492             :     NUMFMT_ALLDATETIMES( "DD.MM.YYYY", "DD", ".", "MMM", ".", "YY", "h", "h" ),
    1493             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( "\"" UTF8_CYR_G_LC UTF8_CYR_R_LC UTF8_CYR_N_LC ".\"", "_" UTF8_CYR_G_LC "_" UTF8_CYR_R_LC "_" UTF8_CYR_N_LC "_.", "\\ " ),
    1494             :     NUMFMT_ENDTABLE()
    1495             : };
    1496             : 
    1497             : /** Urdu, Pakistan. */
    1498             : static const BuiltinFormat spBuiltinFormats_ur_PK[] =
    1499             : {
    1500             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "h", "h" ),
    1501             :     NUMFMT_ALLCURRENCIES_SYMBOL_NUMBER_MINUS( "\"Rs\"", "" ),
    1502             :     NUMFMT_ENDTABLE()
    1503             : };
    1504             : 
    1505             : /** Vietnamese, Viet Nam. */
    1506             : static const BuiltinFormat spBuiltinFormats_vi_VN[] =
    1507             : {
    1508             :     NUMFMT_ALLDATETIMES( "DD/MM/YYYY", "DD", "-", "MMM", "-", "YY", "h", "h" ),
    1509             :     NUMFMT_ALLCURRENCIES_MINUS_NUMBER_SYMBOL( UTF8_DONG, "_" UTF8_DONG, " " ),
    1510             :     NUMFMT_ENDTABLE()
    1511             : };
    1512             : 
    1513             : // CJK ------------------------------------------------------------------------
    1514             : 
    1515             : /** Base table for CJK locales. */
    1516             : static const BuiltinFormat spBuiltinFormats_CJK[] =
    1517             : {
    1518             :     NUMFMT_REUSE( 29, 28 ),
    1519             :     NUMFMT_REUSE( 36, 27 ),
    1520             :     NUMFMT_REUSE( 50, 27 ),
    1521             :     NUMFMT_REUSE( 51, 28 ),
    1522             :     NUMFMT_REUSE( 52, 34 ),
    1523             :     NUMFMT_REUSE( 53, 35 ),
    1524             :     NUMFMT_REUSE( 54, 28 ),
    1525             :     NUMFMT_REUSE( 55, 34 ),
    1526             :     NUMFMT_REUSE( 56, 35 ),
    1527             :     NUMFMT_REUSE( 57, 27 ),
    1528             :     NUMFMT_REUSE( 58, 28 ),
    1529             :     NUMFMT_ENDTABLE()
    1530             : };
    1531             : 
    1532             : /** Japanese, Japan. */
    1533             : static const BuiltinFormat spBuiltinFormats_ja_JP[] =
    1534             : {
    1535             :     NUMFMT_ALLDATETIMES( "YYYY/MM/DD", "DD", "-", "MMM", "-", "YY", "h", "h" ),
    1536             :     NUMFMT_ALLCURRENCIES_MINUS_SYMBOL_NUMBER( UTF8_YEN_JP, "" ),
    1537             :     NUMFMT_CURRENCY_OPEN_SYMBOL_NUMBER_CLOSE( 23, "$", "", "" ),
    1538             :     NUMFMT_STRING( 27, "[$-411]GE.MM.DD" ),
    1539             :     NUMFMT_STRING( 28, "[$-411]GGGE\"" UTF8_CJ_YEAR "\"MM\"" UTF8_CJ_MON "\"DD\"" UTF8_CJ_DAY "\"" ),
    1540             :     NUMFMT_STRING( 30, "MM/DD/YY" ),
    1541             :     NUMFMT_STRING( 31, "YYYY\"" UTF8_CJ_YEAR "\"MM\"" UTF8_CJ_MON "\"DD\"" UTF8_CJ_DAY "\"" ),
    1542             :     NUMFMT_TIME_CJK( 32, "h", UTF8_CJ_HOUR, UTF8_CJ_MIN, UTF8_CJ_SEC ),
    1543             :     NUMFMT_STRING( 34, "YYYY\"" UTF8_CJ_YEAR "\"MM\"" UTF8_CJ_MON "\"" ),
    1544             :     NUMFMT_STRING( 35, "MM\"" UTF8_CJ_MON "\"DD\"" UTF8_CJ_DAY "\"" ),
    1545             :     NUMFMT_ENDTABLE()
    1546             : };
    1547             : 
    1548             : /** Korean, South Korea. */
    1549             : static const BuiltinFormat spBuiltinFormats_ko_KR[] =
    1550             : {
    1551             :     NUMFMT_ALLDATETIMES( "YYYY-MM-DD", "DD", "-", "MMM", "-", "YY", "h", "h" ),
    1552             :     NUMFMT_ALLCURRENCIES_MINUS_SYMBOL_NUMBER( UTF8_WON, "" ),
    1553             :     NUMFMT_CURRENCY_OPEN_SYMBOL_NUMBER_CLOSE( 23, "$", "", "" ),
    1554             :     NUMFMT_STRING( 27, "YYYY" UTF8_CJ_YEAR " MM" UTF8_CJ_MON " DD" UTF8_CJ_DAY ),
    1555             :     NUMFMT_STRING( 28, "MM-DD" ),
    1556             :     NUMFMT_STRING( 30, "MM-DD-YY" ),
    1557             :     NUMFMT_STRING( 31, "YYYY" UTF8_KO_YEAR " MM" UTF8_KO_MON " DD" UTF8_KO_DAY ),
    1558             :     NUMFMT_TIME_CJK( 32, "h", UTF8_KO_HOUR, UTF8_KO_MIN, UTF8_KO_SEC ),
    1559             :     // slashes must be quoted to prevent conversion to minus
    1560             :     NUMFMT_STRING( 34, "YYYY\\/MM\\/DD" ),
    1561             :     NUMFMT_REUSE( 35, 14 ),
    1562             :     NUMFMT_ENDTABLE()
    1563             : };
    1564             : 
    1565             : /** Chinese, China. */
    1566             : static const BuiltinFormat spBuiltinFormats_zh_CN[] =
    1567             : {
    1568             :     NUMFMT_ALLDATETIMES( "YYYY-M-D", "D", "-", "MMM", "-", "YY", "h", "h" ),
    1569             :     NUMFMT_ALLCURRENCIES_SYMBOL_MINUS_NUMBER( UTF8_YEN_CN, "" ),
    1570             :     NUMFMT_ALLTIMES_CJK( "h", "h", UTF8_CS_HOUR, UTF8_CS_MIN, UTF8_CS_SEC ),
    1571             :     NUMFMT_CURRENCY_OPEN_SYMBOL_NUMBER_CLOSE( 23, "$", "", "" ),
    1572             :     NUMFMT_STRING( 27, "YYYY\"" UTF8_CS_YEAR "\"M\"" UTF8_CS_MON "\"" ),
    1573             :     NUMFMT_STRING( 28, "M\"" UTF8_CS_MON "\"D\"" UTF8_CS_DAY "\"" ),
    1574             :     NUMFMT_STRING( 30, "M-D-YY" ),
    1575             :     NUMFMT_STRING( 31, "YYYY\"" UTF8_CS_YEAR "\"M\"" UTF8_CS_MON "\"D\"" UTF8_CS_DAY "\"" ),
    1576             :     NUMFMT_REUSE( 52, 27 ),
    1577             :     NUMFMT_REUSE( 53, 28 ),
    1578             :     NUMFMT_ENDTABLE()
    1579             : };
    1580             : 
    1581             : /** Chinese, Hong Kong. */
    1582             : static const BuiltinFormat spBuiltinFormats_zh_HK[] =
    1583             : {
    1584             :     NUMFMT_ALLDATETIMES( "D/M/YYYY", "D", "-", "MMM", "-", "YY", "h", "h" ),
    1585             :     NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( "\"HK$\"", "" ),
    1586             :     NUMFMT_ALLTIMES_CJK( "h", "h", UTF8_CJ_HOUR, UTF8_CJ_MIN, UTF8_CJ_SEC ),
    1587             :     NUMFMT_CURRENCY_OPEN_SYMBOL_NUMBER_CLOSE( 23, "\"US$\"", "", "" ),
    1588             :     NUMFMT_STRING( 27, "[$-404]D/M/E" ),
    1589             :     NUMFMT_STRING( 28, "[$-404]D\"" UTF8_CJ_DAY "\"M\"" UTF8_CJ_MON "\"E\"" UTF8_CJ_YEAR "\"" ),
    1590             :     NUMFMT_STRING( 30, "M/D/YY" ),
    1591             :     NUMFMT_STRING( 31, "D\"" UTF8_CJ_DAY "\"M\"" UTF8_CJ_MON "\"YYYY\"" UTF8_CJ_YEAR "\"" ),
    1592             :     NUMFMT_ENDTABLE()
    1593             : };
    1594             : 
    1595             : /** Chinese, Macau. */
    1596             : static const BuiltinFormat spBuiltinFormats_zh_MO[] =
    1597             : {
    1598             :     NUMFMT_ALLDATETIMES( "D/M/YYYY", "D", "-", "MMM", "-", "YY", "h", "h" ),
    1599             :     NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( "\\P", "" ),
    1600             :     NUMFMT_ALLTIMES_CJK( "h", "h", UTF8_CJ_HOUR, UTF8_CJ_MIN, UTF8_CJ_SEC ),
    1601             :     NUMFMT_CURRENCY_OPEN_SYMBOL_NUMBER_CLOSE( 23, "\"US$\"", "", "" ),
    1602             :     NUMFMT_STRING( 27, "[$-404]D/M/E" ),
    1603             :     NUMFMT_STRING( 28, "[$-404]D\"" UTF8_CJ_DAY "\"M\"" UTF8_CJ_MON "\"E\"" UTF8_CJ_YEAR "\"" ),
    1604             :     NUMFMT_STRING( 30, "M/D/YY" ),
    1605             :     NUMFMT_STRING( 31, "D\"" UTF8_CJ_DAY "\"M\"" UTF8_CJ_MON "\"YYYY\"" UTF8_CJ_YEAR "\"" ),
    1606             :     NUMFMT_ENDTABLE()
    1607             : };
    1608             : 
    1609             : /** Chinese, Singapore. */
    1610             : static const BuiltinFormat spBuiltinFormats_zh_SG[] =
    1611             : {
    1612             :     NUMFMT_ALLDATETIMES( "D/M/YYYY", "D", "-", "MMM", "-", "YY", "h", "h" ),
    1613             :     NUMFMT_ALLCURRENCIES_OPEN_SYMBOL_NUMBER_CLOSE( "$", "" ),
    1614             :     NUMFMT_ALLTIMES_CJK( "h", "h", UTF8_CS_HOUR, UTF8_CS_MIN, UTF8_CS_SEC ),
    1615             :     NUMFMT_CURRENCY_OPEN_SYMBOL_NUMBER_CLOSE( 23, "$", "", "" ),
    1616             :     NUMFMT_STRING( 27, "YYYY\"" UTF8_CS_YEAR "\"M\"" UTF8_CS_MON "\"" ),
    1617             :     NUMFMT_STRING( 28, "M\"" UTF8_CS_MON "\"D\"" UTF8_CS_DAY "\"" ),
    1618             :     NUMFMT_STRING( 30, "M/D/YY" ),
    1619             :     NUMFMT_STRING( 31, "D\"" UTF8_CS_DAY "\"M\"" UTF8_CS_MON "\"YYYY\"" UTF8_CS_YEAR "\"" ),
    1620             :     NUMFMT_ENDTABLE()
    1621             : };
    1622             : 
    1623             : /** Chinese, Taiwan. */
    1624             : static const BuiltinFormat spBuiltinFormats_zh_TW[] =
    1625             : {
    1626             :     NUMFMT_ALLDATETIMES( "YYYY/M/D", "D", "-", "MMM", "-", "YY", "hh", "hh" ),
    1627             :     NUMFMT_ALLCURRENCIES_MINUS_SYMBOL_NUMBER( "$", "" ),
    1628             :     NUMFMT_ALLTIMES_CJK( "hh", "hh", UTF8_CJ_HOUR, UTF8_CJ_MIN, UTF8_CJ_SEC ),
    1629             :     NUMFMT_CURRENCY_OPEN_SYMBOL_NUMBER_CLOSE( 23, "\"US$\"", "", "" ),
    1630             :     NUMFMT_STRING( 27, "[$-404]E/M/D" ),
    1631             :     NUMFMT_STRING( 28, "[$-404]E\"" UTF8_CJ_YEAR "\"M\"" UTF8_CJ_MON "\"D\"" UTF8_CJ_DAY "\"" ),
    1632             :     NUMFMT_STRING( 30, "M/D/YY" ),
    1633             :     NUMFMT_STRING( 31, "YYYY\"" UTF8_CJ_YEAR "\"M\"" UTF8_CJ_MON "\"D\"" UTF8_CJ_DAY "\"" ),
    1634             :     NUMFMT_ENDTABLE()
    1635             : };
    1636             : 
    1637             : // ----------------------------------------------------------------------------
    1638             : 
    1639             : /** Specifies a built-in number format table for a specific locale. */
    1640             : struct BuiltinFormatTable
    1641             : {
    1642             :     const sal_Char*     mpcLocale;          /// The locale for this table.
    1643             :     const sal_Char*     mpcParent;          /// The locale of the parent table.
    1644             :     const BuiltinFormat* mpFormats;         /// The number format table (may be 0, if equal to parent).
    1645             : };
    1646             : 
    1647             : static const BuiltinFormatTable spBuiltinFormatTables[] =
    1648             : { //  locale    parent      format table
    1649             :     { "*",      "",         spBuiltinFormats_BASE   },  // Base table
    1650             :     { "af-ZA",  "*",        spBuiltinFormats_en_ZA  },  // Afrikaans, South Africa
    1651             :     { "ar-AE",  "*",        spBuiltinFormats_ar_AE  },  // Arabic, U.A.E.
    1652             :     { "ar-BH",  "*",        spBuiltinFormats_ar_BH  },  // Arabic, Bahrain
    1653             :     { "ar-DZ",  "*",        spBuiltinFormats_ar_DZ  },  // Arabic, Algeria
    1654             :     { "ar-EG",  "*",        spBuiltinFormats_ar_EG  },  // Arabic, Egypt
    1655             :     { "ar-IQ",  "*",        spBuiltinFormats_ar_IQ  },  // Arabic, Iraq
    1656             :     { "ar-JO",  "*",        spBuiltinFormats_ar_JO  },  // Arabic, Jordan
    1657             :     { "ar-KW",  "*",        spBuiltinFormats_ar_KW  },  // Arabic, Kuwait
    1658             :     { "ar-LB",  "*",        spBuiltinFormats_ar_LB  },  // Arabic, Lebanon
    1659             :     { "ar-LY",  "*",        spBuiltinFormats_ar_LY  },  // Arabic, Libya
    1660             :     { "ar-MA",  "*",        spBuiltinFormats_ar_MA  },  // Arabic, Morocco
    1661             :     { "ar-OM",  "*",        spBuiltinFormats_ar_OM  },  // Arabic, Oman
    1662             :     { "ar-QA",  "*",        spBuiltinFormats_ar_QA  },  // Arabic, Qatar
    1663             :     { "ar-SA",  "*",        spBuiltinFormats_ar_SA  },  // Arabic, Saudi Arabia
    1664             :     { "ar-SY",  "*",        spBuiltinFormats_ar_SY  },  // Arabic, Syria
    1665             :     { "ar-TN",  "*",        spBuiltinFormats_ar_TN  },  // Arabic, Tunisia
    1666             :     { "ar-YE",  "*",        spBuiltinFormats_ar_YE  },  // Arabic, Yemen
    1667             :     { "be-BY",  "*",        spBuiltinFormats_be_BY  },  // Belarusian, Belarus
    1668             :     { "bg-BG",  "*",        spBuiltinFormats_bg_BG  },  // Bulgarian, Bulgaria
    1669             :     { "bn-IN",  "*",        spBuiltinFormats_bn_IN  },  // Bengali, India
    1670             :     { "ca-ES",  "*",        spBuiltinFormats_es_ES  },  // Catalan, Spain
    1671             :     { "cs-CZ",  "*",        spBuiltinFormats_cs_CZ  },  // Czech, Czech Republic
    1672             :     { "cy-GB",  "*",        spBuiltinFormats_en_GB  },  // Welsh, United Kingdom
    1673             :     { "da-DK",  "*",        spBuiltinFormats_da_DK  },  // Danish, Denmark
    1674             :     { "de-AT",  "*",        spBuiltinFormats_de_AT  },  // German, Austria
    1675             :     { "de-CH",  "*",        spBuiltinFormats_de_CH  },  // German, Switzerland
    1676             :     { "de-DE",  "*",        spBuiltinFormats_de_DE  },  // German, Germany
    1677             :     { "de-LI",  "*",        spBuiltinFormats_de_LI  },  // German, Liechtenstein
    1678             :     { "de-LU",  "*",        spBuiltinFormats_de_LU  },  // German, Luxembourg
    1679             :     { "div-MV", "*",        spBuiltinFormats_div_MV },  // Divehi, Maldives
    1680             :     { "el-GR",  "*",        spBuiltinFormats_el_GR  },  // Greek, Greece
    1681             :     { "en-AU",  "*",        spBuiltinFormats_en_AU  },  // English, Australia
    1682             :     { "en-BZ",  "*",        spBuiltinFormats_en_BZ  },  // English, Belize
    1683             :     { "en-CA",  "*",        spBuiltinFormats_en_CA  },  // English, Canada
    1684             :     { "en-CB",  "*",        spBuiltinFormats_en_CB  },  // English, Caribbean
    1685             :     { "en-GB",  "*",        spBuiltinFormats_en_GB  },  // English, United Kingdom
    1686             :     { "en-IE",  "*",        spBuiltinFormats_en_IE  },  // English, Ireland
    1687             :     { "en-JM",  "*",        spBuiltinFormats_en_JM  },  // English, Jamaica
    1688             :     { "en-NZ",  "*",        spBuiltinFormats_en_NZ  },  // English, New Zealand
    1689             :     { "en-PH",  "*",        spBuiltinFormats_en_PH  },  // English, Philippines
    1690             :     { "en-TT",  "*",        spBuiltinFormats_en_TT  },  // English, Trinidad and Tobago
    1691             :     { "en-US",  "*",        spBuiltinFormats_en_US  },  // English, USA
    1692             :     { "en-ZA",  "*",        spBuiltinFormats_en_ZA  },  // English, South Africa
    1693             :     { "en-ZW",  "*",        spBuiltinFormats_en_ZW  },  // English, Zimbabwe
    1694             :     { "es-AR",  "*",        spBuiltinFormats_es_AR  },  // Spanish, Argentina
    1695             :     { "es-BO",  "*",        spBuiltinFormats_es_BO  },  // Spanish, Bolivia
    1696             :     { "es-CL",  "*",        spBuiltinFormats_es_CL  },  // Spanish, Chile
    1697             :     { "es-CO",  "*",        spBuiltinFormats_es_CO  },  // Spanish, Colombia
    1698             :     { "es-CR",  "*",        spBuiltinFormats_es_CR  },  // Spanish, Costa Rica
    1699             :     { "es-DO",  "*",        spBuiltinFormats_es_DO  },  // Spanish, Dominican Republic
    1700             :     { "es-EC",  "*",        spBuiltinFormats_es_EC  },  // Spanish, Ecuador
    1701             :     { "es-ES",  "*",        spBuiltinFormats_es_ES  },  // Spanish, Spain
    1702             :     { "es-GT",  "*",        spBuiltinFormats_es_GT  },  // Spanish, Guatemala
    1703             :     { "es-HN",  "*",        spBuiltinFormats_es_HN  },  // Spanish, Honduras
    1704             :     { "es-MX",  "*",        spBuiltinFormats_es_MX  },  // Spanish, Mexico
    1705             :     { "es-NI",  "*",        spBuiltinFormats_es_NI  },  // Spanish, Nicaragua
    1706             :     { "es-PA",  "*",        spBuiltinFormats_es_PA  },  // Spanish, Panama
    1707             :     { "es-PE",  "*",        spBuiltinFormats_es_PE  },  // Spanish, Peru
    1708             :     { "es-PR",  "*",        spBuiltinFormats_es_PR  },  // Spanish, Puerto Rico
    1709             :     { "es-PY",  "*",        spBuiltinFormats_es_PY  },  // Spanish, Paraguay
    1710             :     { "es-SV",  "*",        spBuiltinFormats_es_SV  },  // Spanish, El Salvador
    1711             :     { "es-UY",  "*",        spBuiltinFormats_es_UY  },  // Spanish, Uruguay
    1712             :     { "es-VE",  "*",        spBuiltinFormats_es_VE  },  // Spanish, Venezuela
    1713             :     { "et-EE",  "*",        spBuiltinFormats_et_EE  },  // Estonian, Estonia
    1714             :     { "fa-IR",  "*",        spBuiltinFormats_fa_IR  },  // Farsi, Iran
    1715             :     { "fi-FI",  "*",        spBuiltinFormats_fi_FI  },  // Finnish, Finland
    1716             :     { "fo-FO",  "*",        spBuiltinFormats_fo_FO  },  // Faroese, Faroe Islands
    1717             :     { "fr-BE",  "*",        spBuiltinFormats_fr_BE  },  // French, Belgium
    1718             :     { "fr-CA",  "*",        spBuiltinFormats_fr_CA  },  // French, Canada
    1719             :     { "fr-CH",  "*",        spBuiltinFormats_fr_CH  },  // French, Switzerland
    1720             :     { "fr-FR",  "*",        spBuiltinFormats_fr_FR  },  // French, France
    1721             :     { "fr-LU",  "*",        spBuiltinFormats_fr_LU  },  // French, Luxembourg
    1722             :     { "fr-MC",  "*",        spBuiltinFormats_fr_MC  },  // French, Monaco
    1723             :     { "gl-ES",  "*",        spBuiltinFormats_gl_ES  },  // Galizian, Spain
    1724             :     { "gu-IN",  "*",        spBuiltinFormats_gu_IN  },  // Gujarati, India
    1725             :     { "he-IL",  "*",        spBuiltinFormats_he_IL  },  // Hebrew, Israel
    1726             :     { "hi-IN",  "*",        spBuiltinFormats_hi_IN  },  // Hindi, India
    1727             :     { "hr-BA",  "*",        spBuiltinFormats_hr_BA  },  // Croatian, Bosnia and Herzegowina
    1728             :     { "hr-HR",  "*",        spBuiltinFormats_hr_HR  },  // Croatian, Croatia
    1729             :     { "hu-HU",  "*",        spBuiltinFormats_hu_HU  },  // Hungarian, Hungary
    1730             :     { "hy-AM",  "*",        spBuiltinFormats_hy_AM  },  // Armenian, Armenia
    1731             :     { "id-ID",  "*",        spBuiltinFormats_id_ID  },  // Indonesian, Indonesia
    1732             :     { "is-IS",  "*",        spBuiltinFormats_is_IS  },  // Icelandic, Iceland
    1733             :     { "it-CH",  "*",        spBuiltinFormats_it_CH  },  // Italian, Switzerland
    1734             :     { "it-IT",  "*",        spBuiltinFormats_it_IT  },  // Italian, Italy
    1735             :     { "ka-GE",  "*",        spBuiltinFormats_ka_GE  },  // Georgian, Georgia
    1736             :     { "kk-KZ",  "*",        spBuiltinFormats_kk_KZ  },  // Kazakh, Kazakhstan
    1737             :     { "kn-IN",  "*",        spBuiltinFormats_kn_IN  },  // Kannada, India
    1738             :     { "kok-IN", "*",        spBuiltinFormats_hi_IN  },  // Konkani, India
    1739             :     { "ky-KG",  "*",        spBuiltinFormats_ky_KG  },  // Kyrgyz, Kyrgyzstan
    1740             :     { "lt-LT",  "*",        spBuiltinFormats_lt_LT  },  // Lithuanian, Lithuania
    1741             :     { "lv-LV",  "*",        spBuiltinFormats_lv_LV  },  // Latvian, Latvia
    1742             :     { "mi-NZ",  "*",        spBuiltinFormats_en_NZ  },  // Maori, New Zealand
    1743             :     { "ml-IN",  "*",        spBuiltinFormats_ml_IN  },  // Malayalam, India
    1744             :     { "mn-MN",  "*",        spBuiltinFormats_mn_MN  },  // Mongolian, Mongolia
    1745             :     { "mr-IN",  "*",        spBuiltinFormats_hi_IN  },  // Marathi, India
    1746             :     { "ms-BN",  "*",        spBuiltinFormats_ms_BN  },  // Malay, Brunei Darussalam
    1747             :     { "ms-MY",  "*",        spBuiltinFormats_ms_MY  },  // Malay, Malaysia
    1748             :     { "mt-MT",  "*",        spBuiltinFormats_mt_MT  },  // Maltese, Malta
    1749             :     { "nb-NO",  "*",        spBuiltinFormats_no_NO  },  // Norwegian Bokmal, Norway
    1750             :     { "nl-BE",  "*",        spBuiltinFormats_nl_BE  },  // Dutch, Belgium
    1751             :     { "nl-NL",  "*",        spBuiltinFormats_nl_NL  },  // Dutch, Netherlands
    1752             :     { "nn-NO",  "*",        spBuiltinFormats_no_NO  },  // Norwegian Nynorsk, Norway
    1753             :     { "nso-ZA", "*",        spBuiltinFormats_en_ZA  },  // Northern Sotho, South Africa
    1754             :     { "pa-IN",  "*",        spBuiltinFormats_pa_IN  },  // Punjabi, India
    1755             :     { "pl-PL",  "*",        spBuiltinFormats_pl_PL  },  // Polish, Poland
    1756             :     { "pt-BR",  "*",        spBuiltinFormats_pt_BR  },  // Portugese, Brazil
    1757             :     { "pt-PT",  "*",        spBuiltinFormats_pt_PT  },  // Portugese, Portugal
    1758             :     { "qu-BO",  "*",        spBuiltinFormats_es_BO  },  // Quechua, Bolivia
    1759             :     { "qu-EC",  "*",        spBuiltinFormats_es_EC  },  // Quechua, Ecuador
    1760             :     { "qu-PE",  "*",        spBuiltinFormats_es_PE  },  // Quechua, Peru
    1761             :     { "ro-RO",  "*",        spBuiltinFormats_ro_RO  },  // Romanian, Romania
    1762             :     { "ru-RU",  "*",        spBuiltinFormats_ru_RU  },  // Russian, Russian Federation
    1763             :     { "sa-IN",  "*",        spBuiltinFormats_hi_IN  },  // Sanskrit, India
    1764             :     { "se-FI",  "*",        spBuiltinFormats_fi_FI  },  // Sami, Finland
    1765             :     { "se-NO",  "*",        spBuiltinFormats_no_NO  },  // Sami, Norway
    1766             :     { "se-SE",  "*",        spBuiltinFormats_sv_SE  },  // Sami, Sweden
    1767             :     { "sk-SK",  "*",        spBuiltinFormats_sk_SK  },  // Slovak, Slovakia
    1768             :     { "sl-SI",  "*",        spBuiltinFormats_sl_SI  },  // Slovenian, Slovenia
    1769             :     { "sv-FI",  "*",        spBuiltinFormats_sv_FI  },  // Swedish, Finland
    1770             :     { "sv-SE",  "*",        spBuiltinFormats_sv_SE  },  // Swedish, Sweden
    1771             :     { "sw-TZ",  "*",        spBuiltinFormats_sw_TZ  },  // Swahili, Tanzania
    1772             :     { "syr-SY", "*",        spBuiltinFormats_ar_SY  },  // Syriac, Syria
    1773             :     { "syr-TR", "*",        spBuiltinFormats_tr_TR  },  // Syriac, Turkey
    1774             :     { "ta-IN",  "*",        spBuiltinFormats_ta_IN  },  // Tamil, India
    1775             :     { "te-IN",  "*",        spBuiltinFormats_te_IN  },  // Telugu, India
    1776             :     { "th-TH",  "*",        spBuiltinFormats_th_TH  },  // Thai, Thailand
    1777             :     { "tn-ZA",  "*",        spBuiltinFormats_en_ZA  },  // Tswana, South Africa
    1778             :     { "tr-TR",  "*",        spBuiltinFormats_tr_TR  },  // Turkish, Turkey
    1779             :     { "tt-RU",  "*",        spBuiltinFormats_tt_RU  },  // Tatar, Russian Federation
    1780             :     { "uk-UA",  "*",        spBuiltinFormats_uk_UA  },  // Ukrainian, Ukraine
    1781             :     { "ur-PK",  "*",        spBuiltinFormats_ur_PK  },  // Urdu, Pakistan
    1782             :     { "vi-VN",  "*",        spBuiltinFormats_vi_VN  },  // Vietnamese, Viet Nam
    1783             :     { "xh-ZA",  "*",        spBuiltinFormats_en_ZA  },  // Xhosa, South Africa
    1784             :     { "zu-ZA",  "*",        spBuiltinFormats_en_ZA  },  // Zulu, South Africa
    1785             : 
    1786             :     { "*CJK",   "*",        spBuiltinFormats_CJK    },  // CJK base table
    1787             :     { "ja-JP",  "*CJK",     spBuiltinFormats_ja_JP  },  // Japanese, Japan
    1788             :     { "ko-KR",  "*CJK",     spBuiltinFormats_ko_KR  },  // Korean, South Korea
    1789             :     { "zh-CN",  "*CJK",     spBuiltinFormats_zh_CN  },  // Chinese, China
    1790             :     { "zh-HK",  "*CJK",     spBuiltinFormats_zh_HK  },  // Chinese, Hong Kong
    1791             :     { "zh-MO",  "*CJK",     spBuiltinFormats_zh_MO  },  // Chinese, Macau
    1792             :     { "zh-SG",  "*CJK",     spBuiltinFormats_zh_SG  },  // Chinese, Singapore
    1793             :     { "zh-TW",  "*CJK",     spBuiltinFormats_zh_TW  }   // Chinese, Taiwan
    1794             : };
    1795             : 
    1796             : } // namespace
    1797             : 
    1798             : // ============================================================================
    1799             : 
    1800        1797 : NumFmtModel::NumFmtModel() :
    1801        1797 :     mnPredefId( -1 )
    1802             : {
    1803        1797 : }
    1804             : 
    1805             : // ----------------------------------------------------------------------------
    1806             : 
    1807        1797 : ApiNumFmtData::ApiNumFmtData() :
    1808        1797 :     mnIndex( 0 )
    1809             : {
    1810        1797 : }
    1811             : 
    1812             : // ----------------------------------------------------------------------------
    1813             : 
    1814             : namespace {
    1815             : 
    1816        1421 : sal_Int32 lclCreatePredefinedFormat( const Reference< XNumberFormats >& rxNumFmts,
    1817             :         sal_Int16 nPredefId, const Locale& rToLocale )
    1818             : {
    1819        1421 :     sal_Int32 nIndex = 0;
    1820             :     try
    1821             :     {
    1822        1421 :         Reference< XNumberFormatTypes > xNumFmtTypes( rxNumFmts, UNO_QUERY_THROW );
    1823             :         nIndex = (nPredefId >= 0) ?
    1824        1421 :             xNumFmtTypes->getFormatIndex( nPredefId, rToLocale ) :
    1825        2842 :             xNumFmtTypes->getStandardIndex( rToLocale );
    1826             :     }
    1827           0 :     catch( Exception& )
    1828             :     {
    1829             :         OSL_FAIL( OStringBuffer( "lclCreatePredefinedFormat - cannot create predefined number format " ).
    1830             :             append( OString::number( nPredefId ) ).getStr() );
    1831             :     }
    1832        1421 :     return nIndex;
    1833             : }
    1834             : 
    1835         390 : sal_Int32 lclCreateFormat( const Reference< XNumberFormats >& rxNumFmts,
    1836             :         const OUString& rFmtCode, const Locale& rToLocale, const Locale& rFromLocale )
    1837             : {
    1838         390 :     sal_Int32 nIndex = 0;
    1839             :     try
    1840             :     {
    1841         390 :         nIndex = rxNumFmts->addNewConverted( rFmtCode, rFromLocale, rToLocale );
    1842             :     }
    1843          14 :     catch( Exception& )
    1844             :     {
    1845             :         // BIFF2-BIFF4 stores standard format explicitly in stream
    1846          14 :         if( rFmtCode.equalsIgnoreAsciiCase( "general" ) )
    1847             :         {
    1848          14 :             nIndex = lclCreatePredefinedFormat( rxNumFmts, 0, rToLocale );
    1849             :         }
    1850             :         else
    1851             :         {
    1852             :             // do not assert fractional number formats with fixed denominator
    1853             :             OSL_ENSURE( rFmtCode.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "#\\ ?/" ) ) ||
    1854             :                         rFmtCode.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "#\\ ?\?/" ) ) ||
    1855             :                         rFmtCode.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "#\\ ?\?\?/" ) ),
    1856             :                 OStringBuffer( "lclCreateFormat - cannot create number format '" ).
    1857             :                 append( OUStringToOString( rFmtCode, osl_getThreadTextEncoding() ) ).
    1858             :                 append( '\'' ).getStr() );
    1859             :         }
    1860             :     }
    1861         390 :     return nIndex;
    1862             : }
    1863             : 
    1864             : // ----------------------------------------------------------------------------
    1865             : 
    1866             : /** Functor for converting an XML number format to an API number format index. */
    1867         105 : class NumberFormatFinalizer
    1868             : {
    1869             : public:
    1870             :     explicit            NumberFormatFinalizer( const WorkbookHelper& rHelper );
    1871             : 
    1872             :     inline bool         is() const { return mxNumFmts.is(); }
    1873             : 
    1874        1797 :     inline void         operator()( NumberFormat& rNumFmt ) const
    1875        1797 :                             { rNumFmt.finalizeImport( mxNumFmts, maEnUsLocale ); }
    1876             : 
    1877             : private:
    1878             :     Reference< XNumberFormats > mxNumFmts;
    1879             :     Locale              maEnUsLocale;
    1880             : };
    1881             : 
    1882          21 : NumberFormatFinalizer::NumberFormatFinalizer( const WorkbookHelper& rHelper ) :
    1883          21 :     maEnUsLocale( "en", "US", OUString() )
    1884             : {
    1885             :     try
    1886             :     {
    1887          21 :         Reference< XNumberFormatsSupplier > xNumFmtsSupp( rHelper.getDocument(), UNO_QUERY_THROW );
    1888          21 :         mxNumFmts = xNumFmtsSupp->getNumberFormats();
    1889             :     }
    1890           0 :     catch( Exception& )
    1891             :     {
    1892             :     }
    1893             :     OSL_ENSURE( mxNumFmts.is(), "NumberFormatFinalizer::NumberFormatFinalizer - cannot get number formats" );
    1894          21 : }
    1895             : 
    1896             : } // namespace
    1897             : 
    1898             : // ----------------------------------------------------------------------------
    1899             : 
    1900        1797 : NumberFormat::NumberFormat( const WorkbookHelper& rHelper ) :
    1901        1797 :     WorkbookHelper( rHelper )
    1902             : {
    1903        1797 : }
    1904             : 
    1905          75 : void NumberFormat::setFormatCode( const OUString& rFmtCode )
    1906             : {
    1907             :     // especiall for a fraction code '\ ?/?' is passed to us in xml, the '\' is not
    1908             :     // an escape character but merely should be telling the formatter to display the next
    1909             :     // char in the format ( afaics it does that anyhow )
    1910             : 
    1911          75 :     maModel.maFmtCode = rFmtCode.replaceAll("\\", "");
    1912          75 : }
    1913             : 
    1914         252 : void NumberFormat::setFormatCode( const Locale& rLocale, const sal_Char* pcFmtCode )
    1915             : {
    1916         252 :     maModel.maLocale = rLocale;
    1917         252 :     maModel.maFmtCode = OStringToOUString( OString( pcFmtCode ), RTL_TEXTENCODING_UTF8 );
    1918         252 :     maModel.mnPredefId = -1;
    1919         252 : }
    1920             : 
    1921         504 : void NumberFormat::setPredefinedId( const Locale& rLocale, sal_Int16 nPredefId )
    1922             : {
    1923         504 :     maModel.maLocale = rLocale;
    1924         504 :     maModel.maFmtCode = OUString();
    1925         504 :     maModel.mnPredefId = nPredefId;
    1926         504 : }
    1927             : 
    1928        1797 : sal_Int32 NumberFormat::finalizeImport( const Reference< XNumberFormats >& rxNumFmts, const Locale& rFromLocale )
    1929             : {
    1930        1797 :     if( rxNumFmts.is() && !maModel.maFmtCode.isEmpty() )
    1931         390 :         maApiData.mnIndex = lclCreateFormat( rxNumFmts, maModel.maFmtCode, maModel.maLocale, rFromLocale );
    1932             :     else
    1933        1407 :         maApiData.mnIndex = lclCreatePredefinedFormat( rxNumFmts, maModel.mnPredefId, maModel.maLocale );
    1934        1797 :     return maApiData.mnIndex;
    1935             : }
    1936             : 
    1937          26 : void NumberFormat::fillToItemSet( SfxItemSet& rItemSet, bool bSkipPoolDefs ) const
    1938             : {
    1939          26 :     ScDocument& rDoc = getScDocument();
    1940          26 :     static sal_uLong  nDflt = rDoc.GetFormatTable()->GetStandardFormat( ScGlobal::eLnge );
    1941          26 :     sal_uLong nScNumFmt = nDflt;
    1942          26 :     if ( maApiData.mnIndex )
    1943           2 :         nScNumFmt = maApiData.mnIndex;
    1944          26 :     ScfTools::PutItem( rItemSet, SfxUInt32Item( ATTR_VALUE_FORMAT, nScNumFmt ), bSkipPoolDefs );
    1945          26 :     if( rItemSet.GetItemState( ATTR_VALUE_FORMAT, false ) == SFX_ITEM_SET )
    1946           5 :         ScGlobal::AddLanguage( rItemSet, *(rDoc.GetFormatTable()) );
    1947          26 : }
    1948             : 
    1949          24 : void NumberFormat::writeToPropertyMap( PropertyMap& rPropMap ) const
    1950             : {
    1951          24 :     rPropMap[ PROP_NumberFormat ] <<= maApiData.mnIndex;
    1952          24 : }
    1953             : 
    1954             : // ============================================================================
    1955             : 
    1956          21 : NumberFormatsBuffer::NumberFormatsBuffer( const WorkbookHelper& rHelper )
    1957             :     : WorkbookHelper(rHelper)
    1958          21 :     , mnHighestId(0)
    1959             : {
    1960             :     // get the current locale
    1961             :     // try user-defined locale setting
    1962          21 :     maLocaleStr = officecfg::Setup::L10N::ooSetupSystemLocale::get();
    1963             :     // if set to "use system", get locale from system
    1964          21 :     if( maLocaleStr.isEmpty() )
    1965          21 :         maLocaleStr = officecfg::System::L10N::Locale::get();
    1966             : 
    1967             :     // create built-in formats for current locale
    1968          21 :     insertBuiltinFormats();
    1969          21 : }
    1970             : 
    1971          75 : NumberFormatRef NumberFormatsBuffer::createNumFmt( sal_Int32 nNumFmtId, const OUString& rFmtCode )
    1972             : {
    1973          75 :     NumberFormatRef xNumFmt;
    1974          75 :     if( nNumFmtId >= 0 )
    1975             :     {
    1976          75 :         xNumFmt.reset( new NumberFormat( *this ) );
    1977          75 :         maNumFmts[ nNumFmtId ] = xNumFmt;
    1978          75 :         if ( nNumFmtId > mnHighestId )
    1979          17 :             mnHighestId = nNumFmtId;
    1980          75 :         xNumFmt->setFormatCode( rFmtCode );
    1981             :     }
    1982          75 :     return xNumFmt;
    1983             : }
    1984             : 
    1985          17 : NumberFormatRef NumberFormatsBuffer::importNumFmt( const AttributeList& rAttribs )
    1986             : {
    1987          17 :     sal_Int32 nNumFmtId = rAttribs.getInteger( XML_numFmtId, -1 );
    1988          17 :     OUString aFmtCode = rAttribs.getXString( XML_formatCode, OUString() );
    1989          17 :     return createNumFmt( nNumFmtId, aFmtCode );
    1990             : }
    1991             : 
    1992           0 : void NumberFormatsBuffer::importNumFmt( SequenceInputStream& rStrm )
    1993             : {
    1994           0 :     sal_Int32 nNumFmtId = rStrm.readuInt16();
    1995           0 :     OUString aFmtCode = BiffHelper::readString( rStrm );
    1996           0 :     createNumFmt( nNumFmtId, aFmtCode );
    1997           0 : }
    1998             : 
    1999          21 : void NumberFormatsBuffer::finalizeImport()
    2000             : {
    2001          21 :     maNumFmts.forEach( NumberFormatFinalizer( *this ) );
    2002          21 : }
    2003             : 
    2004          26 : void NumberFormatsBuffer::fillToItemSet( SfxItemSet& rItemSet, sal_Int32 nNumFmtId, bool bSkipPoolDefs ) const
    2005             : {
    2006          26 :     if( const NumberFormat* pNumFmt = maNumFmts.get( nNumFmtId ).get() )
    2007          26 :         pNumFmt->fillToItemSet( rItemSet, bSkipPoolDefs);
    2008          26 : }
    2009             : 
    2010           0 : void NumberFormatsBuffer::writeToPropertyMap( PropertyMap& rPropMap, sal_Int32 nNumFmtId ) const
    2011             : {
    2012           0 :     if( const NumberFormat* pNumFmt = maNumFmts.get( nNumFmtId ).get() )
    2013           0 :         pNumFmt->writeToPropertyMap( rPropMap );
    2014           0 : }
    2015             : 
    2016          21 : void NumberFormatsBuffer::insertBuiltinFormats()
    2017             : {
    2018             :     // build a map containing pointers to all tables
    2019             :     typedef ::std::map< OUString, const BuiltinFormatTable* > BuiltinMap;
    2020          21 :     BuiltinMap aBuiltinMap;
    2021        6090 :     for( const BuiltinFormatTable* pTable = spBuiltinFormatTables;
    2022        3045 :             pTable != STATIC_ARRAY_END( spBuiltinFormatTables ); ++pTable )
    2023        3024 :         aBuiltinMap[ OUString::createFromAscii( pTable->mpcLocale ) ] = pTable;
    2024             : 
    2025             :     // convert locale string to locale struct
    2026          42 :     Locale aSysLocale;
    2027          21 :     sal_Int32 nDashPos = maLocaleStr.indexOf( '-' );
    2028          21 :     if( nDashPos < 0 ) nDashPos = maLocaleStr.getLength();
    2029          21 :     aSysLocale.Language = maLocaleStr.copy( 0, nDashPos );
    2030          21 :     if( nDashPos + 1 < maLocaleStr.getLength() )
    2031           0 :         aSysLocale.Country = maLocaleStr.copy( nDashPos + 1 );
    2032             : 
    2033             :     // build a list of table pointers for the current locale, with all parent tables
    2034             :     typedef ::std::vector< const BuiltinFormatTable* > BuiltinVec;
    2035          42 :     BuiltinVec aBuiltinVec;
    2036          21 :     BuiltinMap::const_iterator aMIt = aBuiltinMap.find( maLocaleStr ), aMEnd = aBuiltinMap.end();
    2037             :     OSL_ENSURE( aMIt != aMEnd,
    2038             :         OStringBuffer( "NumberFormatsBuffer::insertBuiltinFormats - locale '" ).
    2039             :         append( OUStringToOString( maLocaleStr, RTL_TEXTENCODING_ASCII_US ) ).
    2040             :         append( "' not supported (#i29949#)" ).getStr() );
    2041             :     // start with default table, if no table has been found
    2042          21 :     if( aMIt == aMEnd )
    2043          21 :         aMIt = aBuiltinMap.find( "*" );
    2044             :     OSL_ENSURE( aMIt != aMEnd, "NumberFormatsBuffer::insertBuiltinFormats - default map not found" );
    2045             :     // insert all tables into the vector
    2046          42 :     for( ; aMIt != aMEnd; aMIt = aBuiltinMap.find( OUString::createFromAscii( aMIt->second->mpcParent ) ) )
    2047          21 :         aBuiltinVec.push_back( aMIt->second );
    2048             : 
    2049             :     // insert the default formats in the format map (in reverse order from default table to system locale)
    2050             :     typedef ::std::map< sal_Int32, sal_Int32 > ReuseMap;
    2051          42 :     ReuseMap aReuseMap;
    2052          42 :     for( BuiltinVec::reverse_iterator aVIt = aBuiltinVec.rbegin(), aVEnd = aBuiltinVec.rend(); aVIt != aVEnd; ++aVIt )
    2053             :     {
    2054             :         // do not put the current system locale for default table
    2055          21 :         Locale aLocale;
    2056          21 :         if( (*aVIt)->mpcParent[ 0 ] != '\0' )
    2057           0 :             aLocale = aSysLocale;
    2058        1743 :         for( const BuiltinFormat* pBuiltin = (*aVIt)->mpFormats; pBuiltin && (pBuiltin->mnNumFmtId >= 0); ++pBuiltin )
    2059             :         {
    2060        1722 :             NumberFormatRef& rxNumFmt = maNumFmts[ pBuiltin->mnNumFmtId ];
    2061        1722 :             rxNumFmt.reset( new NumberFormat( *this ) );
    2062             : 
    2063        1722 :             bool bReuse = false;
    2064        1722 :             if( pBuiltin->mpcFmtCode )
    2065         252 :                 rxNumFmt->setFormatCode( aLocale, pBuiltin->mpcFmtCode );
    2066        1470 :             else if( pBuiltin->mnPredefId >= 0 )
    2067         504 :                 rxNumFmt->setPredefinedId( aLocale, pBuiltin->mnPredefId );
    2068             :             else
    2069         966 :                 bReuse = pBuiltin->mnReuseId >= 0;
    2070             : 
    2071        1722 :             if( bReuse )
    2072         966 :                 aReuseMap[ pBuiltin->mnNumFmtId ] = pBuiltin->mnReuseId;
    2073             :             else
    2074         756 :                 aReuseMap.erase( pBuiltin->mnNumFmtId );
    2075             :         }
    2076          21 :     }
    2077             : 
    2078             :     // copy reused number formats
    2079         987 :     for( ReuseMap::const_iterator aRIt = aReuseMap.begin(), aREnd = aReuseMap.end(); aRIt != aREnd; ++aRIt )
    2080             :     {
    2081         966 :         maNumFmts[ aRIt->first ] = maNumFmts[ aRIt->second ];
    2082         966 :         if ( aRIt->first > mnHighestId )
    2083         966 :             mnHighestId = aRIt->first;
    2084          21 :     }
    2085          21 : }
    2086             : 
    2087             : // ============================================================================
    2088             : 
    2089             : } // namespace xls
    2090          15 : } // namespace oox
    2091             : 
    2092             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10