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