1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
28 #ifdef _NEED_TO_DEBUG_MAPPING
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
])
56 ? SwStyleNameMapper::GetExtraProgNameArray()[*pIds
]
57 : SwStyleNameMapper::GetExtraUINameArray()[*pIds
];
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
;
91 template <auto initFunc
> struct TablePair
93 static const NameToIdHash
& getMap(bool bProgName
)
97 static const NameToIdHash
s_aProgMap(initFunc(true));
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
;
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
170 #ifdef _NEED_TO_DEBUG_MAPPING
171 void SwStyleNameMapper::testNameTable( SwGetPoolIdFromName
const nFamily
, sal_uInt16
const nStartIndex
, sal_uInt16
const nEndIndex
)
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
);
191 const NameToIdHash
& SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlags
, bool bProgName
)
193 #ifdef _NEED_TO_DEBUG_MAPPING
194 static bool bTested
= false;
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
);
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
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
);
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)";
272 // It's in the programmatic name table...append suffix
273 rFillName
+= " (user)";
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
)
299 // aName isn't in our Prog name table...check if it has a " (user)" suffix, if so remove it
300 lcl_CheckSuffixAndDelete ( rFillName
);
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
)
313 const std::vector
<OUString
>* pStrArr
= nullptr;
315 switch( (USER_FMT
| COLL_GET_RANGE_BITS
| POOLGRP_NOCOLLID
) & nId
)
318 if( RES_POOLCOLL_TEXT_BEGIN
<= nId
&& nId
< RES_POOLCOLL_TEXT_END
)
320 pStrArr
= bProgName
? &GetTextProgNameArray() : &GetTextUINameArray();
321 nStt
= RES_POOLCOLL_TEXT_BEGIN
;
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
;
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
;
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
;
346 if( RES_POOLCOLL_DOC_BEGIN
<= nId
&& nId
< RES_POOLCOLL_DOC_END
)
348 pStrArr
= bProgName
? &GetDocProgNameArray() : &GetDocUINameArray();
349 nStt
= RES_POOLCOLL_DOC_BEGIN
;
353 if( RES_POOLCOLL_HTML_BEGIN
<= nId
&& nId
< RES_POOLCOLL_HTML_END
)
355 pStrArr
= bProgName
? &GetHTMLProgNameArray() : &GetHTMLUINameArray();
356 nStt
= RES_POOLCOLL_HTML_BEGIN
;
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
;
371 case POOLGRP_FRAMEFMT
:
372 if( RES_POOLFRM_BEGIN
<= nId
&& nId
< RES_POOLFRM_END
)
374 pStrArr
= bProgName
? &GetFrameFormatProgNameArray() : &GetFrameFormatUINameArray();
375 nStt
= RES_POOLFRM_BEGIN
;
378 case POOLGRP_PAGEDESC
:
379 if( RES_POOLPAGE_BEGIN
<= nId
&& nId
< RES_POOLPAGE_END
)
381 pStrArr
= bProgName
? &GetPageDescProgNameArray() : &GetPageDescUINameArray();
382 nStt
= RES_POOLPAGE_BEGIN
;
385 case POOLGRP_NUMRULE
:
386 if( RES_POOLNUMRULE_BEGIN
<= nId
&& nId
< RES_POOLNUMRULE_END
)
388 pStrArr
= bProgName
? &GetNumRuleProgNameArray() : &GetNumRuleUINameArray();
389 nStt
= RES_POOLNUMRULE_BEGIN
;
392 case POOLGRP_TABSTYLE
:
393 if( RES_POOLTABLESTYLE_BEGIN
<= nId
&& nId
< RES_POOLTABLESTYLE_END
)
395 pStrArr
= bProgName
? &GetTableStyleProgNameArray() : &GetTableStyleUINameArray();
396 nStt
= RES_POOLTABLESTYLE_BEGIN
;
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
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
472 "List Indent", // RES_POOLCOLL_CONFRONTATION
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
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
553 "Figure", // RES_POOLCOLL_LABEL_FIGURE
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
579 "User Index Heading",
590 "Figure Index Heading",
592 "Object index heading",
594 "Table index heading",
596 "Bibliography Heading",
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
614 return s_aDocProgNameArray
;
617 const std::vector
<OUString
>& SwStyleNameMapper::GetHTMLProgNameArray()
619 static const std::vector
<OUString
> s_aHTMLProgNameArray
= {
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
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
648 "Caption characters",
653 "Visited Internet Link",
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
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
694 "Endnote", // STR_POOLPAGE_PRGM_ENDNOTE
697 return s_aPageDescProgNameArray
;
700 const std::vector
<OUString
>& SwStyleNameMapper::GetNumRuleProgNameArray()
702 static const std::vector
<OUString
> s_aNumRuleProgNameArray
= {
704 "Numbering 123", // STR_POOLNUMRULE_PRGM_NUM1
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
;
763 SwStyleNameMapper::GetSpecialExtraProgName(const OUString
& rExtraUIName
)
765 return lcl_GetSpecialExtraName( rExtraUIName
, true );
769 SwStyleNameMapper::GetSpecialExtraUIName(const OUString
& rExtraProgName
)
771 return lcl_GetSpecialExtraName( rExtraProgName
, false );
774 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */