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