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

Generated by: LCOV version 1.10