tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / i18npool / source / registerservices / registerservices.cxx
blobb3289c2d2a5300de28ae67778e014f42ea9428e3
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <config_locales.h>
22 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
24 #include <comphelper/processfactory.hxx>
25 #include <cppuhelper/factory.hxx>
26 #include <cppuhelper/weak.hxx>
28 #include <servicename.hxx>
30 #include <transliteration_body.hxx>
31 #include <transliteration_OneToOne.hxx>
32 #include <textToPronounce_zh.hxx>
33 #include <numtotext_cjk.hxx>
34 #include <numtochar.hxx>
35 #include <texttonum.hxx>
36 #include <chartonum.hxx>
38 #include <calendarImpl.hxx>
39 #include <calendar_gregorian.hxx>
40 #include <calendar_hijri.hxx>
41 #include <calendar_jewish.hxx>
43 #include <breakiterator_cjk.hxx>
45 #include <indexentrysupplier.hxx>
46 #include <indexentrysupplier_asian.hxx>
47 #include <indexentrysupplier_ja_phonetic.hxx>
48 #include <indexentrysupplier_default.hxx>
50 #include <chaptercollator.hxx>
51 #include <collator_unicode.hxx>
53 #include <inputsequencechecker_th.hxx>
54 #include <inputsequencechecker_hi.hxx>
56 #include <textconversion.hxx>
58 using namespace ::com::sun::star;
59 using namespace i18npool;
61 #define IMPL_CREATEINSTANCE( ImplName ) \
62 static uno::Reference< uno::XInterface > \
63 ImplName##_CreateInstance( \
64 SAL_UNUSED_PARAMETER const uno::Reference< \
65 lang::XMultiServiceFactory >& ) \
66 { \
67 return uno::Reference < \
68 uno::XInterface >( static_cast<cppu::OWeakObject*>( \
69 new ImplName) ); \
72 #define IMPL_TRANSLITERATION_ITEM( implName ) \
73 { TRLT_SERVICELNAME_L10N, \
74 TRLT_IMPLNAME_PREFIX #implName, \
75 &implName##_CreateInstance }
77 #define IMPL_UNO_CONSTRUCTOR( ImplName ) \
78 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * \
79 i18npool_##ImplName##_get_implementation( \
80 css::uno::XComponentContext *, \
81 css::uno::Sequence<css::uno::Any> const &) \
82 { \
83 return cppu::acquire(new ImplName()); \
86 #define IMPL_UNO_CONSTRUCTOR_CTX( ImplName ) \
87 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * \
88 i18npool_##ImplName##_get_implementation( \
89 css::uno::XComponentContext * context, \
90 css::uno::Sequence<css::uno::Any> const &) \
91 { \
92 return cppu::acquire(new ImplName(context)); \
96 // At least for iOS it doesn't hurt if we have lots of functions here
97 // generated by these lovely macros that get compiled, but then no
98 // references to them thanks to the WITH_LOCALE ifdefs for the
99 // aInstances table below. The -dead_strip linker option will take
100 // care of not linking these functions in. Presumably the same holds
101 // for Android, too, as we use -ffunction-sections and
102 // -Wl,--gc_sections. It's mainly for iOS and Android that the
103 // --with-locales option is intended anyway.
105 IMPL_CREATEINSTANCE( ignoreDiacritics_CTL )
106 IMPL_CREATEINSTANCE( ignoreKashida_CTL )
107 IMPL_CREATEINSTANCE( NumToCharIndic_ar )
108 IMPL_CREATEINSTANCE( NumToTextCircledNumber )
109 IMPL_CREATEINSTANCE( Transliteration_l2u )
110 IMPL_CREATEINSTANCE( Transliteration_sentencecase )
111 IMPL_CREATEINSTANCE( Transliteration_titlecase )
112 IMPL_CREATEINSTANCE( Transliteration_togglecase )
113 IMPL_CREATEINSTANCE( Transliteration_u2l )
114 IMPL_UNO_CONSTRUCTOR( Calendar_buddhist )
115 IMPL_UNO_CONSTRUCTOR( Calendar_dangi )
116 IMPL_UNO_CONSTRUCTOR( Calendar_gengou )
117 IMPL_UNO_CONSTRUCTOR( Calendar_gregorian )
118 IMPL_UNO_CONSTRUCTOR( Calendar_hanja )
119 IMPL_UNO_CONSTRUCTOR( Calendar_hanja_yoil )
120 IMPL_UNO_CONSTRUCTOR( Calendar_hijri )
121 IMPL_UNO_CONSTRUCTOR( Calendar_jewish )
122 IMPL_UNO_CONSTRUCTOR( Calendar_ROC )
123 IMPL_UNO_CONSTRUCTOR( CharToNumEastIndic_ar )
124 IMPL_UNO_CONSTRUCTOR( CharToNumIndic_ar )
125 IMPL_UNO_CONSTRUCTOR( Collator_Unicode )
126 IMPL_UNO_CONSTRUCTOR_CTX( CalendarImpl )
127 IMPL_UNO_CONSTRUCTOR_CTX( ChapterCollator )
128 IMPL_UNO_CONSTRUCTOR_CTX( IndexEntrySupplier )
129 IMPL_UNO_CONSTRUCTOR_CTX( IndexEntrySupplier_asian )
130 IMPL_UNO_CONSTRUCTOR_CTX( IndexEntrySupplier_Unicode )
131 IMPL_UNO_CONSTRUCTOR( NumToCharEastIndic_ar )
133 #if WITH_LOCALE_ALL || WITH_LOCALE_hi
134 IMPL_CREATEINSTANCE( NumToCharIndic_hi )
135 IMPL_UNO_CONSTRUCTOR( CharToNumIndic_hi )
136 IMPL_UNO_CONSTRUCTOR( InputSequenceChecker_hi )
137 #endif
139 #if WITH_LOCALE_ALL || WITH_LOCALE_ja
140 IMPL_CREATEINSTANCE( fullwidthToHalfwidth )
141 IMPL_CREATEINSTANCE( halfwidthToFullwidth )
142 IMPL_CREATEINSTANCE( hiraganaToKatakana )
143 IMPL_CREATEINSTANCE( ignoreBaFa_ja_JP )
144 IMPL_CREATEINSTANCE( ignoreHyuByu_ja_JP )
145 IMPL_CREATEINSTANCE( ignoreIandEfollowedByYa_ja_JP )
146 IMPL_CREATEINSTANCE( ignoreIterationMark_ja_JP )
147 IMPL_CREATEINSTANCE( ignoreKiKuFollowedBySa_ja_JP )
148 IMPL_CREATEINSTANCE( ignoreMiddleDot_ja_JP )
149 IMPL_CREATEINSTANCE( ignoreMinusSign_ja_JP )
150 IMPL_CREATEINSTANCE( ignoreProlongedSoundMark_ja_JP )
151 IMPL_CREATEINSTANCE( ignoreSeparator_ja_JP )
152 IMPL_CREATEINSTANCE( ignoreSeZe_ja_JP )
153 IMPL_CREATEINSTANCE( ignoreSize_ja_JP )
154 IMPL_CREATEINSTANCE( ignoreSpace_ja_JP )
155 IMPL_CREATEINSTANCE( ignoreTiJi_ja_JP )
156 IMPL_CREATEINSTANCE( ignoreTraditionalKana_ja_JP )
157 IMPL_CREATEINSTANCE( ignoreTraditionalKanji_ja_JP )
158 IMPL_CREATEINSTANCE( ignoreZiZu_ja_JP )
159 IMPL_CREATEINSTANCE( katakanaToHiragana )
160 IMPL_CREATEINSTANCE( largeToSmall_ja_JP )
161 IMPL_CREATEINSTANCE( NumToCharFullwidth )
162 IMPL_CREATEINSTANCE( NumToCharHalfwidth )
163 IMPL_CREATEINSTANCE( NumToCharKanjiShort_ja_JP )
164 IMPL_CREATEINSTANCE( NumToCharKanjiTraditional_ja_JP )
165 IMPL_CREATEINSTANCE( NumToTextFullwidth_ja_JP )
166 IMPL_CREATEINSTANCE( NumToTextKanjiLongModern_ja_JP )
167 IMPL_CREATEINSTANCE( NumToTextKanjiLongTraditional_ja_JP )
168 IMPL_CREATEINSTANCE( NumToTextKanjiShortModern_ja_JP )
169 IMPL_CREATEINSTANCE( NumToTextKanjiShortTraditional_ja_JP )
170 IMPL_CREATEINSTANCE( smallToLarge_ja_JP )
171 IMPL_CREATEINSTANCE( TextToNumKanjiLongModern_ja_JP )
172 IMPL_CREATEINSTANCE( TextToNumKanjiLongTraditional_ja_JP )
173 IMPL_UNO_CONSTRUCTOR( BreakIterator_ja )
174 IMPL_UNO_CONSTRUCTOR( CharToNumFullwidth )
175 IMPL_UNO_CONSTRUCTOR( CharToNumKanjiShort_ja_JP )
176 IMPL_UNO_CONSTRUCTOR( CharToNumKanjiTraditional_ja_JP )
177 IMPL_UNO_CONSTRUCTOR_CTX( IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_consonant )
178 IMPL_UNO_CONSTRUCTOR_CTX( IndexEntrySupplier_ja_phonetic_alphanumeric_first_by_syllable )
179 IMPL_UNO_CONSTRUCTOR_CTX( IndexEntrySupplier_ja_phonetic_alphanumeric_last_by_consonant )
180 IMPL_UNO_CONSTRUCTOR_CTX( IndexEntrySupplier_ja_phonetic_alphanumeric_last_by_syllable )
181 IMPL_UNO_CONSTRUCTOR( FULLWIDTH_HALFWIDTH_LIKE_ASC )
182 IMPL_UNO_CONSTRUCTOR( FULLWIDTHKATAKANA_HALFWIDTHKATAKANA )
183 IMPL_UNO_CONSTRUCTOR( HALFWIDTH_FULLWIDTH_LIKE_JIS )
184 IMPL_UNO_CONSTRUCTOR( HALFWIDTHKATAKANA_FULLWIDTHKATAKANA )
185 IMPL_UNO_CONSTRUCTOR( NumToTextAIUFullWidth_ja_JP )
186 IMPL_UNO_CONSTRUCTOR( NumToTextAIUHalfWidth_ja_JP )
187 IMPL_UNO_CONSTRUCTOR( NumToTextIROHAFullWidth_ja_JP )
188 IMPL_UNO_CONSTRUCTOR( NumToTextIROHAHalfWidth_ja_JP )
189 #endif
191 #if WITH_LOCALE_ALL || WITH_LOCALE_ko
192 IMPL_CREATEINSTANCE( NumToCharHangul_ko )
193 IMPL_CREATEINSTANCE( NumToCharLower_ko )
194 IMPL_CREATEINSTANCE( NumToCharUpper_ko )
195 IMPL_CREATEINSTANCE( NumToTextFullwidth_ko )
196 IMPL_CREATEINSTANCE( TextToNumFormalHangul_ko )
197 IMPL_CREATEINSTANCE( TextToNumFormalLower_ko )
198 IMPL_CREATEINSTANCE( TextToNumFormalUpper_ko )
199 IMPL_CREATEINSTANCE( TextToNumInformalHangul_ko )
200 IMPL_CREATEINSTANCE( TextToNumInformalLower_ko )
201 IMPL_CREATEINSTANCE( TextToNumInformalUpper_ko )
202 IMPL_UNO_CONSTRUCTOR( BreakIterator_ko )
203 IMPL_UNO_CONSTRUCTOR( CharToNumHangul_ko )
204 IMPL_UNO_CONSTRUCTOR( CharToNumLower_ko )
205 IMPL_UNO_CONSTRUCTOR( CharToNumUpper_ko )
206 IMPL_UNO_CONSTRUCTOR_CTX( TextConversion_ko )
207 IMPL_UNO_CONSTRUCTOR( NumToTextFormalHangul_ko )
208 IMPL_UNO_CONSTRUCTOR( NumToTextFormalLower_ko )
209 IMPL_UNO_CONSTRUCTOR( NumToTextFormalUpper_ko )
210 IMPL_UNO_CONSTRUCTOR( NumToTextHangulCircledJamo_ko )
211 IMPL_UNO_CONSTRUCTOR( NumToTextHangulCircledSyllable_ko )
212 IMPL_UNO_CONSTRUCTOR( NumToTextHangulJamo_ko )
213 IMPL_UNO_CONSTRUCTOR( NumToTextHangulSyllable_ko )
214 IMPL_UNO_CONSTRUCTOR( NumToTextInformalHangul_ko )
215 IMPL_UNO_CONSTRUCTOR( NumToTextInformalLower_ko )
216 IMPL_UNO_CONSTRUCTOR( NumToTextInformalUpper_ko )
217 #endif
219 #if WITH_LOCALE_ALL || WITH_LOCALE_th
220 IMPL_CREATEINSTANCE( NumToChar_th )
221 IMPL_UNO_CONSTRUCTOR( CharToNum_th )
222 IMPL_UNO_CONSTRUCTOR( InputSequenceChecker_th )
223 #endif
225 #if WITH_LOCALE_ALL || WITH_LOCALE_zh
226 IMPL_CREATEINSTANCE( NumToCharLower_zh_CN )
227 IMPL_CREATEINSTANCE( NumToCharLower_zh_TW )
228 IMPL_CREATEINSTANCE( NumToCharUpper_zh_CN )
229 IMPL_CREATEINSTANCE( NumToCharUpper_zh_TW )
230 IMPL_CREATEINSTANCE( NumToTextDate_zh )
231 IMPL_CREATEINSTANCE( NumToTextDiZi_zh )
232 IMPL_CREATEINSTANCE( NumToTextTianGan_zh )
233 IMPL_CREATEINSTANCE( TextToChuyin_zh_TW )
234 IMPL_CREATEINSTANCE( TextToNumLower_zh_CN )
235 IMPL_CREATEINSTANCE( TextToNumLower_zh_TW )
236 IMPL_CREATEINSTANCE( TextToNumUpper_zh_CN )
237 IMPL_CREATEINSTANCE( TextToNumUpper_zh_TW )
238 IMPL_CREATEINSTANCE( TextToPinyin_zh_CN )
239 IMPL_UNO_CONSTRUCTOR( BreakIterator_zh )
240 IMPL_UNO_CONSTRUCTOR( BreakIterator_zh_TW )
241 IMPL_UNO_CONSTRUCTOR( CharToNumLower_zh_CN )
242 IMPL_UNO_CONSTRUCTOR( CharToNumLower_zh_TW )
243 IMPL_UNO_CONSTRUCTOR( CharToNumUpper_zh_CN )
244 IMPL_UNO_CONSTRUCTOR( CharToNumUpper_zh_TW )
245 IMPL_UNO_CONSTRUCTOR_CTX( TextConversion_zh )
246 IMPL_UNO_CONSTRUCTOR( NumToTextFullwidth_zh_CN )
247 IMPL_UNO_CONSTRUCTOR( NumToTextFullwidth_zh_TW )
248 IMPL_UNO_CONSTRUCTOR( NumToTextLower_zh_CN )
249 IMPL_UNO_CONSTRUCTOR( NumToTextLower_zh_TW )
250 IMPL_UNO_CONSTRUCTOR( NumToTextUpper_zh_CN )
251 IMPL_UNO_CONSTRUCTOR( NumToTextUpper_zh_TW )
252 #endif
254 namespace {
256 typedef uno::Reference< uno::XInterface > (*FN_CreateInstance)(
257 const uno::Reference< lang::XMultiServiceFactory >& );
259 struct InstancesArray {
260 const char* pServiceNm;
261 const char* pImplementationNm;
262 FN_CreateInstance pFn;
267 const InstancesArray aInstances[] = {
268 { TRLT_SERVICELNAME_L10N,
269 TRLT_IMPLNAME_PREFIX "UPPERCASE_LOWERCASE",
270 &Transliteration_u2l_CreateInstance },
271 { TRLT_SERVICELNAME_L10N,
272 TRLT_IMPLNAME_PREFIX "LOWERCASE_UPPERCASE",
273 &Transliteration_l2u_CreateInstance },
274 { TRLT_SERVICELNAME_L10N,
275 TRLT_IMPLNAME_PREFIX "SENTENCE_CASE",
276 &Transliteration_sentencecase_CreateInstance },
277 { TRLT_SERVICELNAME_L10N,
278 TRLT_IMPLNAME_PREFIX "TITLE_CASE",
279 &Transliteration_titlecase_CreateInstance },
280 { TRLT_SERVICELNAME_L10N,
281 TRLT_IMPLNAME_PREFIX "TOGGLE_CASE",
282 &Transliteration_togglecase_CreateInstance },
284 IMPL_TRANSLITERATION_ITEM( NumToCharIndic_ar ),
285 IMPL_TRANSLITERATION_ITEM( ignoreDiacritics_CTL ),
286 IMPL_TRANSLITERATION_ITEM( ignoreKashida_CTL ),
287 IMPL_TRANSLITERATION_ITEM( NumToTextCircledNumber ),
289 #if WITH_LOCALE_ALL || WITH_LOCALE_hi
290 IMPL_TRANSLITERATION_ITEM( NumToCharIndic_hi ),
291 #endif
293 #if WITH_LOCALE_ALL || WITH_LOCALE_ja
294 { TRLT_SERVICELNAME_L10N,
295 TRLT_IMPLNAME_PREFIX "HIRAGANA_KATAKANA",
296 &hiraganaToKatakana_CreateInstance },
297 { TRLT_SERVICELNAME_L10N,
298 TRLT_IMPLNAME_PREFIX "KATAKANA_HIRAGANA",
299 &katakanaToHiragana_CreateInstance },
300 { TRLT_SERVICELNAME_L10N,
301 TRLT_IMPLNAME_PREFIX "FULLWIDTH_HALFWIDTH",
302 &fullwidthToHalfwidth_CreateInstance },
303 { TRLT_SERVICELNAME_L10N,
304 TRLT_IMPLNAME_PREFIX "HALFWIDTH_FULLWIDTH",
305 &halfwidthToFullwidth_CreateInstance },
307 IMPL_TRANSLITERATION_ITEM( ignoreBaFa_ja_JP ),
308 IMPL_TRANSLITERATION_ITEM( ignoreHyuByu_ja_JP ),
309 IMPL_TRANSLITERATION_ITEM( ignoreIandEfollowedByYa_ja_JP ),
310 IMPL_TRANSLITERATION_ITEM( ignoreIterationMark_ja_JP ),
311 IMPL_TRANSLITERATION_ITEM( ignoreKiKuFollowedBySa_ja_JP ),
312 IMPL_TRANSLITERATION_ITEM( ignoreMiddleDot_ja_JP ),
313 IMPL_TRANSLITERATION_ITEM( ignoreMinusSign_ja_JP ),
314 IMPL_TRANSLITERATION_ITEM( ignoreProlongedSoundMark_ja_JP ),
315 IMPL_TRANSLITERATION_ITEM( ignoreSeparator_ja_JP ),
316 IMPL_TRANSLITERATION_ITEM( ignoreSeZe_ja_JP ),
317 IMPL_TRANSLITERATION_ITEM( ignoreSize_ja_JP ),
318 IMPL_TRANSLITERATION_ITEM( ignoreSpace_ja_JP ),
319 IMPL_TRANSLITERATION_ITEM( ignoreTiJi_ja_JP ),
320 IMPL_TRANSLITERATION_ITEM( ignoreTraditionalKana_ja_JP ),
321 IMPL_TRANSLITERATION_ITEM( ignoreTraditionalKanji_ja_JP ),
322 IMPL_TRANSLITERATION_ITEM( ignoreZiZu_ja_JP ),
323 IMPL_TRANSLITERATION_ITEM( largeToSmall_ja_JP ),
324 IMPL_TRANSLITERATION_ITEM( NumToCharFullwidth ),
325 IMPL_TRANSLITERATION_ITEM( NumToCharHalfwidth ),
326 IMPL_TRANSLITERATION_ITEM( NumToCharKanjiShort_ja_JP ),
327 IMPL_TRANSLITERATION_ITEM( NumToCharKanjiTraditional_ja_JP ),
328 IMPL_TRANSLITERATION_ITEM( NumToTextFullwidth_ja_JP ),
329 IMPL_TRANSLITERATION_ITEM( NumToTextKanjiLongModern_ja_JP ),
330 IMPL_TRANSLITERATION_ITEM( NumToTextKanjiLongTraditional_ja_JP ),
331 IMPL_TRANSLITERATION_ITEM( NumToTextKanjiShortModern_ja_JP ),
332 IMPL_TRANSLITERATION_ITEM( NumToTextKanjiShortTraditional_ja_JP ),
333 IMPL_TRANSLITERATION_ITEM( smallToLarge_ja_JP ),
334 IMPL_TRANSLITERATION_ITEM( TextToNumKanjiLongModern_ja_JP ),
335 IMPL_TRANSLITERATION_ITEM( TextToNumKanjiLongTraditional_ja_JP ),
336 #endif
338 #if WITH_LOCALE_ALL || WITH_LOCALE_ko
339 IMPL_TRANSLITERATION_ITEM( NumToCharHangul_ko ),
340 IMPL_TRANSLITERATION_ITEM( NumToCharLower_ko ),
341 IMPL_TRANSLITERATION_ITEM( NumToCharUpper_ko ),
342 IMPL_TRANSLITERATION_ITEM( NumToTextFullwidth_ko ),
343 IMPL_TRANSLITERATION_ITEM( TextToNumFormalHangul_ko ),
344 IMPL_TRANSLITERATION_ITEM( TextToNumFormalLower_ko ),
345 IMPL_TRANSLITERATION_ITEM( TextToNumFormalUpper_ko ),
346 IMPL_TRANSLITERATION_ITEM( TextToNumInformalHangul_ko ),
347 IMPL_TRANSLITERATION_ITEM( TextToNumInformalLower_ko ),
348 IMPL_TRANSLITERATION_ITEM( TextToNumInformalUpper_ko ),
349 #endif
351 #if WITH_LOCALE_ALL || WITH_LOCALE_th
352 IMPL_TRANSLITERATION_ITEM( NumToChar_th ),
353 #endif
355 #if WITH_LOCALE_ALL || WITH_LOCALE_zh
356 IMPL_TRANSLITERATION_ITEM( NumToCharLower_zh_CN ),
357 IMPL_TRANSLITERATION_ITEM( NumToCharLower_zh_TW ),
358 IMPL_TRANSLITERATION_ITEM( NumToCharUpper_zh_CN ),
359 IMPL_TRANSLITERATION_ITEM( NumToCharUpper_zh_TW ),
360 IMPL_TRANSLITERATION_ITEM( NumToTextDate_zh ),
361 IMPL_TRANSLITERATION_ITEM( NumToTextDiZi_zh ),
362 IMPL_TRANSLITERATION_ITEM( NumToTextTianGan_zh ),
363 IMPL_TRANSLITERATION_ITEM( TextToChuyin_zh_TW ),
364 IMPL_TRANSLITERATION_ITEM( TextToNumLower_zh_CN ),
365 IMPL_TRANSLITERATION_ITEM( TextToNumLower_zh_TW ),
366 IMPL_TRANSLITERATION_ITEM( TextToNumUpper_zh_CN ),
367 IMPL_TRANSLITERATION_ITEM( TextToNumUpper_zh_TW ),
368 IMPL_TRANSLITERATION_ITEM( TextToPinyin_zh_CN ),
369 #endif
371 { nullptr, nullptr, nullptr }
375 extern "C"
378 SAL_DLLPUBLIC_EXPORT void* i18npool_component_getFactory( const char* sImplementationName, void* _pServiceManager, SAL_UNUSED_PARAMETER void* /*_pRegistryKey*/ )
380 void* pRet = nullptr;
382 lang::XMultiServiceFactory* pServiceManager =
383 static_cast< lang::XMultiServiceFactory* >( _pServiceManager );
384 uno::Reference< lang::XSingleServiceFactory > xFactory;
386 for( const InstancesArray* pArr = aInstances; pArr->pServiceNm; ++pArr )
388 if( 0 == rtl_str_compare( sImplementationName, pArr->pImplementationNm ) )
390 uno::Sequence< OUString > aServiceNames {
391 OUString::createFromAscii( pArr->pServiceNm ) };
392 xFactory = ::cppu::createSingleFactory(
393 pServiceManager,
394 OUString::createFromAscii( pArr->pImplementationNm ),
395 *pArr->pFn, aServiceNames );
396 break;
400 if ( xFactory.is() )
402 xFactory->acquire();
403 pRet = xFactory.get();
406 return pRet;
409 } // "C"
411 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */