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