LibreOffice Module i18npool (master) 1
localedata.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <memory>
21#include <mutex>
22#include <string_view>
23#include <com/sun/star/beans/PropertyValue.hpp>
24#include <com/sun/star/container/XIndexAccess.hpp>
25#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
29#include <editeng/svxenum.hxx>
30#include <localedata.hxx>
33#include <sal/log.hxx>
34#include <osl/diagnose.h>
35#include <sal/macros.h>
36#include <o3tl/string_view.hxx>
37
38namespace com::sun::star::uno { class XComponentContext; }
39
40using namespace com::sun::star::i18n;
41using namespace com::sun::star::uno;
42using namespace com::sun::star::lang;
43using namespace com::sun::star;
44
45typedef sal_Unicode** (* MyFunc_Type)( sal_Int16&);
46typedef sal_Unicode const *** (* MyFunc_Type2)( sal_Int16&, sal_Int16& );
47typedef sal_Unicode const **** (* MyFunc_Type3)( sal_Int16&, sal_Int16&, sal_Int16& );
48typedef sal_Unicode const * const * (* MyFunc_FormatCode)( sal_Int16&, sal_Unicode const *&, sal_Unicode const *& );
49
50#ifndef DISABLE_DYNLOADING
51
52static const char *lcl_DATA_EN = "localedata_en";
53static const char *lcl_DATA_ES = "localedata_es";
54static const char *lcl_DATA_EURO = "localedata_euro";
55static const char *lcl_DATA_OTHERS = "localedata_others";
56
57const struct {
58 const char* pLocale;
59 const char* pLib;
60} aLibTable[] = {
61 { "en_US", lcl_DATA_EN },
62 { "en_AU", lcl_DATA_EN },
63 { "en_BZ", lcl_DATA_EN },
64 { "en_CA", lcl_DATA_EN },
65 { "en_GB", lcl_DATA_EN },
66 { "en_IE", lcl_DATA_EN },
67 { "en_JM", lcl_DATA_EN },
68 { "en_NZ", lcl_DATA_EN },
69 { "en_PH", lcl_DATA_EN },
70 { "en_TT", lcl_DATA_EN },
71 { "en_ZA", lcl_DATA_EN },
72 { "en_ZW", lcl_DATA_EN },
73 { "en_NA", lcl_DATA_EN },
74 { "en_GH", lcl_DATA_EN },
75 { "en_MW", lcl_DATA_EN },
76 { "en_GM", lcl_DATA_EN },
77 { "en_BW", lcl_DATA_EN },
78 { "en_ZM", lcl_DATA_EN },
79 { "en_LK", lcl_DATA_EN },
80 { "en_NG", lcl_DATA_EN },
81 { "en_KE", lcl_DATA_EN },
82 { "en_DK", lcl_DATA_EN },
83 { "en_MU", lcl_DATA_EN },
84
85 { "es_ES", lcl_DATA_ES },
86 { "es_AR", lcl_DATA_ES },
87 { "es_BO", lcl_DATA_ES },
88 { "es_CL", lcl_DATA_ES },
89 { "es_CO", lcl_DATA_ES },
90 { "es_CR", lcl_DATA_ES },
91 { "es_DO", lcl_DATA_ES },
92 { "es_EC", lcl_DATA_ES },
93 { "es_GT", lcl_DATA_ES },
94 { "es_HN", lcl_DATA_ES },
95 { "es_MX", lcl_DATA_ES },
96 { "es_NI", lcl_DATA_ES },
97 { "es_PA", lcl_DATA_ES },
98 { "es_PE", lcl_DATA_ES },
99 { "es_PR", lcl_DATA_ES },
100 { "es_PY", lcl_DATA_ES },
101 { "es_SV", lcl_DATA_ES },
102 { "es_UY", lcl_DATA_ES },
103 { "es_VE", lcl_DATA_ES },
104 { "gl_ES", lcl_DATA_ES },
105 { "oc_ES_aranes", lcl_DATA_ES },
106
107 { "de_DE", lcl_DATA_EURO },
108 { "de_AT", lcl_DATA_EURO },
109 { "de_CH", lcl_DATA_EURO },
110 { "de_LI", lcl_DATA_EURO },
111 { "de_LU", lcl_DATA_EURO },
112 { "fr_FR", lcl_DATA_EURO },
113 { "fr_BE", lcl_DATA_EURO },
114 { "fr_CA", lcl_DATA_EURO },
115 { "fr_CH", lcl_DATA_EURO },
116 { "fr_LU", lcl_DATA_EURO },
117 { "fr_MC", lcl_DATA_EURO },
118 { "fr_BF", lcl_DATA_EURO },
119 { "fr_CI", lcl_DATA_EURO },
120 { "fr_ML", lcl_DATA_EURO },
121 { "fr_SN", lcl_DATA_EURO },
122 { "fr_BJ", lcl_DATA_EURO },
123 { "fr_NE", lcl_DATA_EURO },
124 { "fr_TG", lcl_DATA_EURO },
125 { "it_IT", lcl_DATA_EURO },
126 { "it_CH", lcl_DATA_EURO },
127 { "sl_SI", lcl_DATA_EURO },
128 { "sv_SE", lcl_DATA_EURO },
129 { "sv_FI", lcl_DATA_EURO },
130 { "ca_ES", lcl_DATA_EURO },
131 { "ca_ES_valencia", lcl_DATA_EURO },
132 { "cs_CZ", lcl_DATA_EURO },
133 { "sk_SK", lcl_DATA_EURO },
134 { "da_DK", lcl_DATA_EURO },
135 { "el_GR", lcl_DATA_EURO },
136 { "fi_FI", lcl_DATA_EURO },
137 { "is_IS", lcl_DATA_EURO },
138 { "nl_BE", lcl_DATA_EURO },
139 { "nl_NL", lcl_DATA_EURO },
140 { "no_NO", lcl_DATA_EURO },
141 { "nn_NO", lcl_DATA_EURO },
142 { "nb_NO", lcl_DATA_EURO },
143 { "nds_DE", lcl_DATA_EURO },
144 { "pl_PL", lcl_DATA_EURO },
145 { "pt_PT", lcl_DATA_EURO },
146 { "pt_BR", lcl_DATA_EURO }, // needs to be in EURO because inherits from pt_PT
147 { "pt_MZ", lcl_DATA_EURO }, // needs to be in EURO because inherits from pt_PT
148 { "ru_RU", lcl_DATA_EURO },
149 { "tr_TR", lcl_DATA_EURO },
150 { "tt_RU", lcl_DATA_EURO },
151 { "et_EE", lcl_DATA_EURO },
152 { "vro_EE", lcl_DATA_EURO },
153 { "lb_LU", lcl_DATA_EURO },
154 { "lt_LT", lcl_DATA_EURO },
155 { "lv_LV", lcl_DATA_EURO },
156 { "uk_UA", lcl_DATA_EURO },
157 { "ro_RO", lcl_DATA_EURO },
158 { "cy_GB", lcl_DATA_EURO },
159 { "bg_BG", lcl_DATA_EURO },
160 { "sr_Latn_ME", lcl_DATA_EURO },
161 { "sr_Latn_RS", lcl_DATA_EURO },
162 { "sr_Latn_CS", lcl_DATA_EURO },
163 { "sr_ME", lcl_DATA_EURO },
164 { "sr_RS", lcl_DATA_EURO },
165 { "sr_CS", lcl_DATA_EURO },
166 { "hr_HR", lcl_DATA_EURO },
167 { "bs_BA", lcl_DATA_EURO },
168 { "eu_ES", lcl_DATA_EURO },
169 { "fo_FO", lcl_DATA_EURO },
170 { "ga_IE", lcl_DATA_EURO },
171 { "gd_GB", lcl_DATA_EURO },
172 { "ka_GE", lcl_DATA_EURO },
173 { "be_BY", lcl_DATA_EURO },
174 { "kl_GL", lcl_DATA_EURO },
175 { "mk_MK", lcl_DATA_EURO },
176 { "br_FR", lcl_DATA_EURO },
177 { "la_VA", lcl_DATA_EURO },
178 { "cv_RU", lcl_DATA_EURO },
179 { "wa_BE", lcl_DATA_EURO },
180 { "fur_IT", lcl_DATA_EURO },
181 { "gsc_FR", lcl_DATA_EURO },
182 { "fy_NL", lcl_DATA_EURO },
183 { "oc_FR_lengadoc", lcl_DATA_EURO },
184 { "mt_MT", lcl_DATA_EURO },
185 { "sc_IT", lcl_DATA_EURO },
186 { "ast_ES", lcl_DATA_EURO },
187 { "ltg_LV", lcl_DATA_EURO },
188 { "hsb_DE", lcl_DATA_EURO },
189 { "dsb_DE", lcl_DATA_EURO },
190 { "rue_SK", lcl_DATA_EURO },
191 { "an_ES", lcl_DATA_EURO },
192 { "myv_RU", lcl_DATA_EURO },
193 { "lld_IT", lcl_DATA_EURO },
194 { "cu_RU", lcl_DATA_EURO },
195 { "vec_IT", lcl_DATA_EURO },
196 { "szl_PL", lcl_DATA_EURO },
197 { "lij_IT", lcl_DATA_EURO },
198
199 { "ja_JP", lcl_DATA_OTHERS },
200 { "ko_KR", lcl_DATA_OTHERS },
201 { "zh_CN", lcl_DATA_OTHERS },
202 { "zh_HK", lcl_DATA_OTHERS },
203 { "zh_SG", lcl_DATA_OTHERS },
204 { "zh_TW", lcl_DATA_OTHERS },
205 { "zh_MO", lcl_DATA_OTHERS },
206 { "en_HK", lcl_DATA_OTHERS }, // needs to be in OTHERS instead of EN because currency inherited from zh_HK
207
208 { "ar_EG", lcl_DATA_OTHERS },
209 { "ar_DZ", lcl_DATA_OTHERS },
210 { "ar_LB", lcl_DATA_OTHERS },
211 { "ar_SA", lcl_DATA_OTHERS },
212 { "ar_TN", lcl_DATA_OTHERS },
213 { "he_IL", lcl_DATA_OTHERS },
214 { "hi_IN", lcl_DATA_OTHERS },
215 { "kn_IN", lcl_DATA_OTHERS },
216 { "ta_IN", lcl_DATA_OTHERS },
217 { "te_IN", lcl_DATA_OTHERS },
218 { "gu_IN", lcl_DATA_OTHERS },
219 { "mr_IN", lcl_DATA_OTHERS },
220 { "pa_IN", lcl_DATA_OTHERS },
221 { "bn_IN", lcl_DATA_OTHERS },
222 { "or_IN", lcl_DATA_OTHERS },
223 { "en_IN", lcl_DATA_OTHERS }, // keep in OTHERS for IN
224 { "ml_IN", lcl_DATA_OTHERS },
225 { "bn_BD", lcl_DATA_OTHERS },
226 { "th_TH", lcl_DATA_OTHERS },
227
228 { "af_ZA", lcl_DATA_OTHERS },
229 { "hu_HU", lcl_DATA_OTHERS },
230 { "id_ID", lcl_DATA_OTHERS },
231 { "ms_MY", lcl_DATA_OTHERS },
232 { "en_MY", lcl_DATA_OTHERS }, // needs to be in OTHERS instead of EN because currency inherited from ms_MY
233 { "ia", lcl_DATA_OTHERS },
234 { "mn_Cyrl_MN", lcl_DATA_OTHERS },
235 { "az_AZ", lcl_DATA_OTHERS },
236 { "sw_TZ", lcl_DATA_OTHERS },
237 { "km_KH", lcl_DATA_OTHERS },
238 { "lo_LA", lcl_DATA_OTHERS },
239 { "rw_RW", lcl_DATA_OTHERS },
240 { "eo", lcl_DATA_OTHERS },
241 { "dz_BT", lcl_DATA_OTHERS },
242 { "ne_NP", lcl_DATA_OTHERS },
243 { "zu_ZA", lcl_DATA_OTHERS },
244 { "nso_ZA", lcl_DATA_OTHERS },
245 { "vi_VN", lcl_DATA_OTHERS },
246 { "tn_ZA", lcl_DATA_OTHERS },
247 { "xh_ZA", lcl_DATA_OTHERS },
248 { "st_ZA", lcl_DATA_OTHERS },
249 { "ss_ZA", lcl_DATA_OTHERS },
250 { "ve_ZA", lcl_DATA_OTHERS },
251 { "nr_ZA", lcl_DATA_OTHERS },
252 { "ts_ZA", lcl_DATA_OTHERS },
253 { "kmr_Latn_TR", lcl_DATA_OTHERS },
254 { "ak_GH", lcl_DATA_OTHERS },
255 { "af_NA", lcl_DATA_OTHERS },
256 { "am_ET", lcl_DATA_OTHERS },
257 { "ti_ER", lcl_DATA_OTHERS },
258 { "tg_TJ", lcl_DATA_OTHERS },
259 { "ky_KG", lcl_DATA_OTHERS },
260 { "kk_KZ", lcl_DATA_OTHERS },
261 { "fa_IR", lcl_DATA_OTHERS },
262 { "ha_Latn_GH", lcl_DATA_OTHERS },
263 { "ee_GH", lcl_DATA_OTHERS },
264 { "sg_CF", lcl_DATA_OTHERS },
265 { "lg_UG", lcl_DATA_OTHERS },
266 { "uz_UZ", lcl_DATA_OTHERS },
267 { "ln_CD", lcl_DATA_OTHERS },
268 { "hy_AM", lcl_DATA_OTHERS },
269 { "hil_PH", lcl_DATA_OTHERS },
270 { "so_SO", lcl_DATA_OTHERS },
271 { "gug_PY", lcl_DATA_OTHERS },
272 { "tk_TM", lcl_DATA_OTHERS },
273 { "my_MM", lcl_DATA_OTHERS },
274 { "shs_CA", lcl_DATA_OTHERS },
275 { "tpi_PG", lcl_DATA_OTHERS },
276 { "ar_OM", lcl_DATA_OTHERS },
277 { "ug_CN", lcl_DATA_OTHERS },
278 { "om_ET", lcl_DATA_OTHERS },
279 { "plt_MG", lcl_DATA_OTHERS },
280 { "mai_IN", lcl_DATA_OTHERS },
281 { "yi_US", lcl_DATA_OTHERS },
282 { "haw_US", lcl_DATA_OTHERS },
283 { "lif_NP", lcl_DATA_OTHERS },
284 { "ur_PK", lcl_DATA_OTHERS },
285 { "ht_HT", lcl_DATA_OTHERS },
286 { "jbo", lcl_DATA_OTHERS },
287 { "kab_DZ", lcl_DATA_OTHERS },
288 { "pt_AO", lcl_DATA_OTHERS },
289 { "pjt_AU", lcl_DATA_OTHERS },
290 { "pap_BQ", lcl_DATA_OTHERS },
291 { "pap_CW", lcl_DATA_OTHERS },
292 { "ebo_CG", lcl_DATA_OTHERS },
293 { "tyx_CG", lcl_DATA_OTHERS },
294 { "axk_CG", lcl_DATA_OTHERS },
295 { "beq_CG", lcl_DATA_OTHERS },
296 { "bkw_CG", lcl_DATA_OTHERS },
297 { "bvx_CG", lcl_DATA_OTHERS },
298 { "dde_CG", lcl_DATA_OTHERS },
299 { "iyx_CG", lcl_DATA_OTHERS },
300 { "kkw_CG", lcl_DATA_OTHERS },
301 { "kng_CG", lcl_DATA_OTHERS },
302 { "ldi_CG", lcl_DATA_OTHERS },
303 { "mdw_CG", lcl_DATA_OTHERS },
304 { "mkw_CG", lcl_DATA_OTHERS },
305 { "njx_CG", lcl_DATA_OTHERS },
306 { "ngz_CG", lcl_DATA_OTHERS },
307 { "njy_CG", lcl_DATA_OTHERS },
308 { "puu_CG", lcl_DATA_OTHERS },
309 { "sdj_CG", lcl_DATA_OTHERS },
310 { "tek_CG", lcl_DATA_OTHERS },
311 { "tsa_CG", lcl_DATA_OTHERS },
312 { "vif_CG", lcl_DATA_OTHERS },
313 { "xku_CG", lcl_DATA_OTHERS },
314 { "yom_CG", lcl_DATA_OTHERS },
315 { "sid_ET", lcl_DATA_OTHERS },
316 { "bo_CN", lcl_DATA_OTHERS },
317 { "bo_IN", lcl_DATA_OTHERS },
318 { "ar_AE", lcl_DATA_OTHERS },
319 { "ar_KW", lcl_DATA_OTHERS },
320 { "bm_ML", lcl_DATA_OTHERS },
321 { "pui_CO", lcl_DATA_OTHERS },
322 { "lgr_SB", lcl_DATA_OTHERS },
323 { "mos_BF", lcl_DATA_OTHERS },
324 { "ny_MW", lcl_DATA_OTHERS },
325 { "ar_BH", lcl_DATA_OTHERS },
326 { "ar_IQ", lcl_DATA_OTHERS },
327 { "ar_JO", lcl_DATA_OTHERS },
328 { "ar_LY", lcl_DATA_OTHERS },
329 { "ar_MA", lcl_DATA_OTHERS },
330 { "ar_QA", lcl_DATA_OTHERS },
331 { "ar_SY", lcl_DATA_OTHERS },
332 { "ar_YE", lcl_DATA_OTHERS },
333 { "ilo_PH", lcl_DATA_OTHERS },
334 { "ha_Latn_NG", lcl_DATA_OTHERS },
335 { "min_ID", lcl_DATA_OTHERS },
336 { "sun_ID", lcl_DATA_OTHERS },
337 { "en_IL", lcl_DATA_OTHERS }, // needs to be in OTHERS instead of EN because inherits from he_IL
338 { "pdc_US", lcl_DATA_OTHERS },
339 { "dv_MV", lcl_DATA_OTHERS }
341
342#else
343
344#include "localedata_static.hxx"
345
346#endif
347
348const sal_Unicode cUnder = '_';
350
352
353namespace i18npool {
354
355// static
357{
358 return comphelper::containerToSequence<CalendarItem>(rCi);
359}
360
361
362// static
364{
365 Calendar aCal(
366 downcastCalendarItems( rC.Days),
367 downcastCalendarItems( rC.Months),
368 downcastCalendarItems( rC.Eras),
369 rC.StartOfWeek,
370 rC.MinimumNumberOfDaysForFirstWeek,
371 rC.Default,
372 rC.Name
373 );
374 return aCal;
375}
376
377
379{
380}
382{
383}
384
385
386LocaleDataItem SAL_CALL
387LocaleDataImpl::getLocaleItem( const Locale& rLocale )
388{
389 MyFunc_Type func = reinterpret_cast<MyFunc_Type>(getFunctionSymbol( rLocale, "getLocaleItem" ));
390
391 if ( func ) {
392 sal_Int16 dataItemCount = 0;
393 sal_Unicode **dataItem = func(dataItemCount);
394
395 LocaleDataItem item{
396 OUString(dataItem[0]),
397 OUString(dataItem[1]),
398 OUString(dataItem[2]),
399 OUString(dataItem[3]),
400 OUString(dataItem[4]),
401 OUString(dataItem[5]),
402 OUString(dataItem[6]),
403 OUString(dataItem[7]),
404 OUString(dataItem[8]),
405 OUString(dataItem[9]),
406 OUString(dataItem[10]),
407 OUString(dataItem[11]),
408 OUString(dataItem[12]),
409 OUString(dataItem[13]),
410 OUString(dataItem[14]),
411 OUString(dataItem[15]),
412 OUString(dataItem[16]),
413 OUString(dataItem[17])
414 };
415 return item;
416 }
417 else {
418 LocaleDataItem item1;
419 return item1;
420 }
421}
422
423
424LocaleDataItem2 SAL_CALL
425LocaleDataImpl::getLocaleItem2( const Locale& rLocale )
426{
427 MyFunc_Type func = reinterpret_cast<MyFunc_Type>(getFunctionSymbol( rLocale, "getLocaleItem" ));
428
429 if ( func ) {
430 sal_Int16 dataItemCount = 0;
431 sal_Unicode **dataItem = func(dataItemCount);
432
433 assert(dataItemCount >= 18);
434
435 LocaleDataItem2 item{
436 OUString(dataItem[0]),
437 OUString(dataItem[1]),
438 OUString(dataItem[2]),
439 OUString(dataItem[3]),
440 OUString(dataItem[4]),
441 OUString(dataItem[5]),
442 OUString(dataItem[6]),
443 OUString(dataItem[7]),
444 OUString(dataItem[8]),
445 OUString(dataItem[9]),
446 OUString(dataItem[10]),
447 OUString(dataItem[11]),
448 OUString(dataItem[12]),
449 OUString(dataItem[13]),
450 OUString(dataItem[14]),
451 OUString(dataItem[15]),
452 OUString(dataItem[16]),
453 OUString(dataItem[17]),
454 dataItemCount >= 19 ? OUString(dataItem[18]) : OUString()
455 };
456 return item;
457 }
458 else {
459 LocaleDataItem2 item1;
460 return item1;
461 }
462}
463
464#ifndef DISABLE_DYNLOADING
465
466extern "C" { static void thisModule() {} }
467
468#endif
469
470namespace
471{
472
473// implement the lookup table as a safe static object
474class lcl_LookupTableHelper
475{
476public:
477 lcl_LookupTableHelper();
478 ~lcl_LookupTableHelper();
479
480 oslGenericFunction getFunctionSymbolByName(
481 const OUString& localeName, const char* pFunction,
482 std::optional<LocaleDataLookupTableItem>& rOutCachedItem );
483
484private:
485 std::mutex maMutex;
486 ::std::vector< LocaleDataLookupTableItem > maLookupTable;
487};
488
489// from instance.hxx: Helper base class for a late-initialized
490// (default-constructed) static variable, implementing the double-checked
491// locking pattern correctly.
492// usage: lcl_LookupTableHelper & rLookupTable = lcl_LookupTableStatic::get();
493// retrieves the singleton lookup table instance
494lcl_LookupTableHelper& lcl_LookupTableStatic()
495{
496 static lcl_LookupTableHelper SINGLETON;
497 return SINGLETON;
498}
499
500lcl_LookupTableHelper::lcl_LookupTableHelper()
501{
502}
503
504lcl_LookupTableHelper::~lcl_LookupTableHelper()
505{
506 for ( const LocaleDataLookupTableItem& item : maLookupTable ) {
507 delete item.module;
508 }
509}
510
511oslGenericFunction lcl_LookupTableHelper::getFunctionSymbolByName(
512 const OUString& localeName, const char* pFunction,
513 std::optional<LocaleDataLookupTableItem>& rOutCachedItem )
514{
515 OUString aFallback;
516 bool bFallback = (localeName.indexOf( cUnder) < 0);
517 if (bFallback)
518 {
519 Locale aLocale;
520 aLocale.Language = localeName;
521 Locale aFbLocale = MsLangId::getFallbackLocale( aLocale);
522 if (aFbLocale == aLocale)
523 bFallback = false; // may be a "language-only-locale" like Interlingua (ia)
524 else
525 aFallback = LocaleDataImpl::getFirstLocaleServiceName( aFbLocale);
526 }
527
528 for (const auto & i : aLibTable)
529 {
530 if (localeName.equalsAscii(i.pLocale) ||
531 (bFallback && aFallback.equalsAscii(i.pLocale)))
532 {
533#ifndef DISABLE_DYNLOADING
534 {
535 std::unique_lock aGuard( maMutex );
536 for (LocaleDataLookupTableItem & rCurrent : maLookupTable)
537 {
538 if (rCurrent.dllName == i.pLib)
539 {
540 rOutCachedItem.emplace( rCurrent );
541 rOutCachedItem->localeName = i.pLocale;
542 OString sSymbolName = OString::Concat(pFunction) + "_" +
543 rOutCachedItem->localeName;
544 return rOutCachedItem->module->getFunctionSymbol(
545 sSymbolName.getStr());
546 }
547 }
548 }
549 // Library not loaded, load it and add it to the list.
550#ifdef SAL_DLLPREFIX
551 OString sModuleName = // mostly "lib*.so"
552 OString::Concat(SAL_DLLPREFIX) + i.pLib + SAL_DLLEXTENSION;
553#else
554 OString sModuleName = // mostly "*.dll"
555 OString::Concat(i.pLib) + SAL_DLLEXTENSION;
556#endif
557 std::unique_ptr<osl::Module> module(new osl::Module());
558 if ( module->loadRelative(&thisModule, sModuleName.getStr()) )
559 {
560 std::unique_lock aGuard( maMutex );
561 auto pTmpModule = module.get();
562 maLookupTable.emplace_back(i.pLib, module.release(), i.pLocale);
563 rOutCachedItem.emplace( maLookupTable.back() );
564 OString sSymbolName = OString::Concat(pFunction) + "_" + rOutCachedItem->localeName;
565 return pTmpModule->getFunctionSymbol(sSymbolName.getStr());
566 }
567 else
568 module.reset();
569#else
570 (void) rOutCachedItem;
571
572 if( strcmp(pFunction, "getAllCalendars") == 0 )
573 return i.getAllCalendars;
574 else if( strcmp(pFunction, "getAllCurrencies") == 0 )
575 return i.getAllCurrencies;
576 else if( strcmp(pFunction, "getAllFormats0") == 0 )
577 return i.getAllFormats0;
578 else if( strcmp(pFunction, "getBreakIteratorRules") == 0 )
579 return i.getBreakIteratorRules;
580 else if( strcmp(pFunction, "getCollationOptions") == 0 )
581 return i.getCollationOptions;
582 else if( strcmp(pFunction, "getCollatorImplementation") == 0 )
583 return i.getCollatorImplementation;
584 else if( strcmp(pFunction, "getContinuousNumberingLevels") == 0 )
585 return i.getContinuousNumberingLevels;
586 else if( strcmp(pFunction, "getDateAcceptancePatterns") == 0 )
587 return i.getDateAcceptancePatterns;
588 else if( strcmp(pFunction, "getFollowPageWords") == 0 )
589 return i.getFollowPageWords;
590 else if( strcmp(pFunction, "getForbiddenCharacters") == 0 )
591 return i.getForbiddenCharacters;
592 else if( strcmp(pFunction, "getIndexAlgorithm") == 0 )
593 return i.getIndexAlgorithm;
594 else if( strcmp(pFunction, "getLCInfo") == 0 )
595 return i.getLCInfo;
596 else if( strcmp(pFunction, "getLocaleItem") == 0 )
597 return i.getLocaleItem;
598 else if( strcmp(pFunction, "getOutlineNumberingLevels") == 0 )
599 return i.getOutlineNumberingLevels;
600 else if( strcmp(pFunction, "getReservedWords") == 0 )
601 return i.getReservedWords;
602 else if( strcmp(pFunction, "getSearchOptions") == 0 )
603 return i.getSearchOptions;
604 else if( strcmp(pFunction, "getTransliterations") == 0 )
605 return i.getTransliterations;
606 else if( strcmp(pFunction, "getUnicodeScripts") == 0 )
607 return i.getUnicodeScripts;
608 else if( strcmp(pFunction, "getAllFormats1") == 0 )
609 return i.getAllFormats1;
610#endif
611 }
612 }
613 return nullptr;
614}
615
616} // anonymous namespace
617
618
619// REF values equal offsets of counts within getAllCalendars() data structure!
620#define REF_DAYS 0
621#define REF_MONTHS 1
622#define REF_GMONTHS 2
623#define REF_PMONTHS 3
624#define REF_ERAS 4
625#define REF_OFFSET_COUNT 5
626
628 const Locale& rLocale, const Sequence< Calendar2 >& calendarsSeq, sal_Int16 item)
629{
630 if (ref_name != name) {
631 OUString aLocStr, id;
632 sal_Int32 nLastUnder = name.lastIndexOf( cUnder);
633 SAL_WARN_IF( nLastUnder < 1, "i18npool",
634 "LocaleDataImpl::getCalendarItemByName - no '_' or first in name can't be right: " << name);
635 if (nLastUnder >= 0)
636 {
637 aLocStr = name.copy( 0, nLastUnder);
638 if (nLastUnder + 1 < name.getLength())
639 id = name.copy( nLastUnder + 1);
640 }
641 Locale loc( LanguageTag::convertToLocale( aLocStr.replace( cUnder, cHyphen)));
643 if (loc == rLocale) {
644 cals = calendarsSeq;
645 } else {
646 cals = getAllCalendars2(loc);
647 }
648 auto pCal = std::find_if(std::cbegin(cals), std::cend(cals),
649 [&id](const Calendar2& rCal) { return id == rCal.Name; });
650 if (pCal != std::cend(cals))
651 ref_cal = *pCal;
652 else {
653 // Referred locale not found, return name for en_US locale.
654 cals = getAllCalendars2( Locale("en", "US", OUString()) );
655 if (!cals.hasElements())
656 throw RuntimeException();
657 ref_cal = cals.getConstArray()[0];
658 }
659 ref_name = name;
660 }
661 switch (item)
662 {
663 case REF_DAYS:
664 return ref_cal.Days;
665 case REF_MONTHS:
666 return ref_cal.Months;
667 case REF_GMONTHS:
668 return ref_cal.GenitiveMonths;
669 case REF_PMONTHS:
670 return ref_cal.PartitiveMonths;
671 default:
672 OSL_FAIL( "LocaleDataImpl::getCalendarItemByName: unhandled REF_* case");
673 [[fallthrough]];
674 case REF_ERAS:
675 return ref_cal.Eras;
676 }
677}
678
680 sal_Unicode const * const * const allCalendars, sal_Int16 & rnOffset,
681 const sal_Int16 nWhichItem, const sal_Int16 nCalendar,
682 const Locale & rLocale, const Sequence< Calendar2 > & calendarsSeq )
683{
685 if ( allCalendars[rnOffset] == std::u16string_view(u"ref") )
686 {
687 aItems = getCalendarItemByName( OUString( allCalendars[rnOffset+1]), rLocale, calendarsSeq, nWhichItem);
688 rnOffset += 2;
689 }
690 else
691 {
692 const sal_Int32 nSize = allCalendars[nWhichItem][nCalendar];
693 aItems.realloc( nSize);
694 switch (nWhichItem)
695 {
696 case REF_DAYS:
697 case REF_MONTHS:
698 case REF_GMONTHS:
699 case REF_PMONTHS:
700 for (CalendarItem2& rItem : asNonConstRange(aItems))
701 {
702 rItem = CalendarItem2{ OUString(allCalendars[rnOffset]),
703 OUString(allCalendars[rnOffset+1]),
704 OUString(allCalendars[rnOffset+2]), OUString(allCalendars[rnOffset+3])};
705 rnOffset += 4;
706 }
707 break;
708 case REF_ERAS:
709 // Absent narrow name.
710 for (CalendarItem2& rItem : asNonConstRange(aItems))
711 {
712 rItem = CalendarItem2{ OUString(allCalendars[rnOffset]),
713 OUString(allCalendars[rnOffset+1]),
714 OUString(allCalendars[rnOffset+2]), OUString()};
715 rnOffset += 3;
716 }
717 break;
718 default:
719 OSL_FAIL( "LocaleDataImpl::getCalendarItems: unhandled REF_* case");
720 }
721 }
722 return aItems;
723}
724
726LocaleDataImpl::getAllCalendars2( const Locale& rLocale )
727{
728
729 sal_Unicode const * const * allCalendars = nullptr;
730
731 MyFunc_Type func = reinterpret_cast<MyFunc_Type>(getFunctionSymbol( rLocale, "getAllCalendars" ));
732
733 if ( func ) {
734 sal_Int16 calendarsCount = 0;
735 allCalendars = func(calendarsCount);
736
737 Sequence< Calendar2 > calendarsSeq(calendarsCount);
738 auto calendarsSeqRange = asNonConstRange(calendarsSeq);
739 sal_Int16 offset = REF_OFFSET_COUNT;
740 for(sal_Int16 i = 0; i < calendarsCount; i++) {
741 OUString calendarID(allCalendars[offset]);
742 offset++;
743 bool defaultCalendar = allCalendars[offset][0] != 0;
744 offset++;
745 Sequence< CalendarItem2 > days = getCalendarItems( allCalendars, offset, REF_DAYS, i,
746 rLocale, calendarsSeq);
747 Sequence< CalendarItem2 > months = getCalendarItems( allCalendars, offset, REF_MONTHS, i,
748 rLocale, calendarsSeq);
749 Sequence< CalendarItem2 > gmonths = getCalendarItems( allCalendars, offset, REF_GMONTHS, i,
750 rLocale, calendarsSeq);
751 Sequence< CalendarItem2 > pmonths = getCalendarItems( allCalendars, offset, REF_PMONTHS, i,
752 rLocale, calendarsSeq);
753 Sequence< CalendarItem2 > eras = getCalendarItems( allCalendars, offset, REF_ERAS, i,
754 rLocale, calendarsSeq);
755 OUString startOfWeekDay(allCalendars[offset]);
756 offset++;
757 sal_Int16 minimalDaysInFirstWeek = allCalendars[offset][0];
758 offset++;
759 Calendar2 aCalendar(days, months, gmonths, pmonths, eras, startOfWeekDay,
760 minimalDaysInFirstWeek, defaultCalendar, calendarID);
761 calendarsSeqRange[i] = aCalendar;
762 }
763 return calendarsSeq;
764 }
765 else {
766 return {};
767 }
768}
769
770
772LocaleDataImpl::getAllCalendars( const Locale& rLocale )
773{
774 const Sequence< Calendar2 > aCal2( getAllCalendars2( rLocale));
775 std::vector<Calendar> aCal1;
776 aCal1.reserve(aCal2.getLength());
777 std::transform(aCal2.begin(), aCal2.end(), std::back_inserter(aCal1),
778 [](const Calendar2& rCal2) { return downcastCalendar(rCal2); });
780}
781
782
784LocaleDataImpl::getAllCurrencies2( const Locale& rLocale )
785{
786 MyFunc_Type func = reinterpret_cast<MyFunc_Type>(getFunctionSymbol( rLocale, "getAllCurrencies" ));
787
788 if ( func ) {
789 sal_Int16 currencyCount = 0;
790 sal_Unicode **allCurrencies = func(currencyCount);
791
792 Sequence< Currency2 > seq(currencyCount);
793 auto seqRange = asNonConstRange(seq);
794 for(int i = 0, nOff = 0; i < currencyCount; i++, nOff += 8 ) {
795 Currency2 cur(
796 OUString(allCurrencies[nOff]), // string ID
797 OUString(allCurrencies[nOff+1]), // string Symbol
798 OUString(allCurrencies[nOff+2]), // string BankSymbol
799 OUString(allCurrencies[nOff+3]), // string Name
800 allCurrencies[nOff+4][0] != 0, // boolean Default
801 allCurrencies[nOff+5][0] != 0, // boolean UsedInCompatibleFormatCodes
802 allCurrencies[nOff+6][0], // short DecimalPlaces
803 allCurrencies[nOff+7][0] != 0 // boolean LegacyOnly
804 );
805 seqRange[i] = cur;
806 }
807 return seq;
808 }
809 else {
810 return {};
811 }
812}
813
814
816LocaleDataImpl::getAllCurrencies( const Locale& rLocale )
817{
818 return comphelper::containerToSequence<Currency>(getAllCurrencies2(rLocale));
819}
820
821
823LocaleDataImpl::getAllFormats( const Locale& rLocale )
824{
825 const int SECTIONS = 2;
826 struct FormatSection
827 {
829 sal_Unicode const *from;
830 sal_Unicode const *to;
831 sal_Unicode const *const *formatArray;
832 sal_Int16 formatCount;
833
834 FormatSection() : func(nullptr), from(nullptr), to(nullptr), formatArray(nullptr), formatCount(0) {}
835 sal_Int16 getFunc( LocaleDataImpl& rLocaleData, const Locale& rL, const char* pName )
836 {
837 func = reinterpret_cast<MyFunc_FormatCode>( rLocaleData.getFunctionSymbol( rL, pName));
838 if (func)
839 formatArray = func( formatCount, from, to);
840 return formatCount;
841 }
842 } section[SECTIONS];
843
844 sal_Int32 formatCount;
845 formatCount = section[0].getFunc( *this, rLocale, "getAllFormats0");
846 formatCount += section[1].getFunc( *this, rLocale, "getAllFormats1");
847
848 Sequence< FormatElement > seq(formatCount);
849 auto seqRange = asNonConstRange(seq);
850 sal_Int32 f = 0;
851 for (const FormatSection & s : section)
852 {
853 sal_Unicode const * const * const formatArray = s.formatArray;
854 if ( formatArray )
855 {
856 for (int i = 0, nOff = 0; i < s.formatCount; ++i, nOff += 7, ++f)
857 {
858 FormatElement elem(
859 OUString(formatArray[nOff]).replaceAll(s.from, s.to),
860 OUString(formatArray[nOff + 1]),
861 OUString(formatArray[nOff + 2]),
862 OUString(formatArray[nOff + 3]),
863 OUString(formatArray[nOff + 4]),
864 formatArray[nOff + 5][0],
865 formatArray[nOff + 6][0] != 0);
866 seqRange[f] = elem;
867 }
868 }
869 }
870 return seq;
871}
872
873
876{
877 MyFunc_Type func = reinterpret_cast<MyFunc_Type>(getFunctionSymbol( rLocale, "getDateAcceptancePatterns" ));
878
879 if (func)
880 {
881 sal_Int16 patternsCount = 0;
882 sal_Unicode **patternsArray = func( patternsCount );
883 Sequence< OUString > seq( patternsCount );
884 auto seqRange = asNonConstRange(seq);
885 for (sal_Int16 i = 0; i < patternsCount; ++i)
886 {
887 seqRange[i] = OUString( patternsArray[i] );
888 }
889 return seq;
890 }
891 else
892 {
893 return {};
894 }
895}
896
897
898#define COLLATOR_OFFSET_ALGO 0
899#define COLLATOR_OFFSET_DEFAULT 1
900#define COLLATOR_OFFSET_RULE 2
901#define COLLATOR_ELEMENTS 3
902
903OUString
904LocaleDataImpl::getCollatorRuleByAlgorithm( const Locale& rLocale, std::u16string_view algorithm )
905{
906 MyFunc_Type func = reinterpret_cast<MyFunc_Type>(getFunctionSymbol( rLocale, "getCollatorImplementation" ));
907 if ( func ) {
908 sal_Int16 collatorCount = 0;
909 sal_Unicode **collatorArray = func(collatorCount);
910 for(sal_Int16 i = 0; i < collatorCount; i++)
911 if (algorithm == collatorArray[i * COLLATOR_ELEMENTS + COLLATOR_OFFSET_ALGO])
912 return OUString(collatorArray[i * COLLATOR_ELEMENTS + COLLATOR_OFFSET_RULE]);
913 }
914 return OUString();
915}
916
917
920{
921 MyFunc_Type func = reinterpret_cast<MyFunc_Type>(getFunctionSymbol( rLocale, "getCollatorImplementation" ));
922
923 if ( func ) {
924 sal_Int16 collatorCount = 0;
925 sal_Unicode **collatorArray = func(collatorCount);
926 Sequence< Implementation > seq(collatorCount);
927 auto seqRange = asNonConstRange(seq);
928 for(sal_Int16 i = 0; i < collatorCount; i++) {
929 Implementation impl(
930 OUString(collatorArray[i * COLLATOR_ELEMENTS + COLLATOR_OFFSET_ALGO]),
931 collatorArray[i * COLLATOR_ELEMENTS + COLLATOR_OFFSET_DEFAULT][0] != 0);
932 seqRange[i] = impl;
933 }
934 return seq;
935 }
936 else {
937 return {};
938 }
939}
940
943{
944 MyFunc_Type func = reinterpret_cast<MyFunc_Type>(getFunctionSymbol( rLocale, "getCollationOptions" ));
945
946 if ( func ) {
947 sal_Int16 optionsCount = 0;
948 sal_Unicode **optionsArray = func(optionsCount);
949 Sequence< OUString > seq(optionsCount);
950 auto seqRange = asNonConstRange(seq);
951 for(sal_Int16 i = 0; i < optionsCount; i++) {
952 seqRange[i] = OUString( optionsArray[i] );
953 }
954 return seq;
955 }
956 else {
957 return {};
958 }
959}
960
962LocaleDataImpl::getSearchOptions( const Locale& rLocale )
963{
964 MyFunc_Type func = reinterpret_cast<MyFunc_Type>(getFunctionSymbol( rLocale, "getSearchOptions" ));
965
966 if ( func ) {
967 sal_Int16 optionsCount = 0;
968 sal_Unicode **optionsArray = func(optionsCount);
969 Sequence< OUString > seq(optionsCount);
970 auto seqRange = asNonConstRange(seq);
971 for(sal_Int16 i = 0; i < optionsCount; i++) {
972 seqRange[i] = OUString( optionsArray[i] );
973 }
974 return seq;
975 }
976 else {
977 return {};
978 }
979}
980
982LocaleDataImpl::getIndexArray(const Locale& rLocale, sal_Int16& indexCount)
983{
984 MyFunc_Type func = reinterpret_cast<MyFunc_Type>(getFunctionSymbol( rLocale, "getIndexAlgorithm" ));
985
986 if (func)
987 return func(indexCount);
988 return nullptr;
989}
990
992LocaleDataImpl::getIndexAlgorithm( const Locale& rLocale )
993{
994 sal_Int16 indexCount = 0;
995 sal_Unicode **indexArray = getIndexArray(rLocale, indexCount);
996
997 if ( indexArray ) {
998 Sequence< OUString > seq(indexCount);
999 auto seqRange = asNonConstRange(seq);
1000 for(sal_Int16 i = 0; i < indexCount; i++) {
1001 seqRange[i] = indexArray[i*5];
1002 }
1003 return seq;
1004 }
1005 else {
1006 return {};
1007 }
1008}
1009
1010OUString
1012{
1013 sal_Int16 indexCount = 0;
1014 sal_Unicode **indexArray = getIndexArray(rLocale, indexCount);
1015
1016 if ( indexArray ) {
1017 for(sal_Int16 i = 0; i < indexCount; i++) {
1018 if (indexArray[i*5 + 3][0])
1019 return OUString(indexArray[i*5]);
1020 }
1021 }
1022 return OUString();
1023}
1024
1025bool
1026LocaleDataImpl::hasPhonetic( const Locale& rLocale )
1027{
1028 sal_Int16 indexCount = 0;
1029 sal_Unicode **indexArray = getIndexArray(rLocale, indexCount);
1030
1031 if ( indexArray ) {
1032 for(sal_Int16 i = 0; i < indexCount; i++) {
1033 if (indexArray[i*5 + 4][0])
1034 return true;
1035 }
1036 }
1037 return false;
1038}
1039
1040sal_Unicode **
1041LocaleDataImpl::getIndexArrayForAlgorithm(const Locale& rLocale, std::u16string_view algorithm)
1042{
1043 sal_Int16 indexCount = 0;
1044 sal_Unicode **indexArray = getIndexArray(rLocale, indexCount);
1045 if ( indexArray ) {
1046 for(sal_Int16 i = 0; i < indexCount; i++) {
1047 if (algorithm == indexArray[i*5])
1048 return indexArray+i*5;
1049 }
1050 }
1051 return nullptr;
1052}
1053
1054bool
1055LocaleDataImpl::isPhonetic( const Locale& rLocale, std::u16string_view algorithm )
1056{
1057 sal_Unicode **indexArray = getIndexArrayForAlgorithm(rLocale, algorithm);
1058 return indexArray && indexArray[4][0];
1059}
1060
1061OUString
1062LocaleDataImpl::getIndexKeysByAlgorithm( const Locale& rLocale, std::u16string_view algorithm )
1063{
1064 sal_Unicode **indexArray = getIndexArrayForAlgorithm(rLocale, algorithm);
1065 return indexArray ? (OUString::Concat(u"0-9") + indexArray[2]) : OUString();
1066}
1067
1068OUString
1069LocaleDataImpl::getIndexModuleByAlgorithm( const Locale& rLocale, std::u16string_view algorithm )
1070{
1071 sal_Unicode **indexArray = getIndexArrayForAlgorithm(rLocale, algorithm);
1072 return indexArray ? OUString(indexArray[1]) : OUString();
1073}
1074
1077{
1078 MyFunc_Type func = reinterpret_cast<MyFunc_Type>(getFunctionSymbol( rLocale, "getUnicodeScripts" ));
1079
1080 if ( func ) {
1081 sal_Int16 scriptCount = 0;
1082 sal_Unicode **scriptArray = func(scriptCount);
1083 Sequence< UnicodeScript > seq(scriptCount);
1084 auto seqRange = asNonConstRange(seq);
1085 for(sal_Int16 i = 0; i < scriptCount; i++) {
1086 seqRange[i] = UnicodeScript( o3tl::toInt32(std::u16string_view(scriptArray[i], 1)) );
1087 }
1088 return seq;
1089 }
1090 else {
1091 return {};
1092 }
1093}
1094
1097{
1098 MyFunc_Type func = reinterpret_cast<MyFunc_Type>(getFunctionSymbol( rLocale, "getFollowPageWords" ));
1099
1100 if ( func ) {
1101 sal_Int16 wordCount = 0;
1102 sal_Unicode **wordArray = func(wordCount);
1103 Sequence< OUString > seq(wordCount);
1104 auto seqRange = asNonConstRange(seq);
1105 for(sal_Int16 i = 0; i < wordCount; i++) {
1106 seqRange[i] = OUString(wordArray[i]);
1107 }
1108 return seq;
1109 }
1110 else {
1111 return {};
1112 }
1113}
1114
1115Sequence< OUString > SAL_CALL
1117{
1118 MyFunc_Type func = reinterpret_cast<MyFunc_Type>(getFunctionSymbol( rLocale, "getTransliterations" ));
1119
1120 if ( func ) {
1121 sal_Int16 transliterationsCount = 0;
1122 sal_Unicode **transliterationsArray = func(transliterationsCount);
1123
1124 Sequence< OUString > seq(transliterationsCount);
1125 auto seqRange = asNonConstRange(seq);
1126 for(int i = 0; i < transliterationsCount; i++) {
1127 OUString elem(transliterationsArray[i]);
1128 seqRange[i] = elem;
1129 }
1130 return seq;
1131 }
1132 else {
1133 return {};
1134 }
1135
1136
1137}
1138
1139
1140LanguageCountryInfo SAL_CALL
1142{
1143 MyFunc_Type func = reinterpret_cast<MyFunc_Type>(getFunctionSymbol( rLocale, "getLCInfo" ));
1144
1145 if ( func ) {
1146 sal_Int16 LCInfoCount = 0;
1147 sal_Unicode **LCInfoArray = func(LCInfoCount);
1148 LanguageCountryInfo info{OUString(LCInfoArray[0]),
1149 OUString(LCInfoArray[1]),
1150 OUString(LCInfoArray[2]),
1151 OUString(LCInfoArray[3]),
1152 OUString(LCInfoArray[4])};
1153 return info;
1154 }
1155 else {
1156 LanguageCountryInfo info1;
1157 return info1;
1158 }
1159
1160}
1161
1162
1163ForbiddenCharacters SAL_CALL
1165{
1166 MyFunc_Type func = reinterpret_cast<MyFunc_Type>(getFunctionSymbol( rLocale, "getForbiddenCharacters" ));
1167
1168 if ( func ) {
1169 sal_Int16 LCForbiddenCharactersCount = 0;
1170 sal_Unicode **LCForbiddenCharactersArray = func(LCForbiddenCharactersCount);
1171 ForbiddenCharacters chars{
1172 OUString(LCForbiddenCharactersArray[0]), OUString(LCForbiddenCharactersArray[1])};
1173 return chars;
1174 }
1175 else {
1176 ForbiddenCharacters chars1;
1177 return chars1;
1178 }
1179}
1180
1181OUString
1183{
1184 MyFunc_Type func = reinterpret_cast<MyFunc_Type>(getFunctionSymbol( rLocale, "getForbiddenCharacters" ));
1185
1186 if ( func ) {
1187 sal_Int16 LCForbiddenCharactersCount = 0;
1188 sal_Unicode **LCForbiddenCharactersArray = func(LCForbiddenCharactersCount);
1189 return OUString(LCForbiddenCharactersArray[2]);
1190 }
1191
1192 return OUString();
1193}
1194
1197{
1198 MyFunc_Type func = reinterpret_cast<MyFunc_Type>(getFunctionSymbol( rLocale, "getBreakIteratorRules" ));
1199
1200 if ( func ) {
1201 sal_Int16 LCBreakIteratorRuleCount = 0;
1202 sal_Unicode **LCBreakIteratorRulesArray = func(LCBreakIteratorRuleCount);
1203 Sequence< OUString > seq(LCBreakIteratorRuleCount);
1204 auto seqRange = asNonConstRange(seq);
1205 for(int i = 0; i < LCBreakIteratorRuleCount; i++) {
1206 OUString elem(LCBreakIteratorRulesArray[i]);
1207 seqRange[i] = elem;
1208 }
1209 return seq;
1210 }
1211 else {
1212 return {};
1213 }
1214}
1215
1216
1217Sequence< OUString > SAL_CALL
1218LocaleDataImpl::getReservedWord( const Locale& rLocale )
1219{
1220 MyFunc_Type func = reinterpret_cast<MyFunc_Type>(getFunctionSymbol( rLocale, "getReservedWords" ));
1221
1222 if ( func ) {
1223 sal_Int16 LCReservedWordsCount = 0;
1224 sal_Unicode **LCReservedWordsArray = func(LCReservedWordsCount);
1225 Sequence< OUString > seq(LCReservedWordsCount);
1226 auto seqRange = asNonConstRange(seq);
1227 for(int i = 0; i < LCReservedWordsCount; i++) {
1228 OUString elem(LCReservedWordsArray[i]);
1229 seqRange[i] = elem;
1230 }
1231 return seq;
1232 }
1233 else {
1234 return {};
1235 }
1236}
1237
1238
1241{
1242 // load symbol
1243 MyFunc_Type2 func = reinterpret_cast<MyFunc_Type2>(getFunctionSymbol( rLocale, "getContinuousNumberingLevels" ));
1244
1245 if ( func )
1246 {
1247 // invoke function
1248 sal_Int16 nStyles;
1249 sal_Int16 nAttributes;
1250 sal_Unicode const *** p0 = func( nStyles, nAttributes );
1251
1252 // allocate memory for nAttributes attributes for each of the nStyles styles.
1254 auto pvRange = asNonConstRange(pv);
1255 for( auto& i : pvRange ) {
1257 }
1258
1259 sal_Unicode const *** pStyle = p0;
1260 for( int i=0; i<nStyles; i++ ) {
1261 sal_Unicode const ** pAttribute = pStyle[i];
1262 auto pvElementRange = asNonConstRange(pvRange[i]);
1263 for( int j=0; j<nAttributes; j++ ) { // prefix, numberingtype, ...
1264 sal_Unicode const * pString = pAttribute[j];
1265 beans::PropertyValue& rVal = pvElementRange[j];
1266 OUString sVal;
1267 if( pString ) {
1268 if( 0 != j && 2 != j )
1269 sVal = pString;
1270 else if( *pString )
1271 sVal = OUString( pString, 1 );
1272 }
1273
1274 switch( j )
1275 {
1276 case 0:
1277 rVal.Name = "Prefix";
1278 rVal.Value <<= sVal;
1279 break;
1280 case 1:
1281 rVal.Name = "NumberingType";
1282 rVal.Value <<= static_cast<sal_Int16>(sVal.toInt32());
1283 break;
1284 case 2:
1285 rVal.Name = "Suffix";
1286 rVal.Value <<= sVal;
1287 break;
1288 case 3:
1289 rVal.Name = "Transliteration";
1290 rVal.Value <<= sVal;
1291 break;
1292 case 4:
1293 rVal.Name = "NatNum";
1294 rVal.Value <<= static_cast<sal_Int16>(sVal.toInt32());
1295 break;
1296 default:
1297 OSL_ASSERT(false);
1298 }
1299 }
1300 }
1301 return pv;
1302 }
1303
1305}
1306
1307// OutlineNumbering helper class
1308
1309namespace {
1310
1311struct OutlineNumberingLevel_Impl
1312{
1313 OUString sPrefix;
1314 sal_Int16 nNumType; //css::style::NumberingType
1315 OUString sSuffix;
1319 sal_Int32 nLeftMargin;
1322 sal_Int16 nAdjust;
1324 sal_Int32 nNatNum;
1325};
1326
1327class OutlineNumbering : public cppu::WeakImplHelper < container::XIndexAccess >
1328{
1329 // OutlineNumbering helper class
1330
1331 std::unique_ptr<const OutlineNumberingLevel_Impl[]> m_pOutlineLevels;
1332 sal_Int16 m_nCount;
1333public:
1334 OutlineNumbering(std::unique_ptr<const OutlineNumberingLevel_Impl[]> pOutlineLevels, int nLevels);
1335
1336 //XIndexAccess
1337 virtual sal_Int32 SAL_CALL getCount( ) override;
1338 virtual Any SAL_CALL getByIndex( sal_Int32 Index ) override;
1339
1340 //XElementAccess
1341 virtual Type SAL_CALL getElementType( ) override;
1342 virtual sal_Bool SAL_CALL hasElements( ) override;
1343};
1344
1345}
1346
1348LocaleDataImpl::getOutlineNumberingLevels( const lang::Locale& rLocale )
1349{
1350 // load symbol
1351 MyFunc_Type3 func = reinterpret_cast<MyFunc_Type3>(getFunctionSymbol( rLocale, "getOutlineNumberingLevels" ));
1352
1353 if ( func )
1354 {
1355 int i;
1356 // invoke function
1357 sal_Int16 nStyles;
1358 sal_Int16 nLevels;
1359 sal_Int16 nAttributes;
1360 sal_Unicode const **** p0 = func( nStyles, nLevels, nAttributes );
1361
1363 auto aRetRange = asNonConstRange(aRet);
1364 sal_Unicode const **** pStyle = p0;
1365 for( i=0; i<nStyles; i++ )
1366 {
1367 int j;
1368
1369 std::unique_ptr<OutlineNumberingLevel_Impl[]> level(new OutlineNumberingLevel_Impl[ nLevels+1 ]);
1370 sal_Unicode const *** pLevel = pStyle[i];
1371 for( j = 0; j < nLevels; j++ )
1372 {
1373 sal_Unicode const ** pAttribute = pLevel[j];
1374 for( int k=0; k<nAttributes; k++ )
1375 {
1376 OUString tmp( pAttribute[k] );
1377 switch( k )
1378 {
1379 case 0: level[j].sPrefix = tmp; break;
1380 case 1: level[j].nNumType = sal::static_int_cast<sal_Int16>(tmp.toInt32()); break;
1381 case 2: level[j].sSuffix = tmp; break;
1382 case 3: level[j].cBulletChar = sal::static_int_cast<sal_Unicode>(tmp.toUInt32(16)); break; // base 16
1383 case 4: level[j].sBulletFontName = tmp; break;
1384 case 5: level[j].nParentNumbering = sal::static_int_cast<sal_Int16>(tmp.toInt32()); break;
1385 case 6: level[j].nLeftMargin = tmp.toInt32(); break;
1386 case 7: level[j].nSymbolTextDistance = tmp.toInt32(); break;
1387 case 8: level[j].nFirstLineOffset = tmp.toInt32(); break;
1388 case 9: level[j].nAdjust = sal::static_int_cast<sal_Int16>(tmp.toInt32()); break;
1389 case 10: level[j].sTransliteration = tmp; break;
1390 case 11: level[j].nNatNum = tmp.toInt32(); break;
1391 default:
1392 OSL_ASSERT(false);
1393 }
1394 }
1395 }
1396 level[j].sPrefix.clear();
1397 level[j].nNumType = 0;
1398 level[j].sSuffix.clear();
1399 level[j].nAdjust = 0;
1400 level[j].cBulletChar = 0;
1401 level[j].sBulletFontName.clear();
1402 level[j].nParentNumbering = 0;
1403 level[j].nLeftMargin = 0;
1404 level[j].nSymbolTextDistance = 0;
1405 level[j].nFirstLineOffset = 0;
1406 level[j].sTransliteration.clear();
1407 level[j].nNatNum = 0;
1408 aRetRange[i] = new OutlineNumbering( std::move(level), nLevels );
1409 }
1410 return aRet;
1411 }
1412 else {
1413 return {};
1414 }
1415}
1416
1417// helper functions
1418
1419oslGenericFunction LocaleDataImpl::getFunctionSymbol( const Locale& rLocale, const char* pFunction )
1420{
1421 lcl_LookupTableHelper & rLookupTable = lcl_LookupTableStatic();
1422
1423 if (moCachedItem && moCachedItem->equals(rLocale))
1424 {
1425 OString sSymbolName = OString::Concat(pFunction) + "_" +
1426 moCachedItem->localeName;
1427 return moCachedItem->module->getFunctionSymbol(sSymbolName.getStr());
1428 }
1429
1430 oslGenericFunction pSymbol = nullptr;
1431 std::optional<LocaleDataLookupTableItem> oCachedItem;
1432
1433 // Load function with name <func>_<lang>_<country> or <func>_<bcp47> and
1434 // fallbacks.
1435 pSymbol = rLookupTable.getFunctionSymbolByName( LocaleDataImpl::getFirstLocaleServiceName( rLocale),
1436 pFunction, oCachedItem);
1437 if (!pSymbol)
1438 {
1439 ::std::vector< OUString > aFallbacks( LocaleDataImpl::getFallbackLocaleServiceNames( rLocale));
1440 for (const auto& rFallback : aFallbacks)
1441 {
1442 pSymbol = rLookupTable.getFunctionSymbolByName(rFallback, pFunction, oCachedItem);
1443 if (pSymbol)
1444 break;
1445 }
1446 }
1447 if (!pSymbol)
1448 {
1449 // load default function with name <func>_en_US
1450 pSymbol = rLookupTable.getFunctionSymbolByName("en_US", pFunction, oCachedItem);
1451 }
1452
1453 if (!pSymbol)
1454 // Appropriate symbol could not be found. Give up.
1455 throw RuntimeException();
1456
1457 if (oCachedItem)
1458 moCachedItem = std::move(oCachedItem);
1459 if (moCachedItem)
1460 moCachedItem->aLocale = rLocale;
1461
1462 return pSymbol;
1463}
1464
1465Sequence< Locale > SAL_CALL
1467{
1469 auto seqRange = asNonConstRange(seq);
1470 sal_Int16 nInstalled = 0;
1471
1472 for(const auto & i : aLibTable) {
1473 OUString name = OUString::createFromAscii( i.pLocale );
1474
1475 // Check if the locale is really available and not just in the table,
1476 // don't allow fall backs.
1477 std::optional<LocaleDataLookupTableItem> oCachedItem;
1478 if (lcl_LookupTableStatic().getFunctionSymbolByName( name, "getLocaleItem", oCachedItem )) {
1479 if( oCachedItem )
1480 moCachedItem = std::move( oCachedItem );
1481 seqRange[nInstalled++] = LanguageTag::convertToLocale( name.replace( cUnder, cHyphen), false);
1482 }
1483 }
1484 if ( nInstalled < nbOfLocales )
1485 seq.realloc( nInstalled ); // reflect reality
1486
1487 return seq;
1488}
1489
1490using namespace ::com::sun::star::container;
1491using namespace ::com::sun::star::beans;
1492
1493OutlineNumbering::OutlineNumbering(std::unique_ptr<const OutlineNumberingLevel_Impl[]> pOutlnLevels, int nLevels) :
1494 m_pOutlineLevels(std::move(pOutlnLevels)),
1495 m_nCount(sal::static_int_cast<sal_Int16>(nLevels))
1496{
1497}
1498
1499sal_Int32 OutlineNumbering::getCount( )
1500{
1501 return m_nCount;
1502}
1503
1504Any OutlineNumbering::getByIndex( sal_Int32 nIndex )
1505{
1506 if(nIndex < 0 || nIndex >= m_nCount)
1507 throw IndexOutOfBoundsException();
1508 const OutlineNumberingLevel_Impl* pTemp = m_pOutlineLevels.get();
1509 pTemp += nIndex;
1510 Any aRet;
1511
1512 Sequence<PropertyValue> aOutlineNumbering(12);
1513 PropertyValue* pValues = aOutlineNumbering.getArray();
1514 pValues[0].Name = "Prefix";
1515 pValues[0].Value <<= pTemp->sPrefix;
1516 pValues[1].Name = "NumberingType";
1517 pValues[1].Value <<= pTemp->nNumType;
1518 pValues[2].Name = "Suffix";
1519 pValues[2].Value <<= pTemp->sSuffix;
1520 pValues[3].Name = "BulletChar";
1521 pValues[3].Value <<= OUString(&pTemp->cBulletChar, 1);
1522 pValues[4].Name = "BulletFontName";
1523 pValues[4].Value <<= pTemp->sBulletFontName;
1524 pValues[5].Name = "ParentNumbering";
1525 pValues[5].Value <<= pTemp->nParentNumbering;
1526 pValues[6].Name = "LeftMargin";
1527 pValues[6].Value <<= pTemp->nLeftMargin;
1528 pValues[7].Name = "SymbolTextDistance";
1529 pValues[7].Value <<= pTemp->nSymbolTextDistance;
1530 pValues[8].Name = "FirstLineOffset";
1531 pValues[8].Value <<= pTemp->nFirstLineOffset;
1532 pValues[9].Name = "Adjust";
1533 pValues[9].Value <<= pTemp->nAdjust;
1534 pValues[10].Name = "Transliteration";
1535 pValues[10].Value <<= pTemp->sTransliteration;
1536 pValues[11].Name = "NatNum";
1537 pValues[11].Value <<= pTemp->nNatNum;
1538 aRet <<= aOutlineNumbering;
1539 return aRet;
1540}
1541
1542Type OutlineNumbering::getElementType( )
1543{
1545}
1546
1547sal_Bool OutlineNumbering::hasElements( )
1548{
1549 return m_nCount > 0;
1550}
1551
1552OUString SAL_CALL
1554{
1555 return "com.sun.star.i18n.LocaleDataImpl";
1556}
1557
1558sal_Bool SAL_CALL LocaleDataImpl::supportsService(const OUString& rServiceName)
1559{
1560 return cppu::supportsService(this, rServiceName);
1561}
1562
1563Sequence< OUString > SAL_CALL
1565{
1567 "com.sun.star.i18n.LocaleData",
1568 "com.sun.star.i18n.LocaleData2"
1569 };
1570 return aRet;
1571}
1572
1573// static
1574OUString LocaleDataImpl::getFirstLocaleServiceName( const css::lang::Locale & rLocale )
1575{
1576 if (rLocale.Language == I18NLANGTAG_QLT)
1577 return rLocale.Variant.replace( cHyphen, cUnder);
1578 else if (!rLocale.Country.isEmpty())
1579 return rLocale.Language + "_" + rLocale.Country;
1580 else
1581 return rLocale.Language;
1582}
1583
1584// static
1585::std::vector< OUString > LocaleDataImpl::getFallbackLocaleServiceNames( const css::lang::Locale & rLocale )
1586{
1587 ::std::vector< OUString > aVec;
1588 if (rLocale.Language == I18NLANGTAG_QLT)
1589 {
1590 aVec = LanguageTag( rLocale).getFallbackStrings( false);
1591 for (auto& rItem : aVec)
1592 {
1593 rItem = rItem.replace(cHyphen, cUnder);
1594 }
1595 }
1596 else if (!rLocale.Country.isEmpty())
1597 {
1598 aVec.push_back( rLocale.Language);
1599 }
1600 // else nothing, language-only was the first
1601 return aVec;
1602}
1603
1604}
1605
1606extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1608 css::uno::XComponentContext *,
1609 css::uno::Sequence<css::uno::Any> const &)
1610{
1611 return cppu::acquire(new i18npool::LocaleDataImpl());
1612}
1613
1614/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const PropertyValue * pValues
const char * pName
UBlockCode from
UBlockCode to
static css::lang::Locale convertToLocale(LanguageType nLangID, bool bResolveSystem=true)
::std::vector< OUString > getFallbackStrings(bool bIncludeFullBcp47) const
static css::lang::Locale getFallbackLocale(const css::lang::Locale &rLocale)
virtual OUString SAL_CALL getImplementationName() override
virtual css::i18n::LanguageCountryInfo SAL_CALL getLanguageCountryInfo(const css::lang::Locale &rLocale) override
virtual css::uno::Sequence< css::i18n::FormatElement > SAL_CALL getAllFormats(const css::lang::Locale &rLocale) override
Definition: localedata.cxx:823
css::uno::Sequence< css::uno::Reference< css::container::XIndexAccess > > getOutlineNumberingLevels(const css::lang::Locale &rLocale)
static css::uno::Sequence< css::i18n::CalendarItem > downcastCalendarItems(const css::uno::Sequence< css::i18n::CalendarItem2 > &rCi)
Definition: localedata.cxx:356
css::uno::Sequence< css::i18n::CalendarItem2 > & getCalendarItemByName(const OUString &name, const css::lang::Locale &rLocale, const css::uno::Sequence< css::i18n::Calendar2 > &calendarsSeq, sal_Int16 item)
Definition: localedata.cxx:627
bool hasPhonetic(const css::lang::Locale &rLocale)
virtual css::uno::Sequence< css::i18n::Currency2 > SAL_CALL getAllCurrencies2(const css::lang::Locale &rLocale) override
Definition: localedata.cxx:784
virtual css::uno::Sequence< OUString > SAL_CALL getDateAcceptancePatterns(const css::lang::Locale &rLocale) override
Definition: localedata.cxx:875
virtual css::uno::Sequence< OUString > SAL_CALL getReservedWord(const css::lang::Locale &rLocale) override
css::i18n::Calendar2 ref_cal
Definition: localedata.hxx:147
virtual ~LocaleDataImpl() override
Definition: localedata.cxx:381
virtual css::uno::Sequence< OUString > SAL_CALL getSearchOptions(const css::lang::Locale &rLocale) override
Definition: localedata.cxx:962
sal_Unicode ** getIndexArrayForAlgorithm(const css::lang::Locale &rLocale, std::u16string_view rAlgorithm)
css::uno::Sequence< OUString > getBreakIteratorRules(const css::lang::Locale &rLocale)
virtual css::uno::Sequence< css::i18n::Currency > SAL_CALL getAllCurrencies(const css::lang::Locale &rLocale) override
Definition: localedata.cxx:816
virtual css::i18n::LocaleDataItem SAL_CALL getLocaleItem(const css::lang::Locale &rLocale) override
Definition: localedata.cxx:387
virtual css::uno::Sequence< OUString > SAL_CALL getTransliterations(const css::lang::Locale &rLocale) override
css::uno::Sequence< OUString > getFollowPageWords(const css::lang::Locale &rLocale)
static ::std::vector< OUString > getFallbackLocaleServiceNames(const css::lang::Locale &rLocale)
Generates fallback strings suitable as parts of service names, excluding the one obtained via getFirs...
virtual css::uno::Sequence< css::i18n::Calendar > SAL_CALL getAllCalendars(const css::lang::Locale &rLocale) override
Definition: localedata.cxx:772
sal_Unicode ** getIndexArray(const css::lang::Locale &rLocale, sal_Int16 &indexCount)
Definition: localedata.cxx:982
virtual css::i18n::LocaleDataItem2 SAL_CALL getLocaleItem2(const css::lang::Locale &rLocale) override
Definition: localedata.cxx:425
css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > getContinuousNumberingLevels(const css::lang::Locale &rLocale)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
OUString getIndexModuleByAlgorithm(const css::lang::Locale &rLocale, std::u16string_view algorithm)
static OUString getFirstLocaleServiceName(const css::lang::Locale &rLocale)
Generates a <Language>_<Country> or <Variant> (if Language=="qlt") string suitable as part of service...
css::uno::Sequence< css::i18n::CalendarItem2 > getCalendarItems(sal_Unicode const *const *const allCalendars, sal_Int16 &rnOffset, const sal_Int16 nWhichItem, const sal_Int16 nCalendar, const css::lang::Locale &rLocale, const css::uno::Sequence< css::i18n::Calendar2 > &calendarsSeq)
Helper to obtain a sequence of days, months, gmonths or eras.
Definition: localedata.cxx:679
bool isPhonetic(const css::lang::Locale &rLocale, std::u16string_view algorithm)
virtual css::uno::Sequence< OUString > SAL_CALL getCollationOptions(const css::lang::Locale &rLocale) override
Definition: localedata.cxx:942
css::uno::Sequence< css::i18n::UnicodeScript > getUnicodeScripts(const css::lang::Locale &rLocale)
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual css::uno::Sequence< css::lang::Locale > SAL_CALL getAllInstalledLocaleNames() override
css::uno::Sequence< OUString > getIndexAlgorithm(const css::lang::Locale &rLocale)
Definition: localedata.cxx:992
virtual css::uno::Sequence< css::i18n::Implementation > SAL_CALL getCollatorImplementations(const css::lang::Locale &rLocale) override
Definition: localedata.cxx:919
OUString getHangingCharacters(const css::lang::Locale &rLocale)
OUString getCollatorRuleByAlgorithm(const css::lang::Locale &rLocale, std::u16string_view algorithm)
Definition: localedata.cxx:904
oslGenericFunction getFunctionSymbol(const css::lang::Locale &rLocale, const char *pFunction)
OUString getDefaultIndexAlgorithm(const css::lang::Locale &rLocale)
virtual css::i18n::ForbiddenCharacters SAL_CALL getForbiddenCharacters(const css::lang::Locale &rLocale) override
virtual css::uno::Sequence< css::i18n::Calendar2 > SAL_CALL getAllCalendars2(const css::lang::Locale &rLocale) override
Definition: localedata.cxx:726
OUString getIndexKeysByAlgorithm(const css::lang::Locale &rLocale, std::u16string_view algorithm)
static css::i18n::Calendar downcastCalendar(const css::i18n::Calendar2 &rC)
Definition: localedata.cxx:363
::std::optional< LocaleDataLookupTableItem > moCachedItem
Definition: localedata.hxx:146
#define SAL_DLLEXTENSION
float u
const char * name
sal_Int32 nIndex
constexpr OUStringLiteral I18NLANGTAG_QLT
sal_Int32 nLeftMargin
sal_Int32 nSymbolTextDistance
std::mutex maMutex
Definition: localedata.cxx:485
static const char * lcl_DATA_OTHERS
Definition: localedata.cxx:55
OUString sTransliteration
const char * pLib
Definition: localedata.cxx:59
const sal_Unicode cUnder
Definition: localedata.cxx:348
sal_Int32 nNatNum
const char * pLocale
Definition: localedata.cxx:58
OUString sSuffix
sal_Int16 nNumType
sal_Int32 nFirstLineOffset
#define REF_PMONTHS
Definition: localedata.cxx:623
sal_Unicode const ****(* MyFunc_Type3)(sal_Int16 &, sal_Int16 &, sal_Int16 &)
Definition: localedata.cxx:47
const struct @0 aLibTable[]
#define REF_MONTHS
Definition: localedata.cxx:621
#define REF_DAYS
Definition: localedata.cxx:620
OUString sPrefix
OUString sBulletFontName
const sal_Unicode cHyphen
Definition: localedata.cxx:349
#define REF_OFFSET_COUNT
Definition: localedata.cxx:625
#define COLLATOR_OFFSET_RULE
Definition: localedata.cxx:900
sal_Unicode cBulletChar
sal_Int16 nParentNumbering
std::unique_ptr< const OutlineNumberingLevel_Impl[]> m_pOutlineLevels
#define COLLATOR_ELEMENTS
Definition: localedata.cxx:901
static const char * lcl_DATA_ES
Definition: localedata.cxx:53
#define REF_GMONTHS
Definition: localedata.cxx:622
const sal_Int16 nbOfLocales
Definition: localedata.cxx:351
#define REF_ERAS
Definition: localedata.cxx:624
sal_Int16 nAdjust
static const char * lcl_DATA_EURO
Definition: localedata.cxx:54
::std::vector< LocaleDataLookupTableItem > maLookupTable
Definition: localedata.cxx:486
static const char * lcl_DATA_EN
Definition: localedata.cxx:52
#define COLLATOR_OFFSET_DEFAULT
Definition: localedata.cxx:899
sal_Unicode const ***(* MyFunc_Type2)(sal_Int16 &, sal_Int16 &)
Definition: localedata.cxx:46
sal_Unicode const *const *(* MyFunc_FormatCode)(sal_Int16 &, sal_Unicode const *&, sal_Unicode const *&)
Definition: localedata.cxx:48
sal_Int16 m_nCount
#define COLLATOR_OFFSET_ALGO
Definition: localedata.cxx:898
sal_Unicode **(* MyFunc_Type)(sal_Int16 &)
Definition: localedata.cxx:45
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_i18n_LocaleDataImpl_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_N_ELEMENTS(arr)
@ section
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
Type
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
int i
Constant values shared between i18npool and, for example, the number formatter.
static void thisModule()
Definition: xdictionary.cxx:41
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
module
sal_Int16 nAttributes
unsigned char sal_Bool
sal_uInt16 sal_Unicode