LibreOffice Module sw (master)  1
SwStyleNameMapper.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 <SwStyleNameMapper.hxx>
21 #include <poolfmt.hxx>
22 #include <strings.hrc>
23 #include <swtypes.hxx>
24 #include <unotools/syslocale.hxx>
26 #include <map>
27 
28 #ifdef _NEED_TO_DEBUG_MAPPING
29 #include <stdlib.h>
30 #endif
31 
32 namespace
33 {
34 
35 const OUString &
36 lcl_GetSpecialExtraName(const OUString& rExtraName, const bool bIsUIName )
37 {
38  const std::vector<OUString>& rExtraArr = bIsUIName
40  : SwStyleNameMapper::GetExtraProgNameArray();
41  static const sal_uInt16 nIds[] =
42  {
48  0
49  };
50  const sal_uInt16 * pIds;
51  for ( pIds = nIds; *pIds; ++pIds)
52  {
53  if (rExtraName == rExtraArr[ *pIds ])
54  {
55  return bIsUIName
58  }
59  }
60  return rExtraName;
61 }
62 
63 bool lcl_SuffixIsUser(const OUString & rString)
64 {
65  const sal_Unicode *pChar = rString.getStr();
66  sal_Int32 nLen = rString.getLength();
67  bool bRet = false;
68  if( nLen > 8 &&
69  pChar[nLen-7] == ' ' &&
70  pChar[nLen-6] == '(' &&
71  pChar[nLen-5] == 'u' &&
72  pChar[nLen-4] == 's' &&
73  pChar[nLen-3] == 'e' &&
74  pChar[nLen-2] == 'r' &&
75  pChar[nLen-1] == ')' )
76  bRet = true;
77  return bRet;
78 }
79 
80 void lcl_CheckSuffixAndDelete(OUString & rString)
81 {
82  if (lcl_SuffixIsUser(rString))
83  {
84  rString = rString.copy(0, rString.getLength() - 7);
85  }
86 }
87 
88 NameToIdHash HashFromRange(sal_uInt16 nAcc) { return NameToIdHash(nAcc); }
89 template <typename... Rest>
90 NameToIdHash HashFromRange(sal_uInt16 nAcc, sal_uInt16 nBegin, sal_uInt16 nEnd,
91  const std::vector<OUString>& (*pFunc)(), Rest... rest)
92 {
93  NameToIdHash hash(HashFromRange(nAcc + nEnd - nBegin, rest...));
94  sal_uInt16 nIndex, nId;
95  const std::vector<OUString>& rStrings = pFunc();
96  for (nIndex = 0, nId = nBegin; nId < nEnd; nId++, nIndex++)
97  hash[rStrings[nIndex]] = nId;
98  return hash;
99 }
100 
101 template <auto initFunc> struct TablePair
102 {
103  static const NameToIdHash& getMap(bool bProgName)
104  {
105  if (bProgName)
106  {
107  static const NameToIdHash s_aProgMap(initFunc(true));
108  return s_aProgMap;
109  }
110 
111  LanguageTag aCurrentLanguage = SvtSysLocale().GetUILanguageTag();
112  static std::map<LanguageTag, NameToIdHash> s_aUIMap;
113 
114  auto aFound = s_aUIMap.find(aCurrentLanguage);
115  if (aFound == s_aUIMap.end())
116  s_aUIMap[aCurrentLanguage] = initFunc(false);
117 
118  return s_aUIMap[aCurrentLanguage];
119  }
120 };
121 
122 NameToIdHash GetParaMap (bool bProgName)
123 {
124  return HashFromRange(0,
127  RES_POOLCOLL_EXTRA_BEGIN, RES_POOLCOLL_EXTRA_END, bProgName ? &SwStyleNameMapper::GetExtraProgNameArray : &SwStyleNameMapper::GetExtraUINameArray,
131  );
132 };
133 
134 NameToIdHash GetCharMap(bool bProgName)
135 {
136  return HashFromRange(0,
139  );
140 };
141 
142 NameToIdHash GetFrameMap(bool bProgName)
143 {
144  return HashFromRange(0,
146  );
147 };
148 
149 NameToIdHash GetPageMap(bool bProgName)
150 {
151  return HashFromRange(0,
153  );
154 };
155 
156 NameToIdHash GetNumRuleMap(bool bProgName)
157 {
158  return HashFromRange(0,
160  );
161 };
162 
163 NameToIdHash GetTableStyleMap(bool bProgName)
164 {
165  return HashFromRange(0,
167  );
168 };
169 
170 NameToIdHash GetCellStyleMap(bool bProgName)
171 {
172  return HashFromRange(0,
174  );
175 };
176 
177 } // namespace
178 
179 #ifdef _NEED_TO_DEBUG_MAPPING
180 void SwStyleNameMapper::testNameTable( SwGetPoolIdFromName const nFamily, sal_uInt16 const nStartIndex, sal_uInt16 const nEndIndex )
181 {
182  sal_uInt16 nIndex;
183  sal_uInt16 nId;
184 
185  for ( nIndex = 0, nId = nStartIndex ; nId < nEndIndex ; nId++,nIndex++ )
186  {
187  OUString aString, bString;
188  FillUIName ( nId, aString );
189  bString = GetProgName ( nFamily, aString );
190  sal_uInt16 nNewId = GetPoolIdFromProgName ( bString, nFamily );
191  FillProgName ( nNewId, aString );
192  bString = GetUIName ( aString, nFamily );
193  nNewId = GetPoolIdFromUIName ( aString, nFamily );
194  if ( nNewId != nId )
195  abort();
196  }
197 }
198 #endif
199 
201 {
202 #ifdef _NEED_TO_DEBUG_MAPPING
203  static bool bTested = false;
204  if ( !bTested )
205  {
206  bTested = true;
207 
219  }
220 #endif
221 
222  switch ( eFlags )
223  {
225  return TablePair<GetParaMap>::getMap(bProgName);
227  return TablePair<GetCharMap>::getMap(bProgName);
229  return TablePair<GetFrameMap>::getMap(bProgName);
231  return TablePair<GetPageMap>::getMap(bProgName);
233  return TablePair<GetNumRuleMap>::getMap(bProgName);
235  return TablePair<GetTableStyleMap>::getMap(bProgName);
237  return TablePair<GetCellStyleMap>::getMap(bProgName);
238  }
239 
240  assert(false); // must not reach here
241  abort();
242 }
243 
244 // This gets the UI name from the programmatic name
245 const OUString& SwStyleNameMapper::GetUIName(const OUString& rName,
246  SwGetPoolIdFromName const eFlags)
247 {
248  sal_uInt16 nId = GetPoolIdFromProgName ( rName, eFlags );
249  return nId != USHRT_MAX ? GetUIName( nId, rName ) : rName;
250 }
251 
252 // Get the programmatic name from the UI name
254  const OUString& rName, SwGetPoolIdFromName const eFlags)
255 {
256  sal_uInt16 nId = GetPoolIdFromUIName ( rName, eFlags );
257  return nId != USHRT_MAX ? GetProgName( nId, rName ) : rName;
258 }
259 
260 // Get the programmatic name from the UI name in rName and put it into rFillName
262  const OUString& rName, OUString& rFillName,
263  SwGetPoolIdFromName const eFlags)
264 {
265  sal_uInt16 nId = GetPoolIdFromUIName ( rName, eFlags );
266  if ( nId == USHRT_MAX )
267  {
268  // rName isn't in our UI name table...check if it's in the programmatic one
269  nId = GetPoolIdFromProgName ( rName, eFlags );
270 
271  rFillName = rName;
272  if (nId == USHRT_MAX )
273  {
274  // It isn't ...make sure the suffix isn't already " (user)"...if it is,
275  // we need to add another one
276  if (lcl_SuffixIsUser(rFillName))
277  rFillName += " (user)";
278  }
279  else
280  {
281  // It's in the programmatic name table...append suffix
282  rFillName += " (user)";
283  }
284  }
285  else
286  {
287  // If we aren't trying to disambiguate, then just do a normal fill
288  fillNameFromId(nId, rFillName, true);
289  }
290 
291  if (eFlags == SwGetPoolIdFromName::ChrFmt && rName == SwResId(STR_POOLCHR_STANDARD))
292  rFillName = "Standard";
293 }
294 
295 // Get the UI name from the programmatic name in rName and put it into rFillName
297  const OUString& rName, OUString& rFillName,
298  SwGetPoolIdFromName const eFlags)
299 {
300  OUString aName = rName;
301  if (eFlags == SwGetPoolIdFromName::ChrFmt && rName == "Standard")
302  aName = SwResId(STR_POOLCHR_STANDARD);
303 
304  sal_uInt16 nId = GetPoolIdFromProgName ( aName, eFlags );
305  if ( nId == USHRT_MAX )
306  {
307  rFillName = aName;
308  // aName isn't in our Prog name table...check if it has a " (user)" suffix, if so remove it
309  lcl_CheckSuffixAndDelete ( rFillName );
310  }
311  else
312  {
313  // If we aren't trying to disambiguate, then just do a normal fill
314  fillNameFromId(nId, rFillName, false);
315  }
316 }
317 
319  sal_uInt16 const nId, const OUString& rFillName, bool const bProgName)
320 {
321  sal_uInt16 nStt = 0;
322  const std::vector<OUString>* pStrArr = nullptr;
323 
324  switch( (USER_FMT | COLL_GET_RANGE_BITS | POOLGRP_NOCOLLID) & nId )
325  {
326  case COLL_TEXT_BITS:
327  if( RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END )
328  {
329  pStrArr = bProgName ? &GetTextProgNameArray() : &GetTextUINameArray();
331  }
332  break;
333  case COLL_LISTS_BITS:
335  {
336  pStrArr = bProgName ? &GetListsProgNameArray() : &GetListsUINameArray();
338  }
339  break;
340  case COLL_EXTRA_BITS:
342  {
343  pStrArr = bProgName ? &GetExtraProgNameArray() : &GetExtraUINameArray();
345  }
346  break;
347  case COLL_REGISTER_BITS:
349  {
350  pStrArr = bProgName ? &GetRegisterProgNameArray() : &GetRegisterUINameArray();
352  }
353  break;
354  case COLL_DOC_BITS:
355  if( RES_POOLCOLL_DOC_BEGIN <= nId && nId < RES_POOLCOLL_DOC_END )
356  {
357  pStrArr = bProgName ? &GetDocProgNameArray() : &GetDocUINameArray();
358  nStt = RES_POOLCOLL_DOC_BEGIN;
359  }
360  break;
361  case COLL_HTML_BITS:
362  if( RES_POOLCOLL_HTML_BEGIN <= nId && nId < RES_POOLCOLL_HTML_END )
363  {
364  pStrArr = bProgName ? &GetHTMLProgNameArray() : &GetHTMLUINameArray();
366  }
367  break;
368  case POOLGRP_CHARFMT:
370  {
371  pStrArr = bProgName ? &GetChrFormatProgNameArray() : &GetChrFormatUINameArray();
373  }
374  else if( RES_POOLCHR_HTML_BEGIN <= nId && nId < RES_POOLCHR_HTML_END )
375  {
376  pStrArr = bProgName ? &GetHTMLChrFormatProgNameArray() : &GetHTMLChrFormatUINameArray();
377  nStt = RES_POOLCHR_HTML_BEGIN;
378  }
379  break;
380  case POOLGRP_FRAMEFMT:
381  if( RES_POOLFRM_BEGIN <= nId && nId < RES_POOLFRM_END )
382  {
383  pStrArr = bProgName ? &GetFrameFormatProgNameArray() : &GetFrameFormatUINameArray();
384  nStt = RES_POOLFRM_BEGIN;
385  }
386  break;
387  case POOLGRP_PAGEDESC:
388  if( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END )
389  {
390  pStrArr = bProgName ? &GetPageDescProgNameArray() : &GetPageDescUINameArray();
391  nStt = RES_POOLPAGE_BEGIN;
392  }
393  break;
394  case POOLGRP_NUMRULE:
395  if( RES_POOLNUMRULE_BEGIN <= nId && nId < RES_POOLNUMRULE_END )
396  {
397  pStrArr = bProgName ? &GetNumRuleProgNameArray() : &GetNumRuleUINameArray();
398  nStt = RES_POOLNUMRULE_BEGIN;
399  }
400  break;
401  case POOLGRP_TABSTYLE:
403  {
404  pStrArr = bProgName ? &GetTableStyleProgNameArray() : &GetTableStyleUINameArray();
406  }
407  break;
408  }
409  return pStrArr ? pStrArr->operator[](nId - nStt) : rFillName;
410 }
411 
413  sal_uInt16 const nId, OUString& rFillName, bool bProgName)
414 {
415  rFillName = getNameFromId(nId, rFillName, bProgName);
416 }
417 
418 // Get the UI name from the pool ID
419 void SwStyleNameMapper::FillUIName(sal_uInt16 const nId, OUString& rFillName)
420 {
421  fillNameFromId(nId, rFillName, false);
422 }
423 
424 // Get the UI name from the pool ID
426  sal_uInt16 const nId, const OUString& rName)
427 {
428  return getNameFromId(nId, rName, false);
429 }
430 
431 // Get the programmatic name from the pool ID
432 void SwStyleNameMapper::FillProgName(sal_uInt16 nId, OUString& rFillName)
433 {
434  fillNameFromId(nId, rFillName, true);
435 }
436 
437 // Get the programmatic name from the pool ID
438 const OUString&
439 SwStyleNameMapper::GetProgName(sal_uInt16 const nId, const OUString& rName)
440 {
441  return getNameFromId(nId, rName, true);
442 }
443 
444 // This gets the PoolId from the UI Name
446  const OUString& rName, SwGetPoolIdFromName const eFlags)
447 {
448  const NameToIdHash & rHashMap = getHashTable ( eFlags, false );
449  NameToIdHash::const_iterator aIter = rHashMap.find(rName);
450  return aIter != rHashMap.end() ? (*aIter).second : USHRT_MAX;
451 }
452 
453 // Get the Pool ID from the programmatic name
455  const OUString& rName, SwGetPoolIdFromName const eFlags)
456 {
457  const NameToIdHash & rHashMap = getHashTable ( eFlags, true );
458  NameToIdHash::const_iterator aIter = rHashMap.find(rName);
459  return aIter != rHashMap.end() ? (*aIter).second : USHRT_MAX;
460 }
461 
462 // Hard coded Programmatic Name tables
463 
465 const std::vector<OUString>& SwStyleNameMapper::GetCellStyleUINameArray()
466 {
467  static const std::vector<OUString> s_aCellStyleUINameArray;
468  return s_aCellStyleUINameArray;
469 }
470 
471 const std::vector<OUString>& SwStyleNameMapper::GetTextProgNameArray()
472 {
473  static const std::vector<OUString> s_aTextProgNameArray = {
474  "Standard", // RES_POOLCOLL_STANDARD
475  "Text body",
476  "First line indent",
477  "Hanging indent",
478  "Text body indent",
479  "Salutation",
480  "Signature",
481  "List Indent", // RES_POOLCOLL_CONFRONTATION
482  "Marginalia",
483  "Heading",
484  "Heading 1",
485  "Heading 2",
486  "Heading 3",
487  "Heading 4",
488  "Heading 5",
489  "Heading 6",
490  "Heading 7",
491  "Heading 8",
492  "Heading 9",
493  "Heading 10", // RES_POOLCOLL_TEXT_END
494  };
495  return s_aTextProgNameArray;
496 }
497 
498 const std::vector<OUString>& SwStyleNameMapper::GetListsProgNameArray()
499 {
500  static const std::vector<OUString> s_aListsProgNameArray = {
501  "List", // STR_POCO_PRGM_NUMBER_BULLET_BASE
502  "Numbering 1 Start", // STR_POCO_PRGM_NUM_LEVEL1S
503  "Numbering 1",
504  "Numbering 1 End",
505  "Numbering 1 Cont.",
506  "Numbering 2 Start",
507  "Numbering 2",
508  "Numbering 2 End",
509  "Numbering 2 Cont.",
510  "Numbering 3 Start",
511  "Numbering 3",
512  "Numbering 3 End",
513  "Numbering 3 Cont.",
514  "Numbering 4 Start",
515  "Numbering 4",
516  "Numbering 4 End",
517  "Numbering 4 Cont.",
518  "Numbering 5 Start",
519  "Numbering 5",
520  "Numbering 5 End",
521  "Numbering 5 Cont.",
522  "List 1 Start",
523  "List 1",
524  "List 1 End",
525  "List 1 Cont.",
526  "List 2 Start",
527  "List 2",
528  "List 2 End",
529  "List 2 Cont.",
530  "List 3 Start",
531  "List 3",
532  "List 3 End",
533  "List 3 Cont.",
534  "List 4 Start",
535  "List 4",
536  "List 4 End",
537  "List 4 Cont.",
538  "List 5 Start",
539  "List 5",
540  "List 5 End",
541  "List 5 Cont.", // STR_POCO_PRGM_BULLET_NONUM5
542  };
543  return s_aListsProgNameArray;
544 }
545 
546 const std::vector<OUString>& SwStyleNameMapper::GetExtraProgNameArray()
547 {
548  static const std::vector<OUString> s_aExtraProgNameArray = {
549  "Header and Footer", // RES_POOLCOLL_EXTRA_BEGIN
550  "Header",
551  "Header left",
552  "Header right",
553  "Footer",
554  "Footer left",
555  "Footer right",
556  "Table Contents",
557  "Table Heading",
558  "Caption",
559  "Illustration",
560  "Table",
561  "Text",
562  "Figure", // RES_POOLCOLL_LABEL_FIGURE
563  "Frame contents",
564  "Footnote",
565  "Addressee",
566  "Sender",
567  "Endnote",
568  "Drawing", // RES_POOLCOLL_LABEL_DRAWING
569  };
570  return s_aExtraProgNameArray;
571 }
572 
573 const std::vector<OUString>& SwStyleNameMapper::GetRegisterProgNameArray()
574 {
575  static const std::vector<OUString> s_aRegisterProgNameArray = {
576  "Index", // STR_POCO_PRGM_REGISTER_BASE
577  "Index Heading", // STR_POCO_PRGM_TOX_IDXH
578  "Index 1",
579  "Index 2",
580  "Index 3",
581  "Index Separator",
582  "Contents Heading",
583  "Contents 1",
584  "Contents 2",
585  "Contents 3",
586  "Contents 4",
587  "Contents 5",
588  "User Index Heading",
589  "User Index 1",
590  "User Index 2",
591  "User Index 3",
592  "User Index 4",
593  "User Index 5",
594  "Contents 6",
595  "Contents 7",
596  "Contents 8",
597  "Contents 9",
598  "Contents 10",
599  "Figure Index Heading",
600  "Figure Index 1",
601  "Object index heading",
602  "Object index 1",
603  "Table index heading",
604  "Table index 1",
605  "Bibliography Heading",
606  "Bibliography 1",
607  "User Index 6",
608  "User Index 7",
609  "User Index 8",
610  "User Index 9",
611  "User Index 10", // STR_POCO_PRGM_TOX_USER10
612  };
613  return s_aRegisterProgNameArray;
614 }
615 
616 const std::vector<OUString>& SwStyleNameMapper::GetDocProgNameArray()
617 {
618  static const std::vector<OUString> s_aDocProgNameArray = {
619  "Title", // STR_POCO_PRGM_DOC_TITLE
620  "Subtitle",
621  "Appendix",
622  };
623  return s_aDocProgNameArray;
624 }
625 
626 const std::vector<OUString>& SwStyleNameMapper::GetHTMLProgNameArray()
627 {
628  static const std::vector<OUString> s_aHTMLProgNameArray = {
629  "Quotations",
630  "Preformatted Text",
631  "Horizontal Line",
632  "List Contents",
633  "List Heading", // STR_POCO_PRGM_HTML_DT
634  };
635  return s_aHTMLProgNameArray;
636 }
637 
639 {
640  static const std::vector<OUString> s_aFrameFormatProgNameArray = {
641  "Frame", // RES_POOLFRM_FRAME
642  "Graphics",
643  "OLE",
644  "Formula",
645  "Marginalia",
646  "Watermark",
647  "Labels", // RES_POOLFRM_LABEL
648  };
649  return s_aFrameFormatProgNameArray;
650 }
651 
652 const std::vector<OUString>& SwStyleNameMapper::GetChrFormatProgNameArray()
653 {
654  static const std::vector<OUString> s_aChrFormatProgNameArray = {
655  "Footnote Symbol", // RES_POOLCHR_FOOTNOTE
656  "Page Number",
657  "Caption characters",
658  "Drop Caps",
659  "Numbering Symbols",
660  "Bullet Symbols",
661  "Internet link",
662  "Visited Internet Link",
663  "Placeholder",
664  "Index Link",
665  "Endnote Symbol",
666  "Line numbering",
667  "Main index entry",
668  "Footnote anchor",
669  "Endnote anchor",
670  "Rubies", // RES_POOLCHR_RUBYTEXT
671  "Vertical Numbering Symbols", // RES_POOLCHR_VERT_NUMBER
672  };
673  return s_aChrFormatProgNameArray;
674 }
675 
677 {
678  static const std::vector<OUString> s_aHTMLChrFormatProgNameArray = {
679  "Emphasis", // RES_POOLCHR_HTML_EMPHASIS
680  "Citation",
681  "Strong Emphasis",
682  "Source Text",
683  "Example",
684  "User Entry",
685  "Variable",
686  "Definition",
687  "Teletype", // RES_POOLCHR_HTML_TELETYPE
688  };
689  return s_aHTMLChrFormatProgNameArray;
690 }
691 
692 const std::vector<OUString>& SwStyleNameMapper::GetPageDescProgNameArray()
693 {
694  static const std::vector<OUString> s_aPageDescProgNameArray = {
695  "Standard", // STR_POOLPAGE_PRGM_STANDARD
696  "First Page",
697  "Left Page",
698  "Right Page",
699  "Envelope",
700  "Index",
701  "HTML",
702  "Footnote",
703  "Endnote", // STR_POOLPAGE_PRGM_ENDNOTE
704  "Landscape",
705  };
706  return s_aPageDescProgNameArray;
707 }
708 
709 const std::vector<OUString>& SwStyleNameMapper::GetNumRuleProgNameArray()
710 {
711  static const std::vector<OUString> s_aNumRuleProgNameArray = {
712  "Numbering 123", // STR_POOLNUMRULE_PRGM_NUM1
713  "Numbering ABC",
714  "Numbering abc",
715  "Numbering IVX",
716  "Numbering ivx",
717  "List 1",
718  "List 2",
719  "List 3",
720  "List 4",
721  "List 5", // STR_POOLNUMRULE_PRGM_BUL5
722  };
723  return s_aNumRuleProgNameArray;
724 }
725 
726 const std::vector<OUString>& SwStyleNameMapper::GetTableStyleProgNameArray()
727 {
728  // XXX MUST match the entries of STR_TABSTYLE_ARY in
729  // sw/source/core/doc/DocumentStylePoolManager.cxx and MUST match the order of
730  // RES_POOL_TABLESTYLE_TYPE in sw/inc/poolfmt.hxx
731  static const std::vector<OUString> s_aTableStyleProgNameArray = {
732  "Default Style", // RES_POOLTABLESTYLE_DEFAULT
733  "3D", // RES_POOLTABLESTYLE_3D
734  "Black 1", // RES_POOLTABLESTYLE_BLACK1
735  "Black 2", // RES_POOLTABLESTYLE_BLACK2
736  "Blue", // RES_POOLTABLESTYLE_BLUE
737  "Brown", // RES_POOLTABLESTYLE_BROWN
738  "Currency", // RES_POOLTABLESTYLE_CURRENCY
739  "Currency 3D", // RES_POOLTABLESTYLE_CURRENCY_3D
740  "Currency Gray", // RES_POOLTABLESTYLE_CURRENCY_GRAY
741  "Currency Lavender", // RES_POOLTABLESTYLE_CURRENCY_LAVENDER
742  "Currency Turquoise", // RES_POOLTABLESTYLE_CURRENCY_TURQUOISE
743  "Gray", // RES_POOLTABLESTYLE_GRAY
744  "Green", // RES_POOLTABLESTYLE_GREEN
745  "Lavender", // RES_POOLTABLESTYLE_LAVENDER
746  "Red", // RES_POOLTABLESTYLE_RED
747  "Turquoise", // RES_POOLTABLESTYLE_TURQUOISE
748  "Yellow", // RES_POOLTABLESTYLE_YELLOW
749  "Academic", // RES_POOLTABLESTYLE_LO6_ACADEMIC
750  "Box List Blue", // RES_POOLTABLESTYLE_LO6_BOX_LIST_BLUE
751  "Box List Green", // RES_POOLTABLESTYLE_LO6_BOX_LIST_GREEN
752  "Box List Red", // RES_POOLTABLESTYLE_LO6_BOX_LIST_RED
753  "Box List Yellow", // RES_POOLTABLESTYLE_LO6_BOX_LIST_YELLOW
754  "Elegant", // RES_POOLTABLESTYLE_LO6_ELEGANT
755  "Financial", // RES_POOLTABLESTYLE_LO6_FINANCIAL
756  "Simple Grid Columns", // RES_POOLTABLESTYLE_LO6_SIMPLE_GRID_COLUMNS
757  "Simple Grid Rows", // RES_POOLTABLESTYLE_LO6_SIMPLE_GRID_ROWS
758  "Simple List Shaded", // RES_POOLTABLESTYLE_LO6_SIMPLE_LIST_SHADED
759  };
760  return s_aTableStyleProgNameArray;
761 }
762 
764 const std::vector<OUString>& SwStyleNameMapper::GetCellStyleProgNameArray()
765 {
766  static const std::vector<OUString> s_aCellStyleProgNameArray;
767  return s_aCellStyleProgNameArray;
768 }
769 
770 const OUString &
771 SwStyleNameMapper::GetSpecialExtraProgName(const OUString& rExtraUIName)
772 {
773  return lcl_GetSpecialExtraName( rExtraUIName, true );
774 }
775 
776 const OUString &
777 SwStyleNameMapper::GetSpecialExtraUIName(const OUString& rExtraProgName)
778 {
779  return lcl_GetSpecialExtraName( rExtraProgName, false );
780 }
781 
782 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const sal_uInt16 COLL_LISTS_BITS
Definition: poolfmt.hxx:66
sal_Int32 nIndex
const sal_uInt16 COLL_DOC_BITS
Definition: poolfmt.hxx:69
Group HTML-styles.
Definition: poolfmt.hxx:429
static const std::vector< OUString > & GetDocProgNameArray()
static const std::vector< OUString > & GetListsUINameArray()
static const std::vector< OUString > & GetTableStyleUINameArray()
Group chapter / document.
Definition: poolfmt.hxx:420
static const std::vector< OUString > & GetFrameFormatUINameArray()
const LanguageTag & GetUILanguageTag() const
const sal_uInt16 COLL_GET_RANGE_BITS
Definition: poolfmt.hxx:71
static void FillUIName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
static const std::vector< OUString > & GetExtraProgNameArray()
static const std::vector< OUString > & GetTextProgNameArray()
static const NameToIdHash & getHashTable(SwGetPoolIdFromName, bool bProgName)
static const std::vector< OUString > & GetHTMLUINameArray()
End of text styles collection.
Definition: poolfmt.hxx:437
Special ranges.
Definition: poolfmt.hxx:326
const sal_uInt16 COLL_HTML_BITS
Definition: poolfmt.hxx:70
sal_Int16 nId
static const std::vector< OUString > & GetChrFormatProgNameArray()
static const std::vector< OUString > & GetPageDescUINameArray()
static const std::vector< OUString > & GetDocUINameArray()
sal_uInt16 sal_Unicode
static const std::vector< OUString > & GetListsProgNameArray()
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
static const std::vector< OUString > & GetRegisterProgNameArray()
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
const sal_uInt16 COLL_REGISTER_BITS
Definition: poolfmt.hxx:68
const sal_uInt16 POOLGRP_NOCOLLID
POOLCOLL-IDs: +-—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+ !User! Range ! 0 ! Offset ! +-—+—+...
Definition: poolfmt.hxx:59
static const std::vector< OUString > & GetHTMLChrFormatProgNameArray()
static const OUString & getNameFromId(sal_uInt16 nId, const OUString &rName, bool bProgName)
static SW_DLLPUBLIC const OUString & GetSpecialExtraProgName(const OUString &rExtraUIName)
static const std::vector< OUString > & GetHTMLProgNameArray()
HTML-styles.
Definition: poolfmt.hxx:134
const sal_uInt16 POOLGRP_PAGEDESC
Definition: poolfmt.hxx:77
std::unordered_map< OUString, sal_uInt16 > NameToIdHash
This class holds all data about the names of styles used in the user interface (UI names...
static void fillNameFromId(sal_uInt16 nId, OUString &rName, bool bProgName)
Label drawing objects.
Definition: poolfmt.hxx:357
OUString SwResId(const char *pId)
Definition: swmodule.cxx:165
static const std::vector< OUString > & GetCellStyleProgNameArray()
returns an empty array because Cell Names aren't translated
const sal_uInt16 POOLGRP_FRAMEFMT
Definition: poolfmt.hxx:76
static const std::vector< OUString > & GetNumRuleUINameArray()
const sal_uInt16 USER_FMT
POLLCOLL-groups:
Definition: poolfmt.hxx:63
static const std::vector< OUString > & GetHTMLChrFormatUINameArray()
static const std::vector< OUString > & GetChrFormatUINameArray()
static const std::vector< OUString > & GetExtraUINameArray()
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:254
const sal_uInt16 POOLGRP_NUMRULE
Definition: poolfmt.hxx:78
OUString aName
static void FillProgName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
static const std::vector< OUString > & GetRegisterUINameArray()
static const OUString & GetUIName(const OUString &rName, SwGetPoolIdFromName)
static const std::vector< OUString > & GetCellStyleUINameArray()
returns an empty array because Cell Names aren't translated
Label illustration.
Definition: poolfmt.hxx:345
SwGetPoolIdFromName
const char * pChar
const sal_uInt16 POOLGRP_TABSTYLE
Definition: poolfmt.hxx:79
static const std::vector< OUString > & GetNumRuleProgNameArray()
static const std::vector< OUString > & GetTableStyleProgNameArray()
static const std::vector< OUString > & GetPageDescProgNameArray()
const sal_uInt16 COLL_TEXT_BITS
Definition: poolfmt.hxx:65
const sal_uInt16 POOLGRP_CHARFMT
Other groups:
Definition: poolfmt.hxx:75
static const std::vector< OUString > & GetTextUINameArray()
static const std::vector< OUString > & GetFrameFormatProgNameArray()
static sal_uInt16 GetPoolIdFromProgName(const OUString &rName, SwGetPoolIdFromName)
const sal_uInt16 COLL_EXTRA_BITS
Definition: poolfmt.hxx:67
static const OUString & GetSpecialExtraUIName(const OUString &rExtraProgName)
static const OUString & GetProgName(const OUString &rName, SwGetPoolIdFromName)