Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #include <ThemeTable.hxx>
21 : #include <ooxml/resourceids.hxx>
22 : #include "dmapperLoggers.hxx"
23 :
24 : #ifdef DEBUG_DOMAINMAPPER
25 : #include <resourcemodel/QNameToString.hxx>
26 : #endif
27 :
28 : namespace writerfilter {
29 : namespace dmapper
30 : {
31 :
32 809 : struct ThemeTable_Impl
33 : {
34 809 : ThemeTable_Impl() :
35 : m_currentThemeFontId(0),
36 : m_currentFontThemeEntry(),
37 809 : m_supplementalFontId(0)
38 809 : {}
39 : std::map<sal_uInt32, std::map<sal_uInt32, OUString> > m_themeFontMap;
40 : sal_uInt32 m_currentThemeFontId;
41 : std::map<sal_uInt32, OUString> m_currentFontThemeEntry;
42 : OUString m_supplementalFontName;
43 : sal_uInt32 m_supplementalFontId;
44 : OUString m_themeFontLangEastAsia;
45 : OUString m_themeFontLangBidi;
46 : };
47 :
48 809 : ThemeTable::ThemeTable()
49 : : LoggedProperties(dmapper_logger, "ThemeTable")
50 : , LoggedTable(dmapper_logger, "ThemeTable")
51 809 : , m_pImpl( new ThemeTable_Impl )
52 : {
53 :
54 809 : }
55 :
56 2427 : ThemeTable::~ThemeTable()
57 : {
58 809 : delete m_pImpl;
59 1618 : }
60 :
61 101512 : void ThemeTable::lcl_attribute(Id Name, Value & val)
62 : {
63 : #ifdef DEBUG_DOMAINMAPPER
64 : dmapper_logger->startElement("ThemeTable.attribute");
65 : dmapper_logger->attribute("name", (*QNameToString::Instance())(Name));
66 : dmapper_logger->attribute("value", val.toString());
67 : #endif
68 101512 : OUString sValue = val.getString();
69 101512 : switch(Name)
70 : {
71 : case NS_ooxml::LN_CT_TextFont_typeface:
72 4848 : if (!sValue.isEmpty())
73 1616 : m_pImpl->m_currentFontThemeEntry[m_pImpl->m_currentThemeFontId] = sValue;
74 4848 : break;
75 : case NS_ooxml::LN_CT_SupplementalFont_script:
76 47826 : if (!sValue.isEmpty())
77 : {
78 47826 : if (sValue == m_pImpl->m_themeFontLangBidi)
79 502 : m_pImpl->m_supplementalFontId = NS_ooxml::LN_CT_FontCollection_cs;
80 47324 : else if (sValue == m_pImpl->m_themeFontLangEastAsia)
81 346 : m_pImpl->m_supplementalFontId = NS_ooxml::LN_CT_FontCollection_ea;
82 : }
83 47826 : break;
84 : case NS_ooxml::LN_CT_SupplementalFont_typeface:
85 47826 : if (!sValue.isEmpty())
86 47826 : m_pImpl->m_supplementalFontName = sValue;
87 47826 : break;
88 : default:
89 : {
90 : #ifdef DEBUG_DOMAINMAPPER
91 : dmapper_logger->element("unhandled");
92 : #endif
93 : }
94 : }
95 101512 : if(m_pImpl->m_supplementalFontId && m_pImpl->m_supplementalFontName.getLength() > 0)
96 : {
97 848 : m_pImpl->m_currentFontThemeEntry[m_pImpl->m_supplementalFontId] = m_pImpl->m_supplementalFontName;
98 848 : m_pImpl->m_supplementalFontName = "";
99 848 : m_pImpl->m_supplementalFontId = 0;
100 101512 : }
101 : #ifdef DEBUG_DOMAINMAPPER
102 : dmapper_logger->endElement();
103 : #endif
104 101512 : }
105 :
106 56714 : void ThemeTable::lcl_sprm(Sprm& rSprm)
107 : {
108 : #ifdef DEBUG_DOMAINMAPPER
109 : dmapper_logger->startElement("ThemeTable.sprm");
110 : dmapper_logger->chars(rSprm.toString());
111 : #endif
112 :
113 56714 : sal_uInt32 nSprmId = rSprm.getId();
114 :
115 56714 : switch(nSprmId)
116 : {
117 : case NS_ooxml::LN_CT_BaseStyles_fontScheme:
118 : {
119 808 : writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
120 808 : if( pProperties.get())
121 808 : pProperties->resolve(*this);
122 : }
123 808 : break;
124 : case NS_ooxml::LN_CT_FontScheme_majorFont:
125 : case NS_ooxml::LN_CT_FontScheme_minorFont:
126 : {
127 1616 : writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
128 1616 : m_pImpl->m_currentFontThemeEntry = std::map<sal_uInt32, OUString>();
129 1616 : if( pProperties.get())
130 1616 : pProperties->resolve(*this);
131 1616 : m_pImpl->m_themeFontMap[nSprmId] = m_pImpl->m_currentFontThemeEntry;
132 : }
133 1616 : break;
134 : case NS_ooxml::LN_CT_FontCollection_latin:
135 : case NS_ooxml::LN_CT_FontCollection_ea:
136 : case NS_ooxml::LN_CT_FontCollection_cs:
137 : {
138 4848 : m_pImpl->m_currentThemeFontId = nSprmId;
139 4848 : writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
140 4848 : if( pProperties.get())
141 4848 : pProperties->resolve(*this);
142 : }
143 4848 : break;
144 : case NS_ooxml::LN_CT_FontCollection_font:
145 : {
146 47826 : writerfilter::Reference<Properties>::Pointer_t pProperties = rSprm.getProps();
147 47826 : if (pProperties.get())
148 47826 : pProperties->resolve(*this);
149 : }
150 47826 : break;
151 : default:
152 : {
153 : #ifdef DEBUG_DOMAINMAPPER
154 : dmapper_logger->element("unhandled");
155 : #endif
156 : }
157 : }
158 : #ifdef DEBUG_DOMAINMAPPER
159 : dmapper_logger->endElement();
160 : #endif
161 56714 : }
162 :
163 808 : void ThemeTable::lcl_entry(int /*pos*/, writerfilter::Reference<Properties>::Pointer_t ref)
164 : {
165 : #ifdef DEBUG_DOMAINMAPPER
166 : dmapper_logger->startElement("ThemeTable.entry");
167 : #endif
168 :
169 808 : ref->resolve(*this);
170 :
171 : #ifdef DEBUG_DOMAINMAPPER
172 : dmapper_logger->endElement();
173 : #endif
174 808 : }
175 :
176 22276 : OUString ThemeTable::getStringForTheme(const Id id)
177 : {
178 22276 : std::map<sal_uInt32, OUString> tmpThemeFontMap;
179 22276 : switch (id)
180 : {
181 : case NS_ooxml::LN_Value_ST_Theme_majorEastAsia:
182 1992 : return OUString("majorEastAsia");
183 : case NS_ooxml::LN_Value_ST_Theme_majorBidi:
184 2962 : return OUString("majorBidi");
185 : case NS_ooxml::LN_Value_ST_Theme_majorAscii:
186 0 : return OUString("majorAscii");
187 : case NS_ooxml::LN_Value_ST_Theme_majorHAnsi:
188 4008 : return OUString("majorHAnsi");
189 : case NS_ooxml::LN_Value_ST_Theme_minorEastAsia:
190 2332 : return OUString("minorEastAsia");
191 : case NS_ooxml::LN_Value_ST_Theme_minorBidi:
192 2724 : return OUString("minorBidi");
193 : case NS_ooxml::LN_Value_ST_Theme_minorAscii:
194 0 : return OUString("minorAscii");
195 : case NS_ooxml::LN_Value_ST_Theme_minorHAnsi:
196 8258 : return OUString("minorHAnsi");
197 : }
198 0 : return OUString();
199 : }
200 8424 : const OUString ThemeTable::getFontNameForTheme(const Id id) const
201 : {
202 8424 : std::map<sal_uInt32, OUString> tmpThemeFontMap;
203 8424 : switch (id)
204 : {
205 : case NS_ooxml::LN_Value_ST_Theme_majorEastAsia:
206 : case NS_ooxml::LN_Value_ST_Theme_majorBidi:
207 : case NS_ooxml::LN_Value_ST_Theme_majorAscii:
208 : case NS_ooxml::LN_Value_ST_Theme_majorHAnsi:
209 3307 : tmpThemeFontMap = m_pImpl->m_themeFontMap[NS_ooxml::LN_CT_FontScheme_majorFont];
210 3307 : break;
211 : case NS_ooxml::LN_Value_ST_Theme_minorEastAsia:
212 : case NS_ooxml::LN_Value_ST_Theme_minorBidi:
213 : case NS_ooxml::LN_Value_ST_Theme_minorAscii:
214 : case NS_ooxml::LN_Value_ST_Theme_minorHAnsi:
215 5117 : tmpThemeFontMap = m_pImpl->m_themeFontMap[NS_ooxml::LN_CT_FontScheme_minorFont];
216 5117 : break;
217 : default:
218 0 : return OUString();
219 : }
220 :
221 8424 : switch (id)
222 : {
223 : case NS_ooxml::LN_Value_ST_Theme_majorAscii:
224 : case NS_ooxml::LN_Value_ST_Theme_majorHAnsi:
225 : case NS_ooxml::LN_Value_ST_Theme_minorAscii:
226 : case NS_ooxml::LN_Value_ST_Theme_minorHAnsi:
227 : {
228 3591 : std::map<sal_uInt32, OUString>::const_iterator Iter = tmpThemeFontMap.find(NS_ooxml::LN_CT_FontCollection_latin);
229 3591 : if (Iter != tmpThemeFontMap.end())
230 3589 : return (Iter)->second;
231 2 : return OUString();
232 : }
233 : case NS_ooxml::LN_Value_ST_Theme_majorBidi:
234 : case NS_ooxml::LN_Value_ST_Theme_minorBidi:
235 : {
236 2675 : std::map<sal_uInt32, OUString>::const_iterator Iter = tmpThemeFontMap.find(NS_ooxml::LN_CT_FontCollection_cs);
237 2675 : if (Iter != tmpThemeFontMap.end())
238 1383 : return (Iter)->second;
239 1292 : return OUString();
240 : }
241 : case NS_ooxml::LN_Value_ST_Theme_majorEastAsia:
242 : case NS_ooxml::LN_Value_ST_Theme_minorEastAsia:
243 : {
244 2158 : std::map<sal_uInt32, OUString>::const_iterator Iter = tmpThemeFontMap.find(NS_ooxml::LN_CT_FontCollection_ea);
245 2158 : if (Iter != tmpThemeFontMap.end())
246 981 : return (Iter)->second;
247 1177 : return OUString();
248 : }
249 : default:
250 0 : return OUString();
251 8424 : }
252 : }
253 :
254 808 : void ThemeTable::setThemeFontLangProperties(uno::Sequence<beans::PropertyValue> aPropSeq)
255 : {
256 3232 : for (sal_Int32 i = 0 ; i < aPropSeq.getLength() ; i ++)
257 : {
258 2424 : OUString sLocaleName;
259 2424 : aPropSeq.getConstArray()[i].Value >>= sLocaleName;
260 2424 : if (aPropSeq.getConstArray()[i].Name == "eastAsia")
261 421 : m_pImpl->m_themeFontLangEastAsia = fromLocaleToScriptTag(sLocaleName);
262 2424 : if (aPropSeq.getConstArray()[i].Name == "bidi")
263 464 : m_pImpl->m_themeFontLangBidi = fromLocaleToScriptTag(sLocaleName);
264 :
265 2424 : }
266 808 : }
267 :
268 885 : OUString ThemeTable::fromLocaleToScriptTag(const OUString& sLocale)
269 : {
270 885 : return fromLCIDToScriptTag(LanguageTag::convertToLanguageType(sLocale));
271 : }
272 :
273 885 : OUString ThemeTable::fromLCIDToScriptTag(LanguageType lang)
274 : {
275 : // conversion list from:
276 : // http://blogs.msdn.com/b/officeinteroperability/archive/2013/04/22/office-open-xml-themes-schemes-and-fonts.aspx
277 885 : switch (lang)
278 : {
279 : case 0x429 : // lidFarsi
280 : case 0x401 : // lidArabic
281 : case 0x801 : // lidIraq
282 : case 0xc01 : // lidEgyptian
283 : case 0x1001 : // lidLibya
284 : case 0x1401 : // lidAlgerian
285 : case 0x1801 : // lidMorocco
286 : case 0x1c01 : // lidTunisia
287 : case 0x2001 : // lidOman
288 : case 0x2401 : // lidYemen
289 : case 0x2801 : // lidSyria
290 : case 0x2c01 : // lidJordan
291 : case 0x3001 : // lidLebanon
292 : case 0x3401 : // lidKuwait
293 : case 0x3801 : // lidUAE
294 : case 0x3c01 : // lidBahrain
295 : case 0x4001 : // lidQatar
296 : case 0x420 : // lidUrdu
297 : case 0x846 : // lidPunjabiPakistan
298 : case 0x859 : // lidSindhiPakistan
299 : case 0x45f : // lidTamazight
300 : case 0x460 : // lidKashmiri
301 : case 0x463 : // lidPashto
302 : case 0x48c : // lidDari
303 13 : return OUString("Arab");
304 : case 0x42b : // lidArmenian
305 0 : return OUString("Armn");
306 : case 0x445 : // lidBengali
307 : case 0x845 : // lidBengaliBangladesh
308 : case 0x44d : // lidAssamese
309 : case 0x458 : // lidManipuri
310 0 : return OUString("Beng");
311 : case 0x45d : // lidInuktitut
312 0 : return OUString("Cans");
313 : case 0x45c : // lidCherokee
314 0 : return OUString("Cher");
315 : case 0x419 : // lidRussian
316 : case 0x402 : // lidBulgarian
317 : case 0x281a : // lidSerbianCyrillic
318 : case 0x422 : // lidUkranian
319 : case 0x819 : // lidRussianMoldavia
320 : case 0xc1a : // lidSerbianCyrillicSerbMont
321 : case 0x1c1a : // lidSerbianBosniaHerzegovinaCyrillic
322 : case 0x201a : // lidBosnianBosniaHerzegovinaCyrillic
323 : case 0x301a : // lidSerbianMontenegroCyrillic
324 : case 0x423 : // lidByelorussian
325 : case 0x428 : // lidTajik
326 : case 0x82c : // lidAzeriCyrillic
327 : case 0x42f : // lidMacedonian
328 : case 0x43f : // lidKazakh
329 : case 0x440 : // lidKyrgyz
330 : case 0x843 : // lidUzbekCyrillic
331 : case 0x444 : // lidTatar
332 : case 0x450 : // lidMongolian
333 : case 0x46d : // lidBashkir
334 : case 0x485 : // lidSakha
335 0 : return OUString("Cyrl");
336 : case 0x439 : // lidHindi
337 : case 0x44e : // lidMarathi
338 : case 0x44f : // lidSanskrit
339 : case 0x457 : // lidKonkani
340 : case 0x459 : // lidSindhi
341 : case 0x860 : // lidKashmiriIndia
342 : case 0x461 : // lidNepali
343 : case 0x861 : // lidNepaliIndia
344 0 : return OUString("Deva");
345 : case 0x45e : // lidAmharic
346 : case 0x473 : // lidTigrignaEthiopic
347 : case 0x873 : // lidTigrignaEritrea
348 0 : return OUString("Ethi");
349 : case 0x437 : // lidGeorgian
350 0 : return OUString("Geor");
351 : case 0x408 : // lidGreek
352 0 : return OUString("Grek");
353 : case 0x447 : // lidGujarati
354 0 : return OUString("Gujr");
355 : case 0x446 : // lidPunjabi
356 0 : return OUString("Guru");
357 : case 0x412 : // lidKoreanExtWansung
358 0 : return OUString("Hang");
359 : case 0x804 : // lidChineseSimp
360 : case 0x1004 : // lidSingapore
361 63 : return OUString("Hans");
362 : case 0x404 : // lidChineseTrad
363 : case 0xc04 : // lidHongkong
364 : case 0x1404 : // lidMacau
365 0 : return OUString("Hant");
366 : case 0x40d : // lidHebrew
367 : case 0x43d : // lidYiddish
368 222 : return OUString("Hebr");
369 : case 0x411 : // lidJapanese
370 111 : return OUString("Jpan");
371 : case 0x453 : // lidKhmer
372 3 : return OUString("Khmr");
373 : case 0x44b : // lidKannada
374 0 : return OUString("Knda");
375 : case 0x454 : // lidLao
376 0 : return OUString("Laoo");
377 : case 0x409 : // lidAmerican
378 : case 0xc09 : // lidAustralian
379 : case 0x809 : // lidBritish
380 : case 0x1009 : // lidEnglishCanadian
381 : case 0x403 : // lidCatalan
382 : case 0x406 : // lidDanish
383 : case 0x413 : // lidDutch
384 : case 0x813 : // lidDutchBelgian
385 : case 0x479 : // lidPapiamentu
386 : case 0x40b : // lidFinnish
387 : case 0x40c : // lidFrench
388 : case 0xc0c : // lidFrenchCanadian
389 : case 0x407 : // lidGerman
390 : case 0x807 : // lidSwissGerman
391 : case 0xc07 : // lidAustrianGerman
392 : case 0x1007 : // lidGermanLuxembourg
393 : case 0x1407 : // lidGermanLiechtenstein
394 : case 0x410 : // lidItalian
395 : case 0x414 : // lidNorskBokmal
396 : case 0x814 : // lidNorskNynorsk
397 : case 0x416 : // lidPortBrazil
398 : case 0x816 : // lidPortIberian
399 : case 0x40a : // lidSpanish
400 : case 0x41d : // lidSwedish
401 : case 0x405 : // lidCzech
402 : case 0x40e : // lidHungarian
403 : case 0x415 : // lidPolish
404 : case 0x41f : // lidTurkish
405 : case 0x42d : // lidBasque
406 : case 0x424 : // lidSlovenian
407 : case 0x426 : // lidLatvian
408 : case 0x427 : // lidLithuanian
409 : case 0x418 : // lidRomanian
410 : case 0x818 : // lidRomanianMoldavia
411 : case 0x241a : // lidSerbianLatin
412 : case 0x41a : // lidCroatian, lidCroat
413 : case 0x491 : // lidGaelicScots
414 : case 0x83c : // lidGaelicIrish
415 : case 0x430 : // lidSutu
416 : case 0x431 : // lidTsonga
417 : case 0x432 : // lidTswana
418 : case 0x433 : // lidVenda
419 : case 0x434 : // lidXhosa
420 : case 0x435 : // lidZulu
421 : case 0x436 : // lidAfrikaans
422 : case 0x425 : // lidEstonian
423 : case 0x456 : // lidGalician
424 : case 0x41b : // lidSlovak
425 : case 0x1409 : // lidEnglishNewZealand
426 : case 0x1809 : // lidEnglishIreland
427 : case 0x1c09 : // lidEnglishSouthAfrica
428 : case 0x2009 : // lidEnglishJamaica
429 : case 0x2409 : // lidEnglishCaribbean
430 : case 0x2809 : // lidEnglishBelize
431 : case 0x2c09 : // lidEnglishTrinidad
432 : case 0x3009 : // lidEnglishZimbabwe
433 : case 0x3409 : // lidEnglishPhilippines
434 : case 0x3809 : // lidEnglishIndonesia
435 : case 0x3c09 : // lidEnglishHongKong
436 : case 0x4009 : // lidEnglishIndia
437 : case 0x4409 : // lidEnglishMalaysia
438 : case 0x4809 : // lidEnglishSingapore
439 : case 0x80a : // lidSpanishMexican, lidMexican
440 : case 0xc0a : // lidSpanishModern
441 : case 0x100a : // lidGuatemala
442 : case 0x140a : // lidCostaRica
443 : case 0x180a : // lidPanama
444 : case 0x1c0a : // lidDominicanRepublic
445 : case 0x200a : // lidSpanishSA, lidVenezuela
446 : case 0x240a : // lidColombia
447 : case 0x280a : // lidPeru
448 : case 0x2c0a : // lidArgentina
449 : case 0x300a : // lidEcuador
450 : case 0x340a : // lidChile
451 : case 0x380a : // lidUruguay
452 : case 0x3c0a : // lidParguay
453 : case 0x400a : // lidBolivia
454 : case 0x440a : // lidElSalvador
455 : case 0x480a : // lidHonduras
456 : case 0x4c0a : // lidNicaragua
457 : case 0x500a : // lidPuertoRico
458 : case 0x540a : // lidSpanishUS
459 : case 0x80c : // lidFrenchBelgian
460 : case 0x100c : // lidFrenchSwiss
461 : case 0x140c : // lidFrenchLuxembourg
462 : case 0x180c : // lidFrenchMonaco
463 : case 0x1c0c : // lidFrenchWestIndies
464 : case 0x200c : // lidFrenchReunion
465 : case 0x240c : // lidFrenchCongoDRC, lidFrenchZaire
466 : case 0x280c : // lidFrenchSenegal
467 : case 0x2c0c : // lidFrenchCameroon
468 : case 0x300c : // lidFrenchCotedIvoire
469 : case 0x340c : // lidFrenchMali
470 : case 0x3c0c : // lidFrenchHaiti
471 : case 0x380c : // lidFrenchMorocco
472 : case 0x40f : // lidIcelandic
473 : case 0x810 : // lidItalianSwiss
474 : case 0x417 : // lidRhaetoRomanic, lidRomanic
475 : case 0x81a : // lidSerbianLatinSerbMont, lidCroatSerbo
476 : case 0x101a : // lidBosniaHerzegovina
477 : case 0x141a : // lidBosnianBosniaHerzegovinaLatin
478 : case 0x181a : // lidSerbianBosniaHerzegovinaLatin
479 : case 0x2c1a : // lidSerbianMontenegroLatin
480 : case 0x41c : // lidAlbanian
481 : case 0x81d : // lidSwedishFinland
482 : case 0x421 : // lidBahasa, lidIndonesian
483 : case 0x42c : // lidAzeriLatin
484 : case 0x42e : // lidSorbian
485 : case 0x82e : // lidLowerSorbian
486 : case 0x438 : // lidFaeroese
487 : case 0x43a : // lidMaltese
488 : case 0x43b : // lidSamiLappish
489 : case 0x83b : // lidNorthSamiSwe
490 : case 0xc3b : // lidNorthernSamiFi
491 : case 0x103b : // lidLuleSamiNor
492 : case 0x143b : // lidLuleSamiSwe
493 : case 0x183b : // lidSouthSamiNor
494 : case 0x1c3b : // lidSouthSamiSwe
495 : case 0x203b : // lidSkoltSami
496 : case 0x243b : // lidInariSami
497 : case 0x43e : // lidMalaysian
498 : case 0x83e : // lidMalayBrunei
499 : case 0x441 : // lidSwahili
500 : case 0x442 : // lidTurkmen
501 : case 0x443 : // lidUzbekLatin
502 : case 0x452 : // lidWelsh
503 : case 0x85d : // lidInuktitutLatin
504 : case 0x85f : // lidTamazightLatin
505 : case 0x462 : // lidFrisian
506 : case 0x464 : // lidFilipino
507 : case 0x466 : // lidEdo
508 : case 0x467 : // lidFulfulde
509 : case 0x468 : // lidHausa
510 : case 0x469 : // lidIbibio
511 : case 0x46a : // lidYoruba
512 : case 0x46b : // lidQuechuaBol
513 : case 0x86b : // lidQuechuaEcu
514 : case 0xc6b : // lidQuechuaPe
515 : case 0x46c : // lidSesothoSaLeboa
516 : case 0x46e : // lidLuxembourgish
517 : case 0x46f : // lidGreenlandic
518 : case 0x470 : // lidIgbo
519 : case 0x471 : // lidKanuri
520 : case 0x472 : // lidOromo
521 : case 0x474 : // lidGuarani
522 : case 0x475 : // lidHawaiian
523 : case 0x476 : // lidLatin
524 : case 0x477 : // lidSomali
525 : case 0x47a : // lidMapudungun
526 : case 0x47c : // lidMohawk
527 : case 0x47e : // lidBreton
528 : case 0x481 : // lidMaori
529 : case 0x482 : // lidOccitan
530 : case 0x483 : // lidCorsican
531 : case 0x484 : // lidAlsatian
532 : case 0x486 : // lidKiche
533 : case 0x487 : // lidKinyarwanda
534 : case 0x488 : // lidWolof
535 318 : return OUString("Latn");
536 : case 0x44c : // lidMalayalam
537 0 : return OUString("Mlym");
538 : case 0x850 : // lidMongolianMongo
539 0 : return OUString("Mong");
540 : case 0x455 : // lidBurmese
541 0 : return OUString("Mymr");
542 : case 0x448 : // lidOriya
543 0 : return OUString("Orya");
544 : case 0x45b : // lidSinhalese
545 0 : return OUString("Sinh");
546 : case 0x45a : // lidSyriac
547 0 : return OUString("Syrc");
548 : case 0x449 : // lidTamil
549 4 : return OUString("Taml");
550 : case 0x44a : // lidTelugu
551 0 : return OUString("Telu");
552 : case 0x465 : // lidMaldivian
553 0 : return OUString("Thaa");
554 : case 0x41e : // lidThai
555 10 : return OUString("Thai");
556 : case 0x451 : // lidTibetan
557 : case 0x851 : // lidBhutanese
558 0 : return OUString("Tibt");
559 : case 0x480 : // lidUighur
560 0 : return OUString("Uigh");
561 : case 0x42a : // lidVietnamese
562 0 : return OUString("Viet");
563 : case 0x478 : // lidYi
564 0 : return OUString("Yiii");
565 : default:
566 141 : return OUString("");
567 : }
568 : }
569 :
570 : }//namespace dmapper
571 : } //namespace writerfilter
572 :
573 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|