android: Update app-specific/MIME type icons
[LibreOffice.git] / sw / source / core / doc / SwStyleNameMapper.cxx
blob9861e4cc4f11522750d029d7e790ead4e05335ed
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 <SwStyleNameMapper.hxx>
21 #include <poolfmt.hxx>
22 #include <strings.hrc>
23 #include <swtypes.hxx>
24 #include <unotools/syslocale.hxx>
25 #include <i18nlangtag/languagetag.hxx>
26 #include <map>
28 #ifdef _NEED_TO_DEBUG_MAPPING
29 #include <stdlib.h>
30 #endif
32 namespace
35 const OUString &
36 lcl_GetSpecialExtraName(const OUString& rExtraName, const bool bIsUIName )
38 const std::vector<OUString>& rExtraArr = bIsUIName
39 ? SwStyleNameMapper::GetExtraUINameArray()
40 : SwStyleNameMapper::GetExtraProgNameArray();
41 static const sal_uInt16 nIds[] =
43 RES_POOLCOLL_LABEL_DRAWING - RES_POOLCOLL_EXTRA_BEGIN,
44 RES_POOLCOLL_LABEL_ABB - RES_POOLCOLL_EXTRA_BEGIN,
45 RES_POOLCOLL_LABEL_TABLE - RES_POOLCOLL_EXTRA_BEGIN,
46 RES_POOLCOLL_LABEL_FRAME- RES_POOLCOLL_EXTRA_BEGIN,
47 RES_POOLCOLL_LABEL_FIGURE-RES_POOLCOLL_EXTRA_BEGIN,
50 const sal_uInt16 * pIds;
51 for ( pIds = nIds; *pIds; ++pIds)
53 if (rExtraName == rExtraArr[ *pIds ])
55 return bIsUIName
56 ? SwStyleNameMapper::GetExtraProgNameArray()[*pIds]
57 : SwStyleNameMapper::GetExtraUINameArray()[*pIds];
60 return rExtraName;
63 bool lcl_SuffixIsUser(const OUString & rString)
65 // Interesting, why the rest must be longer than 1 character? It is so
66 // since commit 4fbc9dd48b7cebb304010e7337b1bbc3936c7923 (2001-08-16)
67 return rString.getLength() > 8 && rString.endsWith(" (user)");
70 void lcl_CheckSuffixAndDelete(OUString & rString)
72 if (lcl_SuffixIsUser(rString))
74 rString = rString.copy(0, rString.getLength() - 7);
78 NameToIdHash HashFromRange(sal_uInt16 nAcc) { return NameToIdHash(nAcc); }
79 template <typename... Rest>
80 NameToIdHash HashFromRange(sal_uInt16 nAcc, sal_uInt16 nBegin, sal_uInt16 nEnd,
81 const std::vector<OUString>& (*pFunc)(), Rest... rest)
83 NameToIdHash hash(HashFromRange(nAcc + nEnd - nBegin, rest...));
84 sal_uInt16 nIndex, nId;
85 const std::vector<OUString>& rStrings = pFunc();
86 for (nIndex = 0, nId = nBegin; nId < nEnd; nId++, nIndex++)
87 hash[rStrings[nIndex]] = nId;
88 return hash;
91 template <auto initFunc> struct TablePair
93 static const NameToIdHash& getMap(bool bProgName)
95 if (bProgName)
97 static const NameToIdHash s_aProgMap(initFunc(true));
98 return s_aProgMap;
101 SvtSysLocale aSysLocale;
102 const LanguageTag& rCurrentLanguage = aSysLocale.GetUILanguageTag();
103 static std::map<LanguageTag, NameToIdHash> s_aUIMap;
105 auto it = s_aUIMap.find(rCurrentLanguage);
106 if (it == s_aUIMap.end())
107 it = s_aUIMap.emplace(rCurrentLanguage, initFunc(false)).first;
109 return it->second;
113 NameToIdHash GetParaMap (bool bProgName)
115 return HashFromRange(0,
116 RES_POOLCOLL_TEXT_BEGIN, RES_POOLCOLL_TEXT_END, bProgName ? &SwStyleNameMapper::GetTextProgNameArray : &SwStyleNameMapper::GetTextUINameArray,
117 RES_POOLCOLL_LISTS_BEGIN, RES_POOLCOLL_LISTS_END, bProgName ? &SwStyleNameMapper::GetListsProgNameArray : &SwStyleNameMapper::GetListsUINameArray,
118 RES_POOLCOLL_EXTRA_BEGIN, RES_POOLCOLL_EXTRA_END, bProgName ? &SwStyleNameMapper::GetExtraProgNameArray : &SwStyleNameMapper::GetExtraUINameArray,
119 RES_POOLCOLL_REGISTER_BEGIN, RES_POOLCOLL_REGISTER_END, bProgName ? &SwStyleNameMapper::GetRegisterProgNameArray : &SwStyleNameMapper::GetRegisterUINameArray,
120 RES_POOLCOLL_DOC_BEGIN, RES_POOLCOLL_DOC_END, bProgName ? &SwStyleNameMapper::GetDocProgNameArray : &SwStyleNameMapper::GetDocUINameArray,
121 RES_POOLCOLL_HTML_BEGIN, RES_POOLCOLL_HTML_END, bProgName ? &SwStyleNameMapper::GetHTMLProgNameArray : &SwStyleNameMapper::GetHTMLUINameArray
125 NameToIdHash GetCharMap(bool bProgName)
127 return HashFromRange(0,
128 RES_POOLCHR_NORMAL_BEGIN, RES_POOLCHR_NORMAL_END, bProgName ? &SwStyleNameMapper::GetChrFormatProgNameArray : &SwStyleNameMapper::GetChrFormatUINameArray,
129 RES_POOLCHR_HTML_BEGIN, RES_POOLCHR_HTML_END, bProgName ? &SwStyleNameMapper::GetHTMLChrFormatProgNameArray : &SwStyleNameMapper::GetHTMLChrFormatUINameArray
133 NameToIdHash GetFrameMap(bool bProgName)
135 return HashFromRange(0,
136 RES_POOLFRM_BEGIN, RES_POOLFRM_END, bProgName ? &SwStyleNameMapper::GetFrameFormatProgNameArray : &SwStyleNameMapper::GetFrameFormatUINameArray
140 NameToIdHash GetPageMap(bool bProgName)
142 return HashFromRange(0,
143 RES_POOLPAGE_BEGIN, RES_POOLPAGE_END, bProgName ? &SwStyleNameMapper::GetPageDescProgNameArray : &SwStyleNameMapper::GetPageDescUINameArray
147 NameToIdHash GetNumRuleMap(bool bProgName)
149 return HashFromRange(0,
150 RES_POOLNUMRULE_BEGIN, RES_POOLNUMRULE_END, bProgName ? &SwStyleNameMapper::GetNumRuleProgNameArray : &SwStyleNameMapper::GetNumRuleUINameArray
154 NameToIdHash GetTableStyleMap(bool bProgName)
156 return HashFromRange(0,
157 RES_POOLTABLESTYLE_BEGIN, RES_POOLTABLESTYLE_END, bProgName ? &SwStyleNameMapper::GetTableStyleProgNameArray : &SwStyleNameMapper::GetTableStyleUINameArray
161 NameToIdHash GetCellStyleMap(bool bProgName)
163 return HashFromRange(0,
164 RES_POOLCELLSTYLE_BEGIN, RES_POOLCELLSTYLE_END, bProgName ? &SwStyleNameMapper::GetCellStyleProgNameArray : &SwStyleNameMapper::GetCellStyleUINameArray
168 } // namespace
170 #ifdef _NEED_TO_DEBUG_MAPPING
171 void SwStyleNameMapper::testNameTable( SwGetPoolIdFromName const nFamily, sal_uInt16 const nStartIndex, sal_uInt16 const nEndIndex )
173 sal_uInt16 nIndex;
174 sal_uInt16 nId;
176 for ( nIndex = 0, nId = nStartIndex ; nId < nEndIndex ; nId++,nIndex++ )
178 OUString aString, bString;
179 FillUIName ( nId, aString );
180 bString = GetProgName ( nFamily, aString );
181 sal_uInt16 nNewId = GetPoolIdFromProgName ( bString, nFamily );
182 FillProgName ( nNewId, aString );
183 bString = GetUIName ( aString, nFamily );
184 nNewId = GetPoolIdFromUIName ( aString, nFamily );
185 if ( nNewId != nId )
186 abort();
189 #endif
191 const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlags, bool bProgName )
193 #ifdef _NEED_TO_DEBUG_MAPPING
194 static bool bTested = false;
195 if ( !bTested )
197 bTested = true;
199 testNameTable( SwGetPoolIdFromName::TxtColl, RES_POOLCOLL_TEXT_BEGIN, RES_POOLCOLL_TEXT_END );
200 testNameTable( SwGetPoolIdFromName::TxtColl, RES_POOLCOLL_LISTS_BEGIN, RES_POOLCOLL_LISTS_END );
201 testNameTable( SwGetPoolIdFromName::TxtColl, RES_POOLCOLL_EXTRA_BEGIN, RES_POOLCOLL_EXTRA_END );
202 testNameTable( SwGetPoolIdFromName::TxtColl, RES_POOLCOLL_REGISTER_BEGIN, RES_POOLCOLL_REGISTER_END );
203 testNameTable( SwGetPoolIdFromName::TxtColl, RES_POOLCOLL_DOC_BEGIN, RES_POOLCOLL_DOC_END );
204 testNameTable( SwGetPoolIdFromName::TxtColl, RES_POOLCOLL_HTML_BEGIN, RES_POOLCOLL_HTML_END );
205 testNameTable( SwGetPoolIdFromName::ChrFmt, RES_POOLCHR_NORMAL_BEGIN, RES_POOLCHR_NORMAL_END );
206 testNameTable( SwGetPoolIdFromName::ChrFmt, RES_POOLCHR_HTML_BEGIN, RES_POOLCHR_HTML_END );
207 testNameTable( SwGetPoolIdFromName::FrmFmt, RES_POOLFRM_BEGIN, RES_POOLFRM_END );
208 testNameTable( SwGetPoolIdFromName::PageDesc, RES_POOLPAGE_BEGIN, RES_POOLPAGE_END );
209 testNameTable( SwGetPoolIdFromName::NumRule, RES_POOLNUMRULE_BEGIN, RES_POOLNUMRULE_END );
211 #endif
213 switch ( eFlags )
215 case SwGetPoolIdFromName::TxtColl:
216 return TablePair<GetParaMap>::getMap(bProgName);
217 case SwGetPoolIdFromName::ChrFmt:
218 return TablePair<GetCharMap>::getMap(bProgName);
219 case SwGetPoolIdFromName::FrmFmt:
220 return TablePair<GetFrameMap>::getMap(bProgName);
221 case SwGetPoolIdFromName::PageDesc:
222 return TablePair<GetPageMap>::getMap(bProgName);
223 case SwGetPoolIdFromName::NumRule:
224 return TablePair<GetNumRuleMap>::getMap(bProgName);
225 case SwGetPoolIdFromName::TabStyle:
226 return TablePair<GetTableStyleMap>::getMap(bProgName);
227 case SwGetPoolIdFromName::CellStyle:
228 return TablePair<GetCellStyleMap>::getMap(bProgName);
231 assert(false); // must not reach here
232 abort();
235 // This gets the UI name from the programmatic name
236 const OUString& SwStyleNameMapper::GetUIName(const OUString& rName,
237 SwGetPoolIdFromName const eFlags)
239 sal_uInt16 nId = GetPoolIdFromProgName ( rName, eFlags );
240 return nId != USHRT_MAX ? GetUIName( nId, rName ) : rName;
243 // Get the programmatic name from the UI name
244 const OUString& SwStyleNameMapper::GetProgName(
245 const OUString& rName, SwGetPoolIdFromName const eFlags)
247 sal_uInt16 nId = GetPoolIdFromUIName ( rName, eFlags );
248 return nId != USHRT_MAX ? GetProgName( nId, rName ) : rName;
251 // Get the programmatic name from the UI name in rName and put it into rFillName
252 void SwStyleNameMapper::FillProgName(
253 const OUString& rName, OUString& rFillName,
254 SwGetPoolIdFromName const eFlags)
256 sal_uInt16 nId = GetPoolIdFromUIName ( rName, eFlags );
257 if ( nId == USHRT_MAX )
259 // rName isn't in our UI name table...check if it's in the programmatic one
260 nId = GetPoolIdFromProgName ( rName, eFlags );
262 rFillName = rName;
263 if (nId == USHRT_MAX )
265 // It isn't ...make sure the suffix isn't already " (user)"...if it is,
266 // we need to add another one
267 if (lcl_SuffixIsUser(rFillName))
268 rFillName += " (user)";
270 else
272 // It's in the programmatic name table...append suffix
273 rFillName += " (user)";
276 else
278 // If we aren't trying to disambiguate, then just do a normal fill
279 fillNameFromId(nId, rFillName, true);
282 if (eFlags == SwGetPoolIdFromName::ChrFmt && rName == SwResId(STR_POOLCHR_STANDARD))
283 rFillName = "Standard";
286 // Get the UI name from the programmatic name in rName and put it into rFillName
287 void SwStyleNameMapper::FillUIName(
288 const OUString& rName, OUString& rFillName,
289 SwGetPoolIdFromName const eFlags)
291 OUString aName = rName;
292 if (eFlags == SwGetPoolIdFromName::ChrFmt && rName == "Standard")
293 aName = SwResId(STR_POOLCHR_STANDARD);
295 sal_uInt16 nId = GetPoolIdFromProgName ( aName, eFlags );
296 if ( nId == USHRT_MAX )
298 rFillName = aName;
299 // aName isn't in our Prog name table...check if it has a " (user)" suffix, if so remove it
300 lcl_CheckSuffixAndDelete ( rFillName );
302 else
304 // If we aren't trying to disambiguate, then just do a normal fill
305 fillNameFromId(nId, rFillName, false);
309 const OUString& SwStyleNameMapper::getNameFromId(
310 sal_uInt16 const nId, const OUString& rFillName, bool const bProgName)
312 sal_uInt16 nStt = 0;
313 const std::vector<OUString>* pStrArr = nullptr;
315 switch( (USER_FMT | COLL_GET_RANGE_BITS | POOLGRP_NOCOLLID) & nId )
317 case COLL_TEXT_BITS:
318 if( RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END )
320 pStrArr = bProgName ? &GetTextProgNameArray() : &GetTextUINameArray();
321 nStt = RES_POOLCOLL_TEXT_BEGIN;
323 break;
324 case COLL_LISTS_BITS:
325 if( RES_POOLCOLL_LISTS_BEGIN <= nId && nId < RES_POOLCOLL_LISTS_END )
327 pStrArr = bProgName ? &GetListsProgNameArray() : &GetListsUINameArray();
328 nStt = RES_POOLCOLL_LISTS_BEGIN;
330 break;
331 case COLL_EXTRA_BITS:
332 if( RES_POOLCOLL_EXTRA_BEGIN <= nId && nId < RES_POOLCOLL_EXTRA_END )
334 pStrArr = bProgName ? &GetExtraProgNameArray() : &GetExtraUINameArray();
335 nStt = RES_POOLCOLL_EXTRA_BEGIN;
337 break;
338 case COLL_REGISTER_BITS:
339 if( RES_POOLCOLL_REGISTER_BEGIN <= nId && nId < RES_POOLCOLL_REGISTER_END )
341 pStrArr = bProgName ? &GetRegisterProgNameArray() : &GetRegisterUINameArray();
342 nStt = RES_POOLCOLL_REGISTER_BEGIN;
344 break;
345 case COLL_DOC_BITS:
346 if( RES_POOLCOLL_DOC_BEGIN <= nId && nId < RES_POOLCOLL_DOC_END )
348 pStrArr = bProgName ? &GetDocProgNameArray() : &GetDocUINameArray();
349 nStt = RES_POOLCOLL_DOC_BEGIN;
351 break;
352 case COLL_HTML_BITS:
353 if( RES_POOLCOLL_HTML_BEGIN <= nId && nId < RES_POOLCOLL_HTML_END )
355 pStrArr = bProgName ? &GetHTMLProgNameArray() : &GetHTMLUINameArray();
356 nStt = RES_POOLCOLL_HTML_BEGIN;
358 break;
359 case POOLGRP_CHARFMT:
360 if( RES_POOLCHR_NORMAL_BEGIN <= nId && nId < RES_POOLCHR_NORMAL_END )
362 pStrArr = bProgName ? &GetChrFormatProgNameArray() : &GetChrFormatUINameArray();
363 nStt = RES_POOLCHR_NORMAL_BEGIN;
365 else if( RES_POOLCHR_HTML_BEGIN <= nId && nId < RES_POOLCHR_HTML_END )
367 pStrArr = bProgName ? &GetHTMLChrFormatProgNameArray() : &GetHTMLChrFormatUINameArray();
368 nStt = RES_POOLCHR_HTML_BEGIN;
370 break;
371 case POOLGRP_FRAMEFMT:
372 if( RES_POOLFRM_BEGIN <= nId && nId < RES_POOLFRM_END )
374 pStrArr = bProgName ? &GetFrameFormatProgNameArray() : &GetFrameFormatUINameArray();
375 nStt = RES_POOLFRM_BEGIN;
377 break;
378 case POOLGRP_PAGEDESC:
379 if( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END )
381 pStrArr = bProgName ? &GetPageDescProgNameArray() : &GetPageDescUINameArray();
382 nStt = RES_POOLPAGE_BEGIN;
384 break;
385 case POOLGRP_NUMRULE:
386 if( RES_POOLNUMRULE_BEGIN <= nId && nId < RES_POOLNUMRULE_END )
388 pStrArr = bProgName ? &GetNumRuleProgNameArray() : &GetNumRuleUINameArray();
389 nStt = RES_POOLNUMRULE_BEGIN;
391 break;
392 case POOLGRP_TABSTYLE:
393 if( RES_POOLTABLESTYLE_BEGIN <= nId && nId < RES_POOLTABLESTYLE_END )
395 pStrArr = bProgName ? &GetTableStyleProgNameArray() : &GetTableStyleUINameArray();
396 nStt = RES_POOLTABLESTYLE_BEGIN;
398 break;
400 return pStrArr ? pStrArr->operator[](nId - nStt) : rFillName;
403 void SwStyleNameMapper::fillNameFromId(
404 sal_uInt16 const nId, OUString& rFillName, bool bProgName)
406 rFillName = getNameFromId(nId, rFillName, bProgName);
409 // Get the UI name from the pool ID
410 void SwStyleNameMapper::FillUIName(sal_uInt16 const nId, OUString& rFillName)
412 fillNameFromId(nId, rFillName, false);
415 // Get the UI name from the pool ID
416 const OUString& SwStyleNameMapper::GetUIName(
417 sal_uInt16 const nId, const OUString& rName)
419 return getNameFromId(nId, rName, false);
422 // Get the programmatic name from the pool ID
423 void SwStyleNameMapper::FillProgName(sal_uInt16 nId, OUString& rFillName)
425 fillNameFromId(nId, rFillName, true);
428 // Get the programmatic name from the pool ID
429 const OUString&
430 SwStyleNameMapper::GetProgName(sal_uInt16 const nId, const OUString& rName)
432 return getNameFromId(nId, rName, true);
435 // This gets the PoolId from the UI Name
436 sal_uInt16 SwStyleNameMapper::GetPoolIdFromUIName(
437 const OUString& rName, SwGetPoolIdFromName const eFlags)
439 const NameToIdHash & rHashMap = getHashTable ( eFlags, false );
440 NameToIdHash::const_iterator aIter = rHashMap.find(rName);
441 return aIter != rHashMap.end() ? (*aIter).second : USHRT_MAX;
444 // Get the Pool ID from the programmatic name
445 sal_uInt16 SwStyleNameMapper::GetPoolIdFromProgName(
446 const OUString& rName, SwGetPoolIdFromName const eFlags)
448 const NameToIdHash & rHashMap = getHashTable ( eFlags, true );
449 NameToIdHash::const_iterator aIter = rHashMap.find(rName);
450 return aIter != rHashMap.end() ? (*aIter).second : USHRT_MAX;
453 // Hard coded Programmatic Name tables
455 /// returns an empty array because Cell Names aren't translated
456 const std::vector<OUString>& SwStyleNameMapper::GetCellStyleUINameArray()
458 static const std::vector<OUString> s_aCellStyleUINameArray;
459 return s_aCellStyleUINameArray;
462 const std::vector<OUString>& SwStyleNameMapper::GetTextProgNameArray()
464 static const std::vector<OUString> s_aTextProgNameArray = {
465 "Standard", // RES_POOLCOLL_STANDARD
466 "Text body",
467 "First line indent",
468 "Hanging indent",
469 "Text body indent",
470 "Salutation",
471 "Signature",
472 "List Indent", // RES_POOLCOLL_CONFRONTATION
473 "Marginalia",
474 "Heading",
475 "Heading 1",
476 "Heading 2",
477 "Heading 3",
478 "Heading 4",
479 "Heading 5",
480 "Heading 6",
481 "Heading 7",
482 "Heading 8",
483 "Heading 9",
484 "Heading 10", // RES_POOLCOLL_TEXT_END
486 return s_aTextProgNameArray;
489 const std::vector<OUString>& SwStyleNameMapper::GetListsProgNameArray()
491 static const std::vector<OUString> s_aListsProgNameArray = {
492 "List", // STR_POCO_PRGM_NUMBER_BULLET_BASE
493 "Numbering 1 Start", // STR_POCO_PRGM_NUM_LEVEL1S
494 "Numbering 1",
495 "Numbering 1 End",
496 "Numbering 1 Cont.",
497 "Numbering 2 Start",
498 "Numbering 2",
499 "Numbering 2 End",
500 "Numbering 2 Cont.",
501 "Numbering 3 Start",
502 "Numbering 3",
503 "Numbering 3 End",
504 "Numbering 3 Cont.",
505 "Numbering 4 Start",
506 "Numbering 4",
507 "Numbering 4 End",
508 "Numbering 4 Cont.",
509 "Numbering 5 Start",
510 "Numbering 5",
511 "Numbering 5 End",
512 "Numbering 5 Cont.",
513 "List 1 Start",
514 "List 1",
515 "List 1 End",
516 "List 1 Cont.",
517 "List 2 Start",
518 "List 2",
519 "List 2 End",
520 "List 2 Cont.",
521 "List 3 Start",
522 "List 3",
523 "List 3 End",
524 "List 3 Cont.",
525 "List 4 Start",
526 "List 4",
527 "List 4 End",
528 "List 4 Cont.",
529 "List 5 Start",
530 "List 5",
531 "List 5 End",
532 "List 5 Cont.", // STR_POCO_PRGM_BULLET_NONUM5
534 return s_aListsProgNameArray;
537 const std::vector<OUString>& SwStyleNameMapper::GetExtraProgNameArray()
539 static const std::vector<OUString> s_aExtraProgNameArray = {
540 "Header and Footer", // RES_POOLCOLL_EXTRA_BEGIN
541 "Header",
542 "Header left",
543 "Header right",
544 "Footer",
545 "Footer left",
546 "Footer right",
547 "Table Contents",
548 "Table Heading",
549 "Caption",
550 "Illustration",
551 "Table",
552 "Text",
553 "Figure", // RES_POOLCOLL_LABEL_FIGURE
554 "Frame contents",
555 "Footnote",
556 "Addressee",
557 "Sender",
558 "Endnote",
559 "Drawing", // RES_POOLCOLL_LABEL_DRAWING
561 return s_aExtraProgNameArray;
564 const std::vector<OUString>& SwStyleNameMapper::GetRegisterProgNameArray()
566 static const std::vector<OUString> s_aRegisterProgNameArray = {
567 "Index", // STR_POCO_PRGM_REGISTER_BASE
568 "Index Heading", // STR_POCO_PRGM_TOX_IDXH
569 "Index 1",
570 "Index 2",
571 "Index 3",
572 "Index Separator",
573 "Contents Heading",
574 "Contents 1",
575 "Contents 2",
576 "Contents 3",
577 "Contents 4",
578 "Contents 5",
579 "User Index Heading",
580 "User Index 1",
581 "User Index 2",
582 "User Index 3",
583 "User Index 4",
584 "User Index 5",
585 "Contents 6",
586 "Contents 7",
587 "Contents 8",
588 "Contents 9",
589 "Contents 10",
590 "Figure Index Heading",
591 "Figure Index 1",
592 "Object index heading",
593 "Object index 1",
594 "Table index heading",
595 "Table index 1",
596 "Bibliography Heading",
597 "Bibliography 1",
598 "User Index 6",
599 "User Index 7",
600 "User Index 8",
601 "User Index 9",
602 "User Index 10", // STR_POCO_PRGM_TOX_USER10
604 return s_aRegisterProgNameArray;
607 const std::vector<OUString>& SwStyleNameMapper::GetDocProgNameArray()
609 static const std::vector<OUString> s_aDocProgNameArray = {
610 "Title", // STR_POCO_PRGM_DOC_TITLE
611 "Subtitle",
612 "Appendix",
614 return s_aDocProgNameArray;
617 const std::vector<OUString>& SwStyleNameMapper::GetHTMLProgNameArray()
619 static const std::vector<OUString> s_aHTMLProgNameArray = {
620 "Quotations",
621 "Preformatted Text",
622 "Horizontal Line",
623 "List Contents",
624 "List Heading", // STR_POCO_PRGM_HTML_DT
626 return s_aHTMLProgNameArray;
629 const std::vector<OUString>& SwStyleNameMapper::GetFrameFormatProgNameArray()
631 static const std::vector<OUString> s_aFrameFormatProgNameArray = {
632 "Frame", // RES_POOLFRM_FRAME
633 "Graphics",
634 "OLE",
635 "Formula",
636 "Marginalia",
637 "Watermark",
638 "Labels", // RES_POOLFRM_LABEL
640 return s_aFrameFormatProgNameArray;
643 const std::vector<OUString>& SwStyleNameMapper::GetChrFormatProgNameArray()
645 static const std::vector<OUString> s_aChrFormatProgNameArray = {
646 "Footnote Symbol", // RES_POOLCHR_FOOTNOTE
647 "Page Number",
648 "Caption characters",
649 "Drop Caps",
650 "Numbering Symbols",
651 "Bullet Symbols",
652 "Internet link",
653 "Visited Internet Link",
654 "Placeholder",
655 "Index Link",
656 "Endnote Symbol",
657 "Line numbering",
658 "Main index entry",
659 "Footnote anchor",
660 "Endnote anchor",
661 "Rubies", // RES_POOLCHR_RUBYTEXT
662 "Vertical Numbering Symbols", // RES_POOLCHR_VERT_NUMBER
664 return s_aChrFormatProgNameArray;
667 const std::vector<OUString>& SwStyleNameMapper::GetHTMLChrFormatProgNameArray()
669 static const std::vector<OUString> s_aHTMLChrFormatProgNameArray = {
670 "Emphasis", // RES_POOLCHR_HTML_EMPHASIS
671 "Citation",
672 "Strong Emphasis",
673 "Source Text",
674 "Example",
675 "User Entry",
676 "Variable",
677 "Definition",
678 "Teletype", // RES_POOLCHR_HTML_TELETYPE
680 return s_aHTMLChrFormatProgNameArray;
683 const std::vector<OUString>& SwStyleNameMapper::GetPageDescProgNameArray()
685 static const std::vector<OUString> s_aPageDescProgNameArray = {
686 "Standard", // STR_POOLPAGE_PRGM_STANDARD
687 "First Page",
688 "Left Page",
689 "Right Page",
690 "Envelope",
691 "Index",
692 "HTML",
693 "Footnote",
694 "Endnote", // STR_POOLPAGE_PRGM_ENDNOTE
695 "Landscape",
697 return s_aPageDescProgNameArray;
700 const std::vector<OUString>& SwStyleNameMapper::GetNumRuleProgNameArray()
702 static const std::vector<OUString> s_aNumRuleProgNameArray = {
703 "No List",
704 "Numbering 123", // STR_POOLNUMRULE_PRGM_NUM1
705 "Numbering ABC",
706 "Numbering abc",
707 "Numbering IVX",
708 "Numbering ivx",
709 "List 1",
710 "List 2",
711 "List 3",
712 "List 4",
713 "List 5", // STR_POOLNUMRULE_PRGM_BUL5
715 return s_aNumRuleProgNameArray;
718 const std::vector<OUString>& SwStyleNameMapper::GetTableStyleProgNameArray()
720 // XXX MUST match the entries of STR_TABSTYLE_ARY in
721 // sw/source/core/doc/DocumentStylePoolManager.cxx and MUST match the order of
722 // RES_POOL_TABLESTYLE_TYPE in sw/inc/poolfmt.hxx
723 static const std::vector<OUString> s_aTableStyleProgNameArray = {
724 "Default Style", // RES_POOLTABLESTYLE_DEFAULT
725 "3D", // RES_POOLTABLESTYLE_3D
726 "Black 1", // RES_POOLTABLESTYLE_BLACK1
727 "Black 2", // RES_POOLTABLESTYLE_BLACK2
728 "Blue", // RES_POOLTABLESTYLE_BLUE
729 "Brown", // RES_POOLTABLESTYLE_BROWN
730 "Currency", // RES_POOLTABLESTYLE_CURRENCY
731 "Currency 3D", // RES_POOLTABLESTYLE_CURRENCY_3D
732 "Currency Gray", // RES_POOLTABLESTYLE_CURRENCY_GRAY
733 "Currency Lavender", // RES_POOLTABLESTYLE_CURRENCY_LAVENDER
734 "Currency Turquoise", // RES_POOLTABLESTYLE_CURRENCY_TURQUOISE
735 "Gray", // RES_POOLTABLESTYLE_GRAY
736 "Green", // RES_POOLTABLESTYLE_GREEN
737 "Lavender", // RES_POOLTABLESTYLE_LAVENDER
738 "Red", // RES_POOLTABLESTYLE_RED
739 "Turquoise", // RES_POOLTABLESTYLE_TURQUOISE
740 "Yellow", // RES_POOLTABLESTYLE_YELLOW
741 "Academic", // RES_POOLTABLESTYLE_LO6_ACADEMIC
742 "Box List Blue", // RES_POOLTABLESTYLE_LO6_BOX_LIST_BLUE
743 "Box List Green", // RES_POOLTABLESTYLE_LO6_BOX_LIST_GREEN
744 "Box List Red", // RES_POOLTABLESTYLE_LO6_BOX_LIST_RED
745 "Box List Yellow", // RES_POOLTABLESTYLE_LO6_BOX_LIST_YELLOW
746 "Elegant", // RES_POOLTABLESTYLE_LO6_ELEGANT
747 "Financial", // RES_POOLTABLESTYLE_LO6_FINANCIAL
748 "Simple Grid Columns", // RES_POOLTABLESTYLE_LO6_SIMPLE_GRID_COLUMNS
749 "Simple Grid Rows", // RES_POOLTABLESTYLE_LO6_SIMPLE_GRID_ROWS
750 "Simple List Shaded", // RES_POOLTABLESTYLE_LO6_SIMPLE_LIST_SHADED
752 return s_aTableStyleProgNameArray;
755 /// returns an empty array because Cell Names aren't translated
756 const std::vector<OUString>& SwStyleNameMapper::GetCellStyleProgNameArray()
758 static const std::vector<OUString> s_aCellStyleProgNameArray;
759 return s_aCellStyleProgNameArray;
762 const OUString &
763 SwStyleNameMapper::GetSpecialExtraProgName(const OUString& rExtraUIName)
765 return lcl_GetSpecialExtraName( rExtraUIName, true );
768 const OUString &
769 SwStyleNameMapper::GetSpecialExtraUIName(const OUString& rExtraProgName)
771 return lcl_GetSpecialExtraName( rExtraProgName, false );
774 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */