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