LCOV - code coverage report
Current view: top level - sw/source/core/doc - SwStyleNameMapper.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 287 298 96.3 %
Date: 2014-04-11 Functions: 41 42 97.6 %
Legend: Lines: hit not hit

          Line data    Source code
       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 <tools/resmgr.hxx>
      22             : #include <poolfmt.hxx>
      23             : #include <rcid.hrc>
      24             : 
      25             : #ifdef _NEED_TO_DEBUG_MAPPING
      26             : #include <stdlib.h>
      27             : #endif
      28             : 
      29             : extern ResMgr* pSwResMgr;
      30             : // Initialise UI names to 0
      31             : ::std::vector<OUString> *SwStyleNameMapper::pTextUINameArray = 0,
      32             :                 *SwStyleNameMapper::pListsUINameArray = 0,
      33             :                 *SwStyleNameMapper::pExtraUINameArray = 0,
      34             :                 *SwStyleNameMapper::pRegisterUINameArray = 0,
      35             :                 *SwStyleNameMapper::pDocUINameArray = 0,
      36             :                 *SwStyleNameMapper::pHTMLUINameArray = 0,
      37             :                 *SwStyleNameMapper::pFrmFmtUINameArray = 0,
      38             :                 *SwStyleNameMapper::pChrFmtUINameArray = 0,
      39             :                 *SwStyleNameMapper::pHTMLChrFmtUINameArray = 0,
      40             :                 *SwStyleNameMapper::pPageDescUINameArray = 0,
      41             :                 *SwStyleNameMapper::pNumRuleUINameArray = 0,
      42             : 
      43             : // Initialise programmatic names to 0
      44             :                 *SwStyleNameMapper::pTextProgNameArray = 0,
      45             :                 *SwStyleNameMapper::pListsProgNameArray = 0,
      46             :                 *SwStyleNameMapper::pExtraProgNameArray = 0,
      47             :                 *SwStyleNameMapper::pRegisterProgNameArray = 0,
      48             :                 *SwStyleNameMapper::pDocProgNameArray = 0,
      49             :                 *SwStyleNameMapper::pHTMLProgNameArray = 0,
      50             :                 *SwStyleNameMapper::pFrmFmtProgNameArray = 0,
      51             :                 *SwStyleNameMapper::pChrFmtProgNameArray = 0,
      52             :                 *SwStyleNameMapper::pHTMLChrFmtProgNameArray = 0,
      53             :                 *SwStyleNameMapper::pPageDescProgNameArray = 0,
      54             :                 *SwStyleNameMapper::pNumRuleProgNameArray = 0;
      55             : 
      56             : NameToIdHash    *SwStyleNameMapper::pParaUIMap = 0,
      57             :                 *SwStyleNameMapper::pCharUIMap = 0,
      58             :                 *SwStyleNameMapper::pPageUIMap = 0,
      59             :                 *SwStyleNameMapper::pFrameUIMap = 0,
      60             :                 *SwStyleNameMapper::pNumRuleUIMap = 0,
      61             : 
      62             :                 *SwStyleNameMapper::pParaProgMap = 0,
      63             :                 *SwStyleNameMapper::pCharProgMap = 0,
      64             :                 *SwStyleNameMapper::pPageProgMap = 0,
      65             :                 *SwStyleNameMapper::pFrameProgMap = 0,
      66             :                 *SwStyleNameMapper::pNumRuleProgMap = 0;
      67             : 
      68             : // SwTableEntry so we can pass the length to the String CTOR
      69             : struct SwTableEntry
      70             : {
      71             :     sal_uInt8 nLength;
      72             :     const sal_Char *pChar;
      73             : };
      74             : 
      75             : namespace
      76             : {
      77             : 
      78             : #define ENTRY( s ) { sizeof (s)-1, s }
      79             : 
      80             : // Hard coded Programmatic Name tables
      81             : const struct SwTableEntry TextProgNameTable [] =
      82             : {
      83             :     ENTRY( "Standard" ), // RES_POOLCOLL_STANDARD
      84             :     ENTRY( "Text body" ),
      85             :     ENTRY( "First line indent" ),
      86             :     ENTRY( "Hanging indent" ),
      87             :     ENTRY( "Text body indent" ),
      88             :     ENTRY( "Salutation" ),
      89             :     ENTRY( "Signature" ),
      90             :     ENTRY( "List Indent" ), // RES_POOLCOLL_CONFRONTATION
      91             :     ENTRY( "Marginalia" ),
      92             :     ENTRY( "Heading" ),
      93             :     ENTRY( "Heading 1" ),
      94             :     ENTRY( "Heading 2" ),
      95             :     ENTRY( "Heading 3" ),
      96             :     ENTRY( "Heading 4" ),
      97             :     ENTRY( "Heading 5" ),
      98             :     ENTRY( "Heading 6" ),
      99             :     ENTRY( "Heading 7" ),
     100             :     ENTRY( "Heading 8" ),
     101             :     ENTRY( "Heading 9" ),
     102             :     ENTRY( "Heading 10" ), // RES_POOLCOLL_TEXT_END
     103             :     { 0, NULL }
     104             : };
     105             : 
     106             : const struct SwTableEntry ListsProgNameTable [] =
     107             : {
     108             :     ENTRY( "List" ), // STR_POCO_PRGM_NUMBUL_BASE
     109             :     ENTRY( "Numbering 1 Start" ), // STR_POCO_PRGM_NUM_LEVEL1S
     110             :     ENTRY( "Numbering 1" ),
     111             :     ENTRY( "Numbering 1 End" ),
     112             :     ENTRY( "Numbering 1 Cont." ),
     113             :     ENTRY( "Numbering 2 Start" ),
     114             :     ENTRY( "Numbering 2" ),
     115             :     ENTRY( "Numbering 2 End" ),
     116             :     ENTRY( "Numbering 2 Cont." ),
     117             :     ENTRY( "Numbering 3 Start" ),
     118             :     ENTRY( "Numbering 3" ),
     119             :     ENTRY( "Numbering 3 End" ),
     120             :     ENTRY( "Numbering 3 Cont." ),
     121             :     ENTRY( "Numbering 4 Start" ),
     122             :     ENTRY( "Numbering 4" ),
     123             :     ENTRY( "Numbering 4 End" ),
     124             :     ENTRY( "Numbering 4 Cont." ),
     125             :     ENTRY( "Numbering 5 Start" ),
     126             :     ENTRY( "Numbering 5" ),
     127             :     ENTRY( "Numbering 5 End" ),
     128             :     ENTRY( "Numbering 5 Cont." ),
     129             :     ENTRY( "List 1 Start" ),
     130             :     ENTRY( "List 1" ),
     131             :     ENTRY( "List 1 End" ),
     132             :     ENTRY( "List 1 Cont." ),
     133             :     ENTRY( "List 2 Start" ),
     134             :     ENTRY( "List 2" ),
     135             :     ENTRY( "List 2 End" ),
     136             :     ENTRY( "List 2 Cont." ),
     137             :     ENTRY( "List 3 Start" ),
     138             :     ENTRY( "List 3" ),
     139             :     ENTRY( "List 3 End" ),
     140             :     ENTRY( "List 3 Cont." ),
     141             :     ENTRY( "List 4 Start" ),
     142             :     ENTRY( "List 4" ),
     143             :     ENTRY( "List 4 End" ),
     144             :     ENTRY( "List 4 Cont." ),
     145             :     ENTRY( "List 5 Start" ),
     146             :     ENTRY( "List 5" ),
     147             :     ENTRY( "List 5 End" ),
     148             :     ENTRY( "List 5 Cont." ), // STR_POCO_PRGM_BUL_NONUM5
     149             :     { 0, NULL }
     150             : };
     151             : 
     152             : const struct SwTableEntry ExtraProgNameTable [] =
     153             : {
     154             :     ENTRY( "Header" ), // RES_POOLCOLL_EXTRA_BEGIN
     155             :     ENTRY( "Header left" ),
     156             :     ENTRY( "Header right" ),
     157             :     ENTRY( "Footer" ),
     158             :     ENTRY( "Footer left" ),
     159             :     ENTRY( "Footer right" ),
     160             :     ENTRY( "Table Contents" ),
     161             :     ENTRY( "Table Heading" ),
     162             :     ENTRY( "Caption" ),
     163             :     ENTRY( "Illustration" ),
     164             :     ENTRY( "Table" ),
     165             :     ENTRY( "Text" ),
     166             :     ENTRY( "Frame contents" ),
     167             :     ENTRY( "Footnote" ),
     168             :     ENTRY( "Addressee" ),
     169             :     ENTRY( "Sender" ),
     170             :     ENTRY( "Endnote" ),
     171             :     ENTRY( "Drawing" ), // RES_POOLCOLL_LABEL_DRAWING
     172             :     { 0, NULL }
     173             : };
     174             : 
     175             : const struct SwTableEntry RegisterProgNameTable [] =
     176             : {
     177             :     ENTRY( "Index" ), // STR_POCO_PRGM_REGISTER_BASE
     178             :     ENTRY( "Index Heading" ), // STR_POCO_PRGM_TOX_IDXH
     179             :     ENTRY( "Index 1" ),
     180             :     ENTRY( "Index 2" ),
     181             :     ENTRY( "Index 3" ),
     182             :     ENTRY( "Index Separator" ),
     183             :     ENTRY( "Contents Heading" ),
     184             :     ENTRY( "Contents 1" ),
     185             :     ENTRY( "Contents 2" ),
     186             :     ENTRY( "Contents 3" ),
     187             :     ENTRY( "Contents 4" ),
     188             :     ENTRY( "Contents 5" ),
     189             :     ENTRY( "User Index Heading" ),
     190             :     ENTRY( "User Index 1" ),
     191             :     ENTRY( "User Index 2" ),
     192             :     ENTRY( "User Index 3" ),
     193             :     ENTRY( "User Index 4" ),
     194             :     ENTRY( "User Index 5" ),
     195             :     ENTRY( "Contents 6" ),
     196             :     ENTRY( "Contents 7" ),
     197             :     ENTRY( "Contents 8" ),
     198             :     ENTRY( "Contents 9" ),
     199             :     ENTRY( "Contents 10" ),
     200             :     ENTRY( "Illustration Index Heading" ),
     201             :     ENTRY( "Illustration Index 1" ),
     202             :     ENTRY( "Object index heading" ),
     203             :     ENTRY( "Object index 1" ),
     204             :     ENTRY( "Table index heading" ),
     205             :     ENTRY( "Table index 1" ),
     206             :     ENTRY( "Bibliography Heading" ),
     207             :     ENTRY( "Bibliography 1" ),
     208             :     ENTRY( "User Index 6" ),
     209             :     ENTRY( "User Index 7" ),
     210             :     ENTRY( "User Index 8" ),
     211             :     ENTRY( "User Index 9" ),
     212             :     ENTRY( "User Index 10" ), // STR_POCO_PRGM_TOX_USER10
     213             :     { 0, NULL }
     214             : };
     215             : 
     216             : const struct SwTableEntry DocProgNameTable [] =
     217             : {
     218             :     ENTRY( "Title" ), // STR_POCO_PRGM_DOC_TITEL
     219             :     ENTRY( "Subtitle" ),
     220             :     { 0, NULL }
     221             : };
     222             : 
     223             : const struct SwTableEntry HTMLProgNameTable [] =
     224             : {
     225             :     ENTRY( "Quotations" ),
     226             :     ENTRY( "Preformatted Text" ),
     227             :     ENTRY( "Horizontal Line" ),
     228             :     ENTRY( "List Contents" ),
     229             :     ENTRY( "List Heading" ), // STR_POCO_PRGM_HTML_DT
     230             :     { 0, NULL }
     231             : };
     232             : 
     233             : const struct SwTableEntry FrmFmtProgNameTable [] =
     234             : {
     235             :     ENTRY( "Frame" ), // RES_POOLFRM_FRAME
     236             :     ENTRY( "Graphics" ),
     237             :     ENTRY( "OLE" ),
     238             :     ENTRY( "Formula" ),
     239             :     ENTRY( "Marginalia" ),
     240             :     ENTRY( "Watermark" ),
     241             :     ENTRY( "Labels" ), // RES_POOLFRM_LABEL
     242             :     { 0, NULL }
     243             : };
     244             : 
     245             : const struct SwTableEntry ChrFmtProgNameTable [] =
     246             : {
     247             :     ENTRY( "Footnote Symbol" ), // RES_POOLCHR_FOOTNOTE
     248             :     ENTRY( "Page Number" ),
     249             :     ENTRY( "Caption characters" ),
     250             :     ENTRY( "Drop Caps" ),
     251             :     ENTRY( "Numbering Symbols" ),
     252             :     ENTRY( "Bullet Symbols" ),
     253             :     ENTRY( "Internet link" ),
     254             :     ENTRY( "Visited Internet Link" ),
     255             :     ENTRY( "Placeholder" ),
     256             :     ENTRY( "Index Link" ),
     257             :     ENTRY( "Endnote Symbol" ),
     258             :     ENTRY( "Line numbering" ),
     259             :     ENTRY( "Main index entry" ),
     260             :     ENTRY( "Footnote anchor" ),
     261             :     ENTRY( "Endnote anchor" ),
     262             :     ENTRY( "Rubies" ), // RES_POOLCHR_RUBYTEXT
     263             :     ENTRY( "Vertical Numbering Symbols" ), // RES_POOLCHR_VERT_NUMBER
     264             :     { 0, NULL }
     265             : };
     266             : 
     267             : const struct SwTableEntry HTMLChrFmtProgNameTable [] =
     268             : {
     269             :     ENTRY( "Emphasis" ), // RES_POOLCHR_HTML_EMPHASIS
     270             :     ENTRY( "Citation" ),
     271             :     ENTRY( "Strong Emphasis" ),
     272             :     ENTRY( "Source Text" ),
     273             :     ENTRY( "Example" ),
     274             :     ENTRY( "User Entry" ),
     275             :     ENTRY( "Variable" ),
     276             :     ENTRY( "Definition" ),
     277             :     ENTRY( "Teletype" ), // RES_POOLCHR_HTML_TELETYPE
     278             :     { 0, NULL }
     279             : };
     280             : 
     281             : const struct SwTableEntry PageDescProgNameTable [] =
     282             : {
     283             :     ENTRY( "Standard" ), // STR_POOLPAGE_PRGM_STANDARD
     284             :     ENTRY( "First Page" ),
     285             :     ENTRY( "Left Page" ),
     286             :     ENTRY( "Right Page" ),
     287             :     ENTRY( "Envelope" ),
     288             :     ENTRY( "Index" ),
     289             :     ENTRY( "HTML" ),
     290             :     ENTRY( "Footnote" ),
     291             :     ENTRY( "Endnote" ), // STR_POOLPAGE_PRGM_ENDNOTE
     292             :     ENTRY( "Landscape" ),
     293             :     { 0, NULL }
     294             : };
     295             : 
     296             : const struct SwTableEntry NumRuleProgNameTable [] =
     297             : {
     298             :     ENTRY( "Numbering 1" ), // STR_POOLNUMRULE_PRGM_NUM1
     299             :     ENTRY( "Numbering 2" ),
     300             :     ENTRY( "Numbering 3" ),
     301             :     ENTRY( "Numbering 4" ),
     302             :     ENTRY( "Numbering 5" ),
     303             :     ENTRY( "List 1" ),
     304             :     ENTRY( "List 2" ),
     305             :     ENTRY( "List 3" ),
     306             :     ENTRY( "List 4" ),
     307             :     ENTRY( "List 5" ), // STR_POOLNUMRULE_PRGM_BUL5
     308             :     { 0, NULL }
     309             : };
     310             : #undef ENTRY
     311             : 
     312             : static ::std::vector<OUString>*
     313         343 : lcl_NewUINameArray(sal_uInt16 nStt, sal_uInt16 const nEnd)
     314             : {
     315         343 :     ::std::vector<OUString> *const pNameArray = new ::std::vector<OUString>;
     316         343 :     pNameArray->reserve(nEnd - nStt);
     317        6455 :     while( nStt < nEnd )
     318             :     {
     319        5769 :         const ResId aRId( nStt, *pSwResMgr );
     320        5769 :         pNameArray->push_back(OUString(aRId));
     321        5769 :         ++nStt;
     322             :     }
     323         343 :     return pNameArray;
     324             : }
     325             : 
     326             : static ::std::vector<OUString>*
     327         326 : lcl_NewProgNameArray(const SwTableEntry *pTable, sal_uInt8 const nCount)
     328             : {
     329         326 :     ::std::vector<OUString> *const pProgNameArray = new ::std::vector<OUString>;
     330         326 :     pProgNameArray->reserve(nCount);
     331        6114 :     while (pTable->nLength)
     332             :     {
     333             :         pProgNameArray->push_back(OUString(
     334        5462 :                 pTable->pChar, pTable->nLength, RTL_TEXTENCODING_ASCII_US));
     335        5462 :         pTable++;
     336             :     }
     337         326 :     return pProgNameArray;
     338             : }
     339             : 
     340             : static OUString
     341        1284 : lcl_GetSpecialExtraName(const OUString& rExtraName, const bool bIsUIName )
     342             : {
     343             :     const ::std::vector<OUString>& rExtraArr = bIsUIName
     344             :         ? SwStyleNameMapper::GetExtraUINameArray()
     345        1284 :         : SwStyleNameMapper::GetExtraProgNameArray();
     346             :     static const sal_uInt16 nIds[] =
     347             :     {
     348             :         RES_POOLCOLL_LABEL_DRAWING - RES_POOLCOLL_EXTRA_BEGIN,
     349             :         RES_POOLCOLL_LABEL_ABB - RES_POOLCOLL_EXTRA_BEGIN,
     350             :         RES_POOLCOLL_LABEL_TABLE - RES_POOLCOLL_EXTRA_BEGIN,
     351             :         RES_POOLCOLL_LABEL_FRAME- RES_POOLCOLL_EXTRA_BEGIN,
     352             :         0
     353             :     };
     354             :     const sal_uInt16 * pIds;
     355        3445 :     for ( pIds = nIds; *pIds; ++pIds)
     356             :     {
     357        3352 :         if (rExtraName == rExtraArr[ *pIds ])
     358             :         {
     359             :             return bIsUIName
     360          90 :                 ? SwStyleNameMapper::GetExtraProgNameArray()[*pIds]
     361        1281 :                 : SwStyleNameMapper::GetExtraUINameArray()[*pIds];
     362             :         }
     363             :     }
     364          93 :     return rExtraName;
     365             : }
     366             : 
     367      106844 : static bool lcl_SuffixIsUser(const OUString & rString)
     368             : {
     369      106844 :     const sal_Unicode *pChar = rString.getStr();
     370      106844 :     sal_Int32 nLen = rString.getLength();
     371      106844 :     bool bRet = false;
     372      191801 :     if( nLen > 8 &&
     373       90322 :         pChar[nLen-7] == ' ' &&
     374        5789 :         pChar[nLen-6] == '(' &&
     375         424 :         pChar[nLen-5] == 'u' &&
     376           0 :         pChar[nLen-4] == 's' &&
     377           0 :         pChar[nLen-3] == 'e' &&
     378           0 :         pChar[nLen-2] == 'r' &&
     379           0 :         pChar[nLen-1] == ')' )
     380           0 :         bRet = true;
     381      106844 :     return bRet;
     382             : }
     383             : 
     384       87082 : static void lcl_CheckSuffixAndDelete(OUString & rString)
     385             : {
     386       87082 :     if (lcl_SuffixIsUser(rString))
     387             :     {
     388           0 :         rString = rString.copy(0, rString.getLength() - 7);
     389             :     }
     390       87082 : }
     391             : }
     392             : 
     393             : #ifdef _NEED_TO_DEBUG_MAPPING
     394             : void SwStyleNameMapper::testNameTable( SwGetPoolIdFromName const nFamily, sal_uInt16 const nStartIndex, sal_uInt16 const nEndIndex )
     395             : {
     396             :     sal_uInt16 nIndex;
     397             :     sal_uInt16 nId;
     398             : 
     399             :     for ( nIndex = 0, nId = nStartIndex ; nId < nEndIndex ; nId++,nIndex++ )
     400             :     {
     401             :         OUString aString, bString;
     402             :         FillUIName ( nId, aString );
     403             :         bString = GetProgName ( nFamily, aString );
     404             :         sal_uInt16 nNewId = GetPoolIdFromProgName ( bString, nFamily );
     405             :         FillProgName ( nNewId, aString );
     406             :         bString = GetUIName ( aString, nFamily );
     407             :         nNewId = GetPoolIdFromUIName ( aString, nFamily );
     408             :         if ( nNewId != nId )
     409             :             abort();
     410             :     }
     411             : }
     412             : #endif
     413             : 
     414      567551 : const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlags, bool bProgName )
     415             : {
     416      567551 :     NameToIdHash *pHash = 0;
     417      567551 :     const ::std::vector<OUString> *pStrings = 0;
     418             : 
     419      567551 :     switch ( eFlags )
     420             :     {
     421             :         case nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL:
     422             :         {
     423             :             sal_uInt16 nIndex;
     424             :             sal_uInt16 nId;
     425             : 
     426      341565 :             pHash = bProgName ? pParaProgMap : pParaUIMap;
     427      341565 :             if ( !pHash )
     428             :             {
     429             :                 pHash = new NameToIdHash ( RES_POOLCOLL_TEXT_END - RES_POOLCOLL_TEXT_BEGIN +
     430             :                                            RES_POOLCOLL_LISTS_END - RES_POOLCOLL_LISTS_BEGIN +
     431             :                                            RES_POOLCOLL_EXTRA_END - RES_POOLCOLL_EXTRA_BEGIN +
     432             :                                            RES_POOLCOLL_REGISTER_END - RES_POOLCOLL_REGISTER_BEGIN +
     433             :                                            RES_POOLCOLL_DOC_END - RES_POOLCOLL_DOC_BEGIN +
     434          69 :                                            RES_POOLCOLL_HTML_END - RES_POOLCOLL_HTML_BEGIN );
     435          69 :                 pStrings = bProgName ? &GetTextProgNameArray() : &GetTextUINameArray();
     436        1449 :                 for ( nIndex = 0, nId = RES_POOLCOLL_TEXT_BEGIN ; nId < RES_POOLCOLL_TEXT_END ; nId++,nIndex++ )
     437        1380 :                     (*pHash)[((*pStrings)[nIndex])] = nId;
     438          69 :                 pStrings = bProgName ? &GetListsProgNameArray() : &GetListsUINameArray();
     439        2898 :                 for ( nIndex = 0, nId = RES_POOLCOLL_LISTS_BEGIN ; nId < RES_POOLCOLL_LISTS_END ; nId++,nIndex++ )
     440        2829 :                     (*pHash)[((*pStrings)[nIndex])] = nId;
     441          69 :                 pStrings = bProgName ? &GetExtraProgNameArray() : &GetExtraUINameArray();
     442        1311 :                 for ( nIndex = 0, nId = RES_POOLCOLL_EXTRA_BEGIN ; nId < RES_POOLCOLL_EXTRA_END ; nId++,nIndex++ )
     443        1242 :                     (*pHash)[((*pStrings)[nIndex])] = nId;
     444          69 :                 pStrings = bProgName ? &GetRegisterProgNameArray() : &GetRegisterUINameArray();
     445        2553 :                 for ( nIndex = 0, nId = RES_POOLCOLL_REGISTER_BEGIN ; nId < RES_POOLCOLL_REGISTER_END ; nId++,nIndex++ )
     446        2484 :                     (*pHash)[((*pStrings)[nIndex])] = nId;
     447          69 :                 pStrings = bProgName ? &GetDocProgNameArray() : &GetDocUINameArray();
     448         207 :                 for ( nIndex = 0, nId = RES_POOLCOLL_DOC_BEGIN ; nId < RES_POOLCOLL_DOC_END ; nId++,nIndex++ )
     449         138 :                     (*pHash)[((*pStrings)[nIndex])] = nId;
     450          69 :                 pStrings = bProgName ? &GetHTMLProgNameArray() : &GetHTMLUINameArray();
     451         414 :                 for ( nIndex = 0, nId = RES_POOLCOLL_HTML_BEGIN ; nId < RES_POOLCOLL_HTML_END ; nId++,nIndex++ )
     452         345 :                     (*pHash)[((*pStrings)[nIndex])] = nId;
     453             : 
     454          69 :                 if ( bProgName )
     455          34 :                     pParaProgMap = pHash;
     456             :                 else
     457          35 :                     pParaUIMap = pHash;
     458             :             }
     459             :         }
     460      341565 :         break;
     461             :         case nsSwGetPoolIdFromName::GET_POOLID_CHRFMT:
     462             :         {
     463      100749 :             pHash = bProgName ? pCharProgMap : pCharUIMap;
     464      100749 :             if ( !pHash )
     465             :             {
     466             :                 sal_uInt16 nIndex;
     467             :                 sal_uInt16 nId;
     468             : 
     469             :                 pHash = new NameToIdHash ( RES_POOLCHR_NORMAL_END - RES_POOLCHR_NORMAL_BEGIN +
     470          49 :                                            RES_POOLCHR_HTML_END - RES_POOLCHR_HTML_BEGIN );
     471          49 :                 pStrings = bProgName ? &GetChrFmtProgNameArray() : &GetChrFmtUINameArray();
     472         882 :                 for ( nIndex = 0, nId = RES_POOLCHR_NORMAL_BEGIN ; nId < RES_POOLCHR_NORMAL_END ; nId++,nIndex++ )
     473         833 :                     (*pHash)[((*pStrings)[nIndex])] = nId;
     474          49 :                 pStrings = bProgName ? &GetHTMLChrFmtProgNameArray() : &GetHTMLChrFmtUINameArray();
     475         490 :                 for ( nIndex = 0, nId = RES_POOLCHR_HTML_BEGIN ; nId < RES_POOLCHR_HTML_END ; nId++,nIndex++ )
     476         441 :                     (*pHash)[((*pStrings)[nIndex])] = nId;
     477          49 :                 if (bProgName )
     478          25 :                     pCharProgMap = pHash;
     479             :                 else
     480          24 :                     pCharUIMap = pHash;
     481             :             }
     482             :         }
     483      100749 :         break;
     484             :         case nsSwGetPoolIdFromName::GET_POOLID_FRMFMT:
     485             :         {
     486        6472 :             pHash = bProgName ? pFrameProgMap : pFrameUIMap;
     487        6472 :             if ( !pHash )
     488             :             {
     489          44 :                 pHash = new NameToIdHash ( RES_POOLFRM_END - RES_POOLFRM_BEGIN );
     490          44 :                 pStrings = bProgName ? &GetFrmFmtProgNameArray() : &GetFrmFmtUINameArray();
     491         352 :                 for ( sal_uInt16 nIndex=0,nId = RES_POOLFRM_BEGIN ; nId < RES_POOLFRM_END ; nId++,nIndex++ )
     492         308 :                     (*pHash)[((*pStrings)[nIndex])] = nId;
     493          44 :                 if ( bProgName )
     494          22 :                     pFrameProgMap = pHash;
     495             :                 else
     496          22 :                     pFrameUIMap = pHash;
     497             :             }
     498             :         }
     499        6472 :         break;
     500             :         case nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC:
     501             :         {
     502       16046 :             pHash = bProgName ? pPageProgMap : pPageUIMap;
     503       16046 :             if ( !pHash )
     504             :             {
     505          51 :                 pHash = new NameToIdHash ( RES_POOLPAGE_END - RES_POOLPAGE_BEGIN );
     506          51 :                 pStrings = bProgName ? &GetPageDescProgNameArray() : &GetPageDescUINameArray();
     507         561 :                 for ( sal_uInt16 nIndex=0,nId = RES_POOLPAGE_BEGIN ; nId < RES_POOLPAGE_END ; nId++,nIndex++ )
     508         510 :                     (*pHash)[((*pStrings)[nIndex])] = nId;
     509          51 :                 if ( bProgName )
     510          26 :                     pPageProgMap = pHash;
     511             :                 else
     512          25 :                     pPageUIMap = pHash;
     513             :             }
     514             :         }
     515       16046 :         break;
     516             :         case nsSwGetPoolIdFromName::GET_POOLID_NUMRULE:
     517             :         {
     518      102719 :             pHash = bProgName ? pNumRuleProgMap : pNumRuleUIMap;
     519      102719 :             if ( !pHash )
     520             :             {
     521          47 :                 pHash = new NameToIdHash ( RES_POOLNUMRULE_END - RES_POOLNUMRULE_BEGIN );
     522          47 :                 pStrings = bProgName ? &GetNumRuleProgNameArray() : &GetNumRuleUINameArray();
     523         517 :                 for ( sal_uInt16 nIndex=0,nId = RES_POOLNUMRULE_BEGIN ; nId < RES_POOLNUMRULE_END ; nId++,nIndex++ )
     524             :                 {
     525         470 :                     (*pHash)[((*pStrings)[nIndex])] = nId;
     526             :                 }
     527          47 :                 if ( bProgName )
     528          23 :                     pNumRuleProgMap = pHash;
     529             :                 else
     530          24 :                     pNumRuleUIMap = pHash;
     531             :             }
     532             :         }
     533      102719 :         break;
     534             :     }
     535             : 
     536             : #ifdef _NEED_TO_DEBUG_MAPPING
     537             :     static bool bTested = false;
     538             :     if ( !bTested )
     539             :     {
     540             :         bTested = true;
     541             : 
     542             :         testNameTable( nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, RES_POOLCOLL_TEXT_BEGIN, RES_POOLCOLL_TEXT_END );
     543             :         testNameTable( nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, RES_POOLCOLL_LISTS_BEGIN, RES_POOLCOLL_LISTS_END );
     544             :         testNameTable( nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, RES_POOLCOLL_EXTRA_BEGIN, RES_POOLCOLL_EXTRA_END );
     545             :         testNameTable( nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, RES_POOLCOLL_REGISTER_BEGIN, RES_POOLCOLL_REGISTER_END );
     546             :         testNameTable( nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, RES_POOLCOLL_DOC_BEGIN, RES_POOLCOLL_DOC_END );
     547             :         testNameTable( nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, RES_POOLCOLL_HTML_BEGIN, RES_POOLCOLL_HTML_END );
     548             :         testNameTable( nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, RES_POOLCHR_NORMAL_BEGIN, RES_POOLCHR_NORMAL_END );
     549             :         testNameTable( nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, RES_POOLCHR_HTML_BEGIN, RES_POOLCHR_HTML_END );
     550             :         testNameTable( nsSwGetPoolIdFromName::GET_POOLID_FRMFMT, RES_POOLFRM_BEGIN, RES_POOLFRM_END );
     551             :         testNameTable( nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC, RES_POOLPAGE_BEGIN, RES_POOLPAGE_END );
     552             :         testNameTable( nsSwGetPoolIdFromName::GET_POOLID_NUMRULE, RES_POOLNUMRULE_BEGIN, RES_POOLNUMRULE_END );
     553             :     }
     554             : #endif
     555      567551 :     return *pHash;
     556             : }
     557             : 
     558             : // This gets the UI name from the programmatic name
     559          61 : const OUString& SwStyleNameMapper::GetUIName(const OUString& rName,
     560             :                                              SwGetPoolIdFromName const eFlags)
     561             : {
     562          61 :     sal_uInt16 nId = GetPoolIdFromProgName ( rName, eFlags );
     563          61 :     return nId != USHRT_MAX ? GetUIName( nId, rName ) : rName;
     564             : }
     565             : 
     566             : // Get the programmatic name from the UI name
     567         252 : const OUString& SwStyleNameMapper::GetProgName(
     568             :         const OUString& rName, SwGetPoolIdFromName const eFlags)
     569             : {
     570         252 :     sal_uInt16 nId = GetPoolIdFromUIName ( rName, eFlags );
     571         252 :     return nId != USHRT_MAX ? GetProgName( nId, rName ) : rName;
     572             : }
     573             : 
     574             : // Get the programmatic name from the UI name in rName and put it into rFillName
     575       59865 : void SwStyleNameMapper::FillProgName(
     576             :         const OUString& rName, OUString& rFillName,
     577             :         SwGetPoolIdFromName const eFlags, bool const bDisambiguate)
     578             : {
     579       59865 :     sal_uInt16 nId = GetPoolIdFromUIName ( rName, eFlags );
     580       59865 :     if ( bDisambiguate && nId == USHRT_MAX )
     581             :     {
     582             :         // rName isn't in our UI name table...check if it's in the programmatic one
     583       19762 :         nId = GetPoolIdFromProgName ( rName, eFlags );
     584             : 
     585       19762 :         rFillName = rName;
     586       39524 :         if (nId == USHRT_MAX )
     587             :         {
     588             :             // It isn't ...make sure the suffix isn't already " (user)"...if it is,
     589             :             // we need to add another one
     590       19762 :             if (lcl_SuffixIsUser(rFillName))
     591           0 :                 rFillName += " (user)";
     592             :         }
     593             :         else
     594             :         {
     595             :             // It's in the programmatic name table...append suffix
     596           0 :             rFillName += " (user)";
     597             :         }
     598             :     }
     599             :     else
     600             :     {
     601             :         // If we aren't trying to disambiguate, then just do a normal fill
     602       40103 :         fillNameFromId(nId, rFillName, true);
     603             :     }
     604       59865 : }
     605             : 
     606             : // Get the UI name from the programmatic name in rName and put it into rFillName
     607      147857 : void SwStyleNameMapper::FillUIName(
     608             :         const OUString& rName, OUString& rFillName,
     609             :         SwGetPoolIdFromName const eFlags, bool const bDisambiguate)
     610             : {
     611      147857 :     sal_uInt16 nId = GetPoolIdFromProgName ( rName, eFlags );
     612      147857 :     if ( bDisambiguate && nId == USHRT_MAX )
     613             :     {
     614       87082 :         rFillName = rName;
     615             :         // rName isn't in our Prog name table...check if it has a " (user)" suffix, if so remove it
     616       87082 :         lcl_CheckSuffixAndDelete ( rFillName );
     617             :     }
     618             :     else
     619             :     {
     620             :         // If we aren't trying to disambiguate, then just do a normal fill
     621       60775 :         fillNameFromId(nId, rFillName, false);
     622             :     }
     623      147857 : }
     624             : 
     625      115499 : const OUString& SwStyleNameMapper::getNameFromId(
     626             :         sal_uInt16 const nId, const OUString& rFillName, bool const bProgName)
     627             : {
     628      115499 :     sal_uInt16 nStt = 0;
     629      115499 :     const ::std::vector<OUString>* pStrArr = 0;
     630             : 
     631      115499 :     switch( (USER_FMT | COLL_GET_RANGE_BITS | POOLGRP_NOCOLLID) & nId )
     632             :     {
     633             :     case COLL_TEXT_BITS:
     634       63084 :         if( RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END )
     635             :         {
     636       63084 :             pStrArr = bProgName ? &GetTextProgNameArray() : &GetTextUINameArray();
     637       63084 :             nStt = RES_POOLCOLL_TEXT_BEGIN;
     638             :         }
     639       63084 :         break;
     640             :     case COLL_LISTS_BITS:
     641        8965 :         if( RES_POOLCOLL_LISTS_BEGIN <= nId && nId < RES_POOLCOLL_LISTS_END )
     642             :         {
     643        8965 :             pStrArr = bProgName ? &GetListsProgNameArray() : &GetListsUINameArray();
     644        8965 :             nStt = RES_POOLCOLL_LISTS_BEGIN;
     645             :         }
     646        8965 :         break;
     647             :     case COLL_EXTRA_BITS:
     648        9610 :         if( RES_POOLCOLL_EXTRA_BEGIN <= nId && nId < RES_POOLCOLL_EXTRA_END )
     649             :         {
     650        9610 :             pStrArr = bProgName ? &GetExtraProgNameArray() : &GetExtraUINameArray();
     651        9610 :             nStt = RES_POOLCOLL_EXTRA_BEGIN;
     652             :         }
     653        9610 :         break;
     654             :     case COLL_REGISTER_BITS:
     655        9337 :         if( RES_POOLCOLL_REGISTER_BEGIN <= nId && nId < RES_POOLCOLL_REGISTER_END )
     656             :         {
     657        9337 :             pStrArr = bProgName ? &GetRegisterProgNameArray() : &GetRegisterUINameArray();
     658        9337 :             nStt = RES_POOLCOLL_REGISTER_BEGIN;
     659             :         }
     660        9337 :         break;
     661             :     case COLL_DOC_BITS:
     662        1324 :         if( RES_POOLCOLL_DOC_BEGIN <= nId && nId < RES_POOLCOLL_DOC_END )
     663             :         {
     664        1324 :             pStrArr = bProgName ? &GetDocProgNameArray() : &GetDocUINameArray();
     665        1324 :             nStt = RES_POOLCOLL_DOC_BEGIN;
     666             :         }
     667        1324 :         break;
     668             :     case COLL_HTML_BITS:
     669        1003 :         if( RES_POOLCOLL_HTML_BEGIN <= nId && nId < RES_POOLCOLL_HTML_END )
     670             :         {
     671        1003 :             pStrArr = bProgName ? &GetHTMLProgNameArray() : &GetHTMLUINameArray();
     672        1003 :             nStt = RES_POOLCOLL_HTML_BEGIN;
     673             :         }
     674        1003 :         break;
     675             :     case POOLGRP_CHARFMT:
     676       12980 :         if( RES_POOLCHR_NORMAL_BEGIN <= nId && nId < RES_POOLCHR_NORMAL_END )
     677             :         {
     678        9152 :             pStrArr = bProgName ? &GetChrFmtProgNameArray() : &GetChrFmtUINameArray();
     679        9152 :             nStt = RES_POOLCHR_NORMAL_BEGIN;
     680             :         }
     681        3828 :         else if( RES_POOLCHR_HTML_BEGIN <= nId && nId < RES_POOLCHR_HTML_END )
     682             :         {
     683        3828 :             pStrArr = bProgName ? &GetHTMLChrFmtProgNameArray() : &GetHTMLChrFmtUINameArray();
     684        3828 :             nStt = RES_POOLCHR_HTML_BEGIN;
     685             :         }
     686       12980 :         break;
     687             :     case POOLGRP_FRAMEFMT:
     688        2000 :         if( RES_POOLFRM_BEGIN <= nId && nId < RES_POOLFRM_END )
     689             :         {
     690        2000 :             pStrArr = bProgName ? &GetFrmFmtProgNameArray() : &GetFrmFmtUINameArray();
     691        2000 :             nStt = RES_POOLFRM_BEGIN;
     692             :         }
     693        2000 :         break;
     694             :     case POOLGRP_PAGEDESC:
     695        6761 :         if( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END )
     696             :         {
     697        6761 :             pStrArr = bProgName ? &GetPageDescProgNameArray() : &GetPageDescUINameArray();
     698        6761 :             nStt = RES_POOLPAGE_BEGIN;
     699             :         }
     700        6761 :         break;
     701             :     case POOLGRP_NUMRULE:
     702         435 :         if( RES_POOLNUMRULE_BEGIN <= nId && nId < RES_POOLNUMRULE_END )
     703             :         {
     704         435 :             pStrArr = bProgName ? &GetNumRuleProgNameArray() : &GetNumRuleUINameArray();
     705         435 :             nStt = RES_POOLNUMRULE_BEGIN;
     706             :         }
     707         435 :         break;
     708             :     }
     709      115499 :     return pStrArr ? pStrArr->operator[](nId - nStt) : rFillName;
     710             : }
     711             : 
     712      115352 : void SwStyleNameMapper::fillNameFromId(
     713             :         sal_uInt16 const nId, OUString& rFillName, bool bProgName)
     714             : {
     715      115352 :     rFillName = getNameFromId(nId, rFillName, bProgName);
     716      115352 : }
     717             : 
     718             : // Get the UI name from the pool ID
     719       14474 : void SwStyleNameMapper::FillUIName(sal_uInt16 const nId, OUString& rFillName)
     720             : {
     721       14474 :     fillNameFromId(nId, rFillName, false);
     722       14474 : }
     723             : 
     724             : // Get the UI name from the pool ID
     725         100 : const OUString& SwStyleNameMapper::GetUIName(
     726             :         sal_uInt16 const nId, const OUString& rName)
     727             : {
     728         100 :     return getNameFromId(nId, rName, false);
     729             : }
     730             : 
     731             : // Get the programmatic name from the pool ID
     732           0 : void SwStyleNameMapper::FillProgName(sal_uInt16 nId, OUString& rFillName)
     733             : {
     734           0 :     fillNameFromId(nId, rFillName, true);
     735           0 : }
     736             : 
     737             : // Get the programmatic name from the pool ID
     738             : const OUString&
     739          47 : SwStyleNameMapper::GetProgName(sal_uInt16 const nId, const OUString& rName)
     740             : {
     741          47 :     return getNameFromId(nId, rName, true);
     742             : }
     743             : 
     744             : // This gets the PoolId from the UI Name
     745      399871 : sal_uInt16 SwStyleNameMapper::GetPoolIdFromUIName(
     746             :         const OUString& rName, SwGetPoolIdFromName const eFlags)
     747             : {
     748      399871 :     const NameToIdHash & rHashMap = getHashTable ( eFlags, false );
     749      399871 :     NameToIdHash::const_iterator aIter = rHashMap.find(rName);
     750      399871 :     return aIter != rHashMap.end() ? (*aIter).second : USHRT_MAX;
     751             : }
     752             : 
     753             : // Get the Pool ID from the programmatic name
     754      167680 : sal_uInt16 SwStyleNameMapper::GetPoolIdFromProgName(
     755             :             const OUString& rName, SwGetPoolIdFromName const eFlags)
     756             : {
     757      167680 :     const NameToIdHash & rHashMap = getHashTable ( eFlags, true );
     758      167680 :     NameToIdHash::const_iterator aIter = rHashMap.find(rName);
     759      167680 :     return aIter != rHashMap.end() ? (*aIter).second : USHRT_MAX;
     760             : }
     761             : 
     762      105358 : const ::std::vector<OUString>& SwStyleNameMapper::GetTextUINameArray()
     763             : {
     764      105358 :     if (!pTextUINameArray)
     765             :         pTextUINameArray = lcl_NewUINameArray( RC_POOLCOLL_TEXT_BEGIN,
     766          35 :             RC_POOLCOLL_TEXT_BEGIN + (RES_POOLCOLL_TEXT_END - RES_POOLCOLL_TEXT_BEGIN) );
     767      105358 :     return *pTextUINameArray;
     768             : }
     769             : 
     770        8179 : const ::std::vector<OUString>& SwStyleNameMapper::GetListsUINameArray()
     771             : {
     772        8179 :     if (!pListsUINameArray)
     773             :         pListsUINameArray = lcl_NewUINameArray( RC_POOLCOLL_LISTS_BEGIN,
     774          35 :             RC_POOLCOLL_LISTS_BEGIN + (RES_POOLCOLL_LISTS_END - RES_POOLCOLL_LISTS_BEGIN) );
     775        8179 :     return *pListsUINameArray;
     776             : }
     777             : 
     778        8021 : const ::std::vector<OUString>& SwStyleNameMapper::GetExtraUINameArray()
     779             : {
     780        8021 :     if (!pExtraUINameArray)
     781             :         pExtraUINameArray = lcl_NewUINameArray( RC_POOLCOLL_EXTRA_BEGIN,
     782          35 :             RC_POOLCOLL_EXTRA_BEGIN + (RES_POOLCOLL_EXTRA_END - RES_POOLCOLL_EXTRA_BEGIN) );
     783        8021 :     return *pExtraUINameArray;
     784             : }
     785             : 
     786        8199 : const ::std::vector<OUString>& SwStyleNameMapper::GetRegisterUINameArray()
     787             : {
     788        8199 :     if (!pRegisterUINameArray)
     789             :         pRegisterUINameArray = lcl_NewUINameArray( RC_POOLCOLL_REGISTER_BEGIN,
     790          35 :             RC_POOLCOLL_REGISTER_BEGIN + (RES_POOLCOLL_REGISTER_END - RES_POOLCOLL_REGISTER_BEGIN) );
     791        8199 :     return *pRegisterUINameArray;
     792             : }
     793             : 
     794        2477 : const ::std::vector<OUString>& SwStyleNameMapper::GetDocUINameArray()
     795             : {
     796        2477 :     if (!pDocUINameArray)
     797             :         pDocUINameArray = lcl_NewUINameArray( RC_POOLCOLL_DOC_BEGIN,
     798          35 :             RC_POOLCOLL_DOC_BEGIN + (RES_POOLCOLL_DOC_END - RES_POOLCOLL_DOC_BEGIN) );
     799        2477 :     return *pDocUINameArray;
     800             : }
     801             : 
     802        1805 : const ::std::vector<OUString>& SwStyleNameMapper::GetHTMLUINameArray()
     803             : {
     804        1805 :     if (!pHTMLUINameArray)
     805             :         pHTMLUINameArray = lcl_NewUINameArray( RC_POOLCOLL_HTML_BEGIN,
     806          35 :             RC_POOLCOLL_HTML_BEGIN + (RES_POOLCOLL_HTML_END - RES_POOLCOLL_HTML_BEGIN) );
     807        1805 :     return *pHTMLUINameArray;
     808             : }
     809             : 
     810        1656 : const ::std::vector<OUString>& SwStyleNameMapper::GetFrmFmtUINameArray()
     811             : {
     812        1656 :     if (!pFrmFmtUINameArray)
     813             :         pFrmFmtUINameArray = lcl_NewUINameArray( RC_POOLFRMFMT_BEGIN,
     814          22 :             RC_POOLFRMFMT_BEGIN + (RES_POOLFRM_END - RES_POOLFRM_BEGIN) );
     815        1656 :     return *pFrmFmtUINameArray;
     816             : }
     817             : 
     818        2591 : const ::std::vector<OUString>& SwStyleNameMapper::GetChrFmtUINameArray()
     819             : {
     820        2591 :     if (!pChrFmtUINameArray)
     821             :         pChrFmtUINameArray = lcl_NewUINameArray( RC_POOLCHRFMT_BEGIN,
     822          37 :             RC_POOLCHRFMT_BEGIN + (RES_POOLCHR_NORMAL_END - RES_POOLCHR_NORMAL_BEGIN) );
     823        2591 :     return *pChrFmtUINameArray;
     824             : }
     825             : 
     826         753 : const ::std::vector<OUString>& SwStyleNameMapper::GetHTMLChrFmtUINameArray()
     827             : {
     828         753 :     if (!pHTMLChrFmtUINameArray)
     829             :         pHTMLChrFmtUINameArray = lcl_NewUINameArray( RC_POOLCHRFMT_HTML_BEGIN,
     830          24 :             RC_POOLCHRFMT_HTML_BEGIN + (RES_POOLCHR_HTML_END - RES_POOLCHR_HTML_BEGIN) );
     831         753 :     return *pHTMLChrFmtUINameArray;
     832             : }
     833             : 
     834        4764 : const ::std::vector<OUString>& SwStyleNameMapper::GetPageDescUINameArray()
     835             : {
     836        4764 :     if (!pPageDescUINameArray)
     837             :         pPageDescUINameArray = lcl_NewUINameArray( RC_POOLPAGEDESC_BEGIN,
     838          26 :             RC_POOLPAGEDESC_BEGIN + (RES_POOLPAGE_END - RES_POOLPAGE_BEGIN) );
     839        4764 :     return *pPageDescUINameArray;
     840             : }
     841             : 
     842         249 : const ::std::vector<OUString>& SwStyleNameMapper::GetNumRuleUINameArray()
     843             : {
     844         249 :     if (!pNumRuleUINameArray)
     845             :         pNumRuleUINameArray = lcl_NewUINameArray( RC_POOLNUMRULE_BEGIN,
     846          24 :             RC_POOLNUMRULE_BEGIN + (RES_POOLNUMRULE_END - RES_POOLNUMRULE_BEGIN) );
     847         249 :     return *pNumRuleUINameArray;
     848             : }
     849             : 
     850       17853 : const ::std::vector<OUString>& SwStyleNameMapper::GetTextProgNameArray()
     851             : {
     852       17853 :     if (!pTextProgNameArray)
     853             :         pTextProgNameArray = lcl_NewProgNameArray(TextProgNameTable,
     854          35 :             sizeof ( TextProgNameTable ) / sizeof ( SwTableEntry ) );
     855       17853 :     return *pTextProgNameArray;
     856             : }
     857             : 
     858        2072 : const ::std::vector<OUString>& SwStyleNameMapper::GetListsProgNameArray()
     859             : {
     860        2072 :     if (!pListsProgNameArray)
     861             :         pListsProgNameArray = lcl_NewProgNameArray( ListsProgNameTable,
     862          34 :             sizeof ( ListsProgNameTable ) / sizeof ( SwTableEntry ) );
     863        2072 :     return *pListsProgNameArray;
     864             : }
     865             : 
     866        5393 : const ::std::vector<OUString>& SwStyleNameMapper::GetExtraProgNameArray()
     867             : {
     868        5393 :     if (!pExtraProgNameArray)
     869             :         pExtraProgNameArray = lcl_NewProgNameArray( ExtraProgNameTable,
     870          34 :             sizeof ( ExtraProgNameTable ) / sizeof ( SwTableEntry ) );
     871        5393 :     return *pExtraProgNameArray;
     872             : }
     873             : 
     874        2424 : const ::std::vector<OUString>& SwStyleNameMapper::GetRegisterProgNameArray()
     875             : {
     876        2424 :     if (!pRegisterProgNameArray)
     877             :         pRegisterProgNameArray = lcl_NewProgNameArray( RegisterProgNameTable,
     878          34 :             sizeof ( RegisterProgNameTable ) / sizeof ( SwTableEntry ) );
     879        2424 :     return *pRegisterProgNameArray;
     880             : }
     881             : 
     882         133 : const ::std::vector<OUString>& SwStyleNameMapper::GetDocProgNameArray()
     883             : {
     884         133 :     if (!pDocProgNameArray)
     885             :         pDocProgNameArray = lcl_NewProgNameArray( DocProgNameTable,
     886          34 :             sizeof ( DocProgNameTable ) / sizeof ( SwTableEntry ) );
     887         133 :     return *pDocProgNameArray;
     888             : }
     889             : 
     890         522 : const ::std::vector<OUString>& SwStyleNameMapper::GetHTMLProgNameArray()
     891             : {
     892         522 :     if (!pHTMLProgNameArray)
     893             :         pHTMLProgNameArray = lcl_NewProgNameArray( HTMLProgNameTable,
     894          34 :             sizeof ( HTMLProgNameTable ) / sizeof ( SwTableEntry ) );
     895         522 :     return *pHTMLProgNameArray;
     896             : }
     897             : 
     898         421 : const ::std::vector<OUString>& SwStyleNameMapper::GetFrmFmtProgNameArray()
     899             : {
     900         421 :     if (!pFrmFmtProgNameArray)
     901             :         pFrmFmtProgNameArray = lcl_NewProgNameArray( FrmFmtProgNameTable,
     902          22 :             sizeof ( FrmFmtProgNameTable ) / sizeof ( SwTableEntry ) );
     903         421 :     return *pFrmFmtProgNameArray;
     904             : }
     905             : 
     906        6978 : const ::std::vector<OUString>& SwStyleNameMapper::GetChrFmtProgNameArray()
     907             : {
     908        6978 :     if (!pChrFmtProgNameArray)
     909             :         pChrFmtProgNameArray = lcl_NewProgNameArray( ChrFmtProgNameTable,
     910          25 :             sizeof ( ChrFmtProgNameTable ) / sizeof ( SwTableEntry ) );
     911        6978 :     return *pChrFmtProgNameArray;
     912             : }
     913             : 
     914        3492 : const ::std::vector<OUString>& SwStyleNameMapper::GetHTMLChrFmtProgNameArray()
     915             : {
     916        3492 :     if (!pHTMLChrFmtProgNameArray)
     917             :         pHTMLChrFmtProgNameArray = lcl_NewProgNameArray( HTMLChrFmtProgNameTable,
     918          25 :             sizeof ( HTMLChrFmtProgNameTable ) / sizeof ( SwTableEntry ) );
     919        3492 :     return *pHTMLChrFmtProgNameArray;
     920             : }
     921             : 
     922        2237 : const ::std::vector<OUString>& SwStyleNameMapper::GetPageDescProgNameArray()
     923             : {
     924        2237 :     if (!pPageDescProgNameArray)
     925             :         pPageDescProgNameArray = lcl_NewProgNameArray( PageDescProgNameTable,
     926          26 :             sizeof ( PageDescProgNameTable ) / sizeof ( SwTableEntry ) );
     927        2237 :     return *pPageDescProgNameArray;
     928             : }
     929             : 
     930         233 : const ::std::vector<OUString>& SwStyleNameMapper::GetNumRuleProgNameArray()
     931             : {
     932         233 :     if (!pNumRuleProgNameArray)
     933             :         pNumRuleProgNameArray = lcl_NewProgNameArray( NumRuleProgNameTable,
     934          23 :             sizeof ( NumRuleProgNameTable ) / sizeof ( SwTableEntry ) );
     935         233 :     return *pNumRuleProgNameArray;
     936             : }
     937             : 
     938             : const OUString
     939          91 : SwStyleNameMapper::GetSpecialExtraProgName(const OUString& rExtraUIName)
     940             : {
     941          91 :     return lcl_GetSpecialExtraName( rExtraUIName, true );
     942             : }
     943             : 
     944             : const OUString
     945        1193 : SwStyleNameMapper::GetSpecialExtraUIName(const OUString& rExtraProgName)
     946             : {
     947        1193 :     return lcl_GetSpecialExtraName( rExtraProgName, false );
     948             : }
     949             : 
     950             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10