LCOV - code coverage report
Current view: top level - sw/source/core/doc - SwStyleNameMapper.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 298 0.0 %
Date: 2014-04-14 Functions: 0 42 0.0 %
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           0 : lcl_NewUINameArray(sal_uInt16 nStt, sal_uInt16 const nEnd)
     314             : {
     315           0 :     ::std::vector<OUString> *const pNameArray = new ::std::vector<OUString>;
     316           0 :     pNameArray->reserve(nEnd - nStt);
     317           0 :     while( nStt < nEnd )
     318             :     {
     319           0 :         const ResId aRId( nStt, *pSwResMgr );
     320           0 :         pNameArray->push_back(OUString(aRId));
     321           0 :         ++nStt;
     322             :     }
     323           0 :     return pNameArray;
     324             : }
     325             : 
     326             : static ::std::vector<OUString>*
     327           0 : lcl_NewProgNameArray(const SwTableEntry *pTable, sal_uInt8 const nCount)
     328             : {
     329           0 :     ::std::vector<OUString> *const pProgNameArray = new ::std::vector<OUString>;
     330           0 :     pProgNameArray->reserve(nCount);
     331           0 :     while (pTable->nLength)
     332             :     {
     333             :         pProgNameArray->push_back(OUString(
     334           0 :                 pTable->pChar, pTable->nLength, RTL_TEXTENCODING_ASCII_US));
     335           0 :         pTable++;
     336             :     }
     337           0 :     return pProgNameArray;
     338             : }
     339             : 
     340             : static OUString
     341           0 : lcl_GetSpecialExtraName(const OUString& rExtraName, const bool bIsUIName )
     342             : {
     343             :     const ::std::vector<OUString>& rExtraArr = bIsUIName
     344             :         ? SwStyleNameMapper::GetExtraUINameArray()
     345           0 :         : 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           0 :     for ( pIds = nIds; *pIds; ++pIds)
     356             :     {
     357           0 :         if (rExtraName == rExtraArr[ *pIds ])
     358             :         {
     359             :             return bIsUIName
     360           0 :                 ? SwStyleNameMapper::GetExtraProgNameArray()[*pIds]
     361           0 :                 : SwStyleNameMapper::GetExtraUINameArray()[*pIds];
     362             :         }
     363             :     }
     364           0 :     return rExtraName;
     365             : }
     366             : 
     367           0 : static bool lcl_SuffixIsUser(const OUString & rString)
     368             : {
     369           0 :     const sal_Unicode *pChar = rString.getStr();
     370           0 :     sal_Int32 nLen = rString.getLength();
     371           0 :     bool bRet = false;
     372           0 :     if( nLen > 8 &&
     373           0 :         pChar[nLen-7] == ' ' &&
     374           0 :         pChar[nLen-6] == '(' &&
     375           0 :         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           0 :     return bRet;
     382             : }
     383             : 
     384           0 : static void lcl_CheckSuffixAndDelete(OUString & rString)
     385             : {
     386           0 :     if (lcl_SuffixIsUser(rString))
     387             :     {
     388           0 :         rString = rString.copy(0, rString.getLength() - 7);
     389             :     }
     390           0 : }
     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           0 : const NameToIdHash & SwStyleNameMapper::getHashTable ( SwGetPoolIdFromName eFlags, bool bProgName )
     415             : {
     416           0 :     NameToIdHash *pHash = 0;
     417           0 :     const ::std::vector<OUString> *pStrings = 0;
     418             : 
     419           0 :     switch ( eFlags )
     420             :     {
     421             :         case nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL:
     422             :         {
     423             :             sal_uInt16 nIndex;
     424             :             sal_uInt16 nId;
     425             : 
     426           0 :             pHash = bProgName ? pParaProgMap : pParaUIMap;
     427           0 :             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           0 :                                            RES_POOLCOLL_HTML_END - RES_POOLCOLL_HTML_BEGIN );
     435           0 :                 pStrings = bProgName ? &GetTextProgNameArray() : &GetTextUINameArray();
     436           0 :                 for ( nIndex = 0, nId = RES_POOLCOLL_TEXT_BEGIN ; nId < RES_POOLCOLL_TEXT_END ; nId++,nIndex++ )
     437           0 :                     (*pHash)[((*pStrings)[nIndex])] = nId;
     438           0 :                 pStrings = bProgName ? &GetListsProgNameArray() : &GetListsUINameArray();
     439           0 :                 for ( nIndex = 0, nId = RES_POOLCOLL_LISTS_BEGIN ; nId < RES_POOLCOLL_LISTS_END ; nId++,nIndex++ )
     440           0 :                     (*pHash)[((*pStrings)[nIndex])] = nId;
     441           0 :                 pStrings = bProgName ? &GetExtraProgNameArray() : &GetExtraUINameArray();
     442           0 :                 for ( nIndex = 0, nId = RES_POOLCOLL_EXTRA_BEGIN ; nId < RES_POOLCOLL_EXTRA_END ; nId++,nIndex++ )
     443           0 :                     (*pHash)[((*pStrings)[nIndex])] = nId;
     444           0 :                 pStrings = bProgName ? &GetRegisterProgNameArray() : &GetRegisterUINameArray();
     445           0 :                 for ( nIndex = 0, nId = RES_POOLCOLL_REGISTER_BEGIN ; nId < RES_POOLCOLL_REGISTER_END ; nId++,nIndex++ )
     446           0 :                     (*pHash)[((*pStrings)[nIndex])] = nId;
     447           0 :                 pStrings = bProgName ? &GetDocProgNameArray() : &GetDocUINameArray();
     448           0 :                 for ( nIndex = 0, nId = RES_POOLCOLL_DOC_BEGIN ; nId < RES_POOLCOLL_DOC_END ; nId++,nIndex++ )
     449           0 :                     (*pHash)[((*pStrings)[nIndex])] = nId;
     450           0 :                 pStrings = bProgName ? &GetHTMLProgNameArray() : &GetHTMLUINameArray();
     451           0 :                 for ( nIndex = 0, nId = RES_POOLCOLL_HTML_BEGIN ; nId < RES_POOLCOLL_HTML_END ; nId++,nIndex++ )
     452           0 :                     (*pHash)[((*pStrings)[nIndex])] = nId;
     453             : 
     454           0 :                 if ( bProgName )
     455           0 :                     pParaProgMap = pHash;
     456             :                 else
     457           0 :                     pParaUIMap = pHash;
     458             :             }
     459             :         }
     460           0 :         break;
     461             :         case nsSwGetPoolIdFromName::GET_POOLID_CHRFMT:
     462             :         {
     463           0 :             pHash = bProgName ? pCharProgMap : pCharUIMap;
     464           0 :             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           0 :                                            RES_POOLCHR_HTML_END - RES_POOLCHR_HTML_BEGIN );
     471           0 :                 pStrings = bProgName ? &GetChrFmtProgNameArray() : &GetChrFmtUINameArray();
     472           0 :                 for ( nIndex = 0, nId = RES_POOLCHR_NORMAL_BEGIN ; nId < RES_POOLCHR_NORMAL_END ; nId++,nIndex++ )
     473           0 :                     (*pHash)[((*pStrings)[nIndex])] = nId;
     474           0 :                 pStrings = bProgName ? &GetHTMLChrFmtProgNameArray() : &GetHTMLChrFmtUINameArray();
     475           0 :                 for ( nIndex = 0, nId = RES_POOLCHR_HTML_BEGIN ; nId < RES_POOLCHR_HTML_END ; nId++,nIndex++ )
     476           0 :                     (*pHash)[((*pStrings)[nIndex])] = nId;
     477           0 :                 if (bProgName )
     478           0 :                     pCharProgMap = pHash;
     479             :                 else
     480           0 :                     pCharUIMap = pHash;
     481             :             }
     482             :         }
     483           0 :         break;
     484             :         case nsSwGetPoolIdFromName::GET_POOLID_FRMFMT:
     485             :         {
     486           0 :             pHash = bProgName ? pFrameProgMap : pFrameUIMap;
     487           0 :             if ( !pHash )
     488             :             {
     489           0 :                 pHash = new NameToIdHash ( RES_POOLFRM_END - RES_POOLFRM_BEGIN );
     490           0 :                 pStrings = bProgName ? &GetFrmFmtProgNameArray() : &GetFrmFmtUINameArray();
     491           0 :                 for ( sal_uInt16 nIndex=0,nId = RES_POOLFRM_BEGIN ; nId < RES_POOLFRM_END ; nId++,nIndex++ )
     492           0 :                     (*pHash)[((*pStrings)[nIndex])] = nId;
     493           0 :                 if ( bProgName )
     494           0 :                     pFrameProgMap = pHash;
     495             :                 else
     496           0 :                     pFrameUIMap = pHash;
     497             :             }
     498             :         }
     499           0 :         break;
     500             :         case nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC:
     501             :         {
     502           0 :             pHash = bProgName ? pPageProgMap : pPageUIMap;
     503           0 :             if ( !pHash )
     504             :             {
     505           0 :                 pHash = new NameToIdHash ( RES_POOLPAGE_END - RES_POOLPAGE_BEGIN );
     506           0 :                 pStrings = bProgName ? &GetPageDescProgNameArray() : &GetPageDescUINameArray();
     507           0 :                 for ( sal_uInt16 nIndex=0,nId = RES_POOLPAGE_BEGIN ; nId < RES_POOLPAGE_END ; nId++,nIndex++ )
     508           0 :                     (*pHash)[((*pStrings)[nIndex])] = nId;
     509           0 :                 if ( bProgName )
     510           0 :                     pPageProgMap = pHash;
     511             :                 else
     512           0 :                     pPageUIMap = pHash;
     513             :             }
     514             :         }
     515           0 :         break;
     516             :         case nsSwGetPoolIdFromName::GET_POOLID_NUMRULE:
     517             :         {
     518           0 :             pHash = bProgName ? pNumRuleProgMap : pNumRuleUIMap;
     519           0 :             if ( !pHash )
     520             :             {
     521           0 :                 pHash = new NameToIdHash ( RES_POOLNUMRULE_END - RES_POOLNUMRULE_BEGIN );
     522           0 :                 pStrings = bProgName ? &GetNumRuleProgNameArray() : &GetNumRuleUINameArray();
     523           0 :                 for ( sal_uInt16 nIndex=0,nId = RES_POOLNUMRULE_BEGIN ; nId < RES_POOLNUMRULE_END ; nId++,nIndex++ )
     524             :                 {
     525           0 :                     (*pHash)[((*pStrings)[nIndex])] = nId;
     526             :                 }
     527           0 :                 if ( bProgName )
     528           0 :                     pNumRuleProgMap = pHash;
     529             :                 else
     530           0 :                     pNumRuleUIMap = pHash;
     531             :             }
     532             :         }
     533           0 :         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           0 :     return *pHash;
     556             : }
     557             : 
     558             : // This gets the UI name from the programmatic name
     559           0 : const OUString& SwStyleNameMapper::GetUIName(const OUString& rName,
     560             :                                              SwGetPoolIdFromName const eFlags)
     561             : {
     562           0 :     sal_uInt16 nId = GetPoolIdFromProgName ( rName, eFlags );
     563           0 :     return nId != USHRT_MAX ? GetUIName( nId, rName ) : rName;
     564             : }
     565             : 
     566             : // Get the programmatic name from the UI name
     567           0 : const OUString& SwStyleNameMapper::GetProgName(
     568             :         const OUString& rName, SwGetPoolIdFromName const eFlags)
     569             : {
     570           0 :     sal_uInt16 nId = GetPoolIdFromUIName ( rName, eFlags );
     571           0 :     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           0 : void SwStyleNameMapper::FillProgName(
     576             :         const OUString& rName, OUString& rFillName,
     577             :         SwGetPoolIdFromName const eFlags, bool const bDisambiguate)
     578             : {
     579           0 :     sal_uInt16 nId = GetPoolIdFromUIName ( rName, eFlags );
     580           0 :     if ( bDisambiguate && nId == USHRT_MAX )
     581             :     {
     582             :         // rName isn't in our UI name table...check if it's in the programmatic one
     583           0 :         nId = GetPoolIdFromProgName ( rName, eFlags );
     584             : 
     585           0 :         rFillName = rName;
     586           0 :         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           0 :             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           0 :         fillNameFromId(nId, rFillName, true);
     603             :     }
     604           0 : }
     605             : 
     606             : // Get the UI name from the programmatic name in rName and put it into rFillName
     607           0 : void SwStyleNameMapper::FillUIName(
     608             :         const OUString& rName, OUString& rFillName,
     609             :         SwGetPoolIdFromName const eFlags, bool const bDisambiguate)
     610             : {
     611           0 :     sal_uInt16 nId = GetPoolIdFromProgName ( rName, eFlags );
     612           0 :     if ( bDisambiguate && nId == USHRT_MAX )
     613             :     {
     614           0 :         rFillName = rName;
     615             :         // rName isn't in our Prog name table...check if it has a " (user)" suffix, if so remove it
     616           0 :         lcl_CheckSuffixAndDelete ( rFillName );
     617             :     }
     618             :     else
     619             :     {
     620             :         // If we aren't trying to disambiguate, then just do a normal fill
     621           0 :         fillNameFromId(nId, rFillName, false);
     622             :     }
     623           0 : }
     624             : 
     625           0 : const OUString& SwStyleNameMapper::getNameFromId(
     626             :         sal_uInt16 const nId, const OUString& rFillName, bool const bProgName)
     627             : {
     628           0 :     sal_uInt16 nStt = 0;
     629           0 :     const ::std::vector<OUString>* pStrArr = 0;
     630             : 
     631           0 :     switch( (USER_FMT | COLL_GET_RANGE_BITS | POOLGRP_NOCOLLID) & nId )
     632             :     {
     633             :     case COLL_TEXT_BITS:
     634           0 :         if( RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END )
     635             :         {
     636           0 :             pStrArr = bProgName ? &GetTextProgNameArray() : &GetTextUINameArray();
     637           0 :             nStt = RES_POOLCOLL_TEXT_BEGIN;
     638             :         }
     639           0 :         break;
     640             :     case COLL_LISTS_BITS:
     641           0 :         if( RES_POOLCOLL_LISTS_BEGIN <= nId && nId < RES_POOLCOLL_LISTS_END )
     642             :         {
     643           0 :             pStrArr = bProgName ? &GetListsProgNameArray() : &GetListsUINameArray();
     644           0 :             nStt = RES_POOLCOLL_LISTS_BEGIN;
     645             :         }
     646           0 :         break;
     647             :     case COLL_EXTRA_BITS:
     648           0 :         if( RES_POOLCOLL_EXTRA_BEGIN <= nId && nId < RES_POOLCOLL_EXTRA_END )
     649             :         {
     650           0 :             pStrArr = bProgName ? &GetExtraProgNameArray() : &GetExtraUINameArray();
     651           0 :             nStt = RES_POOLCOLL_EXTRA_BEGIN;
     652             :         }
     653           0 :         break;
     654             :     case COLL_REGISTER_BITS:
     655           0 :         if( RES_POOLCOLL_REGISTER_BEGIN <= nId && nId < RES_POOLCOLL_REGISTER_END )
     656             :         {
     657           0 :             pStrArr = bProgName ? &GetRegisterProgNameArray() : &GetRegisterUINameArray();
     658           0 :             nStt = RES_POOLCOLL_REGISTER_BEGIN;
     659             :         }
     660           0 :         break;
     661             :     case COLL_DOC_BITS:
     662           0 :         if( RES_POOLCOLL_DOC_BEGIN <= nId && nId < RES_POOLCOLL_DOC_END )
     663             :         {
     664           0 :             pStrArr = bProgName ? &GetDocProgNameArray() : &GetDocUINameArray();
     665           0 :             nStt = RES_POOLCOLL_DOC_BEGIN;
     666             :         }
     667           0 :         break;
     668             :     case COLL_HTML_BITS:
     669           0 :         if( RES_POOLCOLL_HTML_BEGIN <= nId && nId < RES_POOLCOLL_HTML_END )
     670             :         {
     671           0 :             pStrArr = bProgName ? &GetHTMLProgNameArray() : &GetHTMLUINameArray();
     672           0 :             nStt = RES_POOLCOLL_HTML_BEGIN;
     673             :         }
     674           0 :         break;
     675             :     case POOLGRP_CHARFMT:
     676           0 :         if( RES_POOLCHR_NORMAL_BEGIN <= nId && nId < RES_POOLCHR_NORMAL_END )
     677             :         {
     678           0 :             pStrArr = bProgName ? &GetChrFmtProgNameArray() : &GetChrFmtUINameArray();
     679           0 :             nStt = RES_POOLCHR_NORMAL_BEGIN;
     680             :         }
     681           0 :         else if( RES_POOLCHR_HTML_BEGIN <= nId && nId < RES_POOLCHR_HTML_END )
     682             :         {
     683           0 :             pStrArr = bProgName ? &GetHTMLChrFmtProgNameArray() : &GetHTMLChrFmtUINameArray();
     684           0 :             nStt = RES_POOLCHR_HTML_BEGIN;
     685             :         }
     686           0 :         break;
     687             :     case POOLGRP_FRAMEFMT:
     688           0 :         if( RES_POOLFRM_BEGIN <= nId && nId < RES_POOLFRM_END )
     689             :         {
     690           0 :             pStrArr = bProgName ? &GetFrmFmtProgNameArray() : &GetFrmFmtUINameArray();
     691           0 :             nStt = RES_POOLFRM_BEGIN;
     692             :         }
     693           0 :         break;
     694             :     case POOLGRP_PAGEDESC:
     695           0 :         if( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END )
     696             :         {
     697           0 :             pStrArr = bProgName ? &GetPageDescProgNameArray() : &GetPageDescUINameArray();
     698           0 :             nStt = RES_POOLPAGE_BEGIN;
     699             :         }
     700           0 :         break;
     701             :     case POOLGRP_NUMRULE:
     702           0 :         if( RES_POOLNUMRULE_BEGIN <= nId && nId < RES_POOLNUMRULE_END )
     703             :         {
     704           0 :             pStrArr = bProgName ? &GetNumRuleProgNameArray() : &GetNumRuleUINameArray();
     705           0 :             nStt = RES_POOLNUMRULE_BEGIN;
     706             :         }
     707           0 :         break;
     708             :     }
     709           0 :     return pStrArr ? pStrArr->operator[](nId - nStt) : rFillName;
     710             : }
     711             : 
     712           0 : void SwStyleNameMapper::fillNameFromId(
     713             :         sal_uInt16 const nId, OUString& rFillName, bool bProgName)
     714             : {
     715           0 :     rFillName = getNameFromId(nId, rFillName, bProgName);
     716           0 : }
     717             : 
     718             : // Get the UI name from the pool ID
     719           0 : void SwStyleNameMapper::FillUIName(sal_uInt16 const nId, OUString& rFillName)
     720             : {
     721           0 :     fillNameFromId(nId, rFillName, false);
     722           0 : }
     723             : 
     724             : // Get the UI name from the pool ID
     725           0 : const OUString& SwStyleNameMapper::GetUIName(
     726             :         sal_uInt16 const nId, const OUString& rName)
     727             : {
     728           0 :     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           0 : SwStyleNameMapper::GetProgName(sal_uInt16 const nId, const OUString& rName)
     740             : {
     741           0 :     return getNameFromId(nId, rName, true);
     742             : }
     743             : 
     744             : // This gets the PoolId from the UI Name
     745           0 : sal_uInt16 SwStyleNameMapper::GetPoolIdFromUIName(
     746             :         const OUString& rName, SwGetPoolIdFromName const eFlags)
     747             : {
     748           0 :     const NameToIdHash & rHashMap = getHashTable ( eFlags, false );
     749           0 :     NameToIdHash::const_iterator aIter = rHashMap.find(rName);
     750           0 :     return aIter != rHashMap.end() ? (*aIter).second : USHRT_MAX;
     751             : }
     752             : 
     753             : // Get the Pool ID from the programmatic name
     754           0 : sal_uInt16 SwStyleNameMapper::GetPoolIdFromProgName(
     755             :             const OUString& rName, SwGetPoolIdFromName const eFlags)
     756             : {
     757           0 :     const NameToIdHash & rHashMap = getHashTable ( eFlags, true );
     758           0 :     NameToIdHash::const_iterator aIter = rHashMap.find(rName);
     759           0 :     return aIter != rHashMap.end() ? (*aIter).second : USHRT_MAX;
     760             : }
     761             : 
     762           0 : const ::std::vector<OUString>& SwStyleNameMapper::GetTextUINameArray()
     763             : {
     764           0 :     if (!pTextUINameArray)
     765             :         pTextUINameArray = lcl_NewUINameArray( RC_POOLCOLL_TEXT_BEGIN,
     766           0 :             RC_POOLCOLL_TEXT_BEGIN + (RES_POOLCOLL_TEXT_END - RES_POOLCOLL_TEXT_BEGIN) );
     767           0 :     return *pTextUINameArray;
     768             : }
     769             : 
     770           0 : const ::std::vector<OUString>& SwStyleNameMapper::GetListsUINameArray()
     771             : {
     772           0 :     if (!pListsUINameArray)
     773             :         pListsUINameArray = lcl_NewUINameArray( RC_POOLCOLL_LISTS_BEGIN,
     774           0 :             RC_POOLCOLL_LISTS_BEGIN + (RES_POOLCOLL_LISTS_END - RES_POOLCOLL_LISTS_BEGIN) );
     775           0 :     return *pListsUINameArray;
     776             : }
     777             : 
     778           0 : const ::std::vector<OUString>& SwStyleNameMapper::GetExtraUINameArray()
     779             : {
     780           0 :     if (!pExtraUINameArray)
     781             :         pExtraUINameArray = lcl_NewUINameArray( RC_POOLCOLL_EXTRA_BEGIN,
     782           0 :             RC_POOLCOLL_EXTRA_BEGIN + (RES_POOLCOLL_EXTRA_END - RES_POOLCOLL_EXTRA_BEGIN) );
     783           0 :     return *pExtraUINameArray;
     784             : }
     785             : 
     786           0 : const ::std::vector<OUString>& SwStyleNameMapper::GetRegisterUINameArray()
     787             : {
     788           0 :     if (!pRegisterUINameArray)
     789             :         pRegisterUINameArray = lcl_NewUINameArray( RC_POOLCOLL_REGISTER_BEGIN,
     790           0 :             RC_POOLCOLL_REGISTER_BEGIN + (RES_POOLCOLL_REGISTER_END - RES_POOLCOLL_REGISTER_BEGIN) );
     791           0 :     return *pRegisterUINameArray;
     792             : }
     793             : 
     794           0 : const ::std::vector<OUString>& SwStyleNameMapper::GetDocUINameArray()
     795             : {
     796           0 :     if (!pDocUINameArray)
     797             :         pDocUINameArray = lcl_NewUINameArray( RC_POOLCOLL_DOC_BEGIN,
     798           0 :             RC_POOLCOLL_DOC_BEGIN + (RES_POOLCOLL_DOC_END - RES_POOLCOLL_DOC_BEGIN) );
     799           0 :     return *pDocUINameArray;
     800             : }
     801             : 
     802           0 : const ::std::vector<OUString>& SwStyleNameMapper::GetHTMLUINameArray()
     803             : {
     804           0 :     if (!pHTMLUINameArray)
     805             :         pHTMLUINameArray = lcl_NewUINameArray( RC_POOLCOLL_HTML_BEGIN,
     806           0 :             RC_POOLCOLL_HTML_BEGIN + (RES_POOLCOLL_HTML_END - RES_POOLCOLL_HTML_BEGIN) );
     807           0 :     return *pHTMLUINameArray;
     808             : }
     809             : 
     810           0 : const ::std::vector<OUString>& SwStyleNameMapper::GetFrmFmtUINameArray()
     811             : {
     812           0 :     if (!pFrmFmtUINameArray)
     813             :         pFrmFmtUINameArray = lcl_NewUINameArray( RC_POOLFRMFMT_BEGIN,
     814           0 :             RC_POOLFRMFMT_BEGIN + (RES_POOLFRM_END - RES_POOLFRM_BEGIN) );
     815           0 :     return *pFrmFmtUINameArray;
     816             : }
     817             : 
     818           0 : const ::std::vector<OUString>& SwStyleNameMapper::GetChrFmtUINameArray()
     819             : {
     820           0 :     if (!pChrFmtUINameArray)
     821             :         pChrFmtUINameArray = lcl_NewUINameArray( RC_POOLCHRFMT_BEGIN,
     822           0 :             RC_POOLCHRFMT_BEGIN + (RES_POOLCHR_NORMAL_END - RES_POOLCHR_NORMAL_BEGIN) );
     823           0 :     return *pChrFmtUINameArray;
     824             : }
     825             : 
     826           0 : const ::std::vector<OUString>& SwStyleNameMapper::GetHTMLChrFmtUINameArray()
     827             : {
     828           0 :     if (!pHTMLChrFmtUINameArray)
     829             :         pHTMLChrFmtUINameArray = lcl_NewUINameArray( RC_POOLCHRFMT_HTML_BEGIN,
     830           0 :             RC_POOLCHRFMT_HTML_BEGIN + (RES_POOLCHR_HTML_END - RES_POOLCHR_HTML_BEGIN) );
     831           0 :     return *pHTMLChrFmtUINameArray;
     832             : }
     833             : 
     834           0 : const ::std::vector<OUString>& SwStyleNameMapper::GetPageDescUINameArray()
     835             : {
     836           0 :     if (!pPageDescUINameArray)
     837             :         pPageDescUINameArray = lcl_NewUINameArray( RC_POOLPAGEDESC_BEGIN,
     838           0 :             RC_POOLPAGEDESC_BEGIN + (RES_POOLPAGE_END - RES_POOLPAGE_BEGIN) );
     839           0 :     return *pPageDescUINameArray;
     840             : }
     841             : 
     842           0 : const ::std::vector<OUString>& SwStyleNameMapper::GetNumRuleUINameArray()
     843             : {
     844           0 :     if (!pNumRuleUINameArray)
     845             :         pNumRuleUINameArray = lcl_NewUINameArray( RC_POOLNUMRULE_BEGIN,
     846           0 :             RC_POOLNUMRULE_BEGIN + (RES_POOLNUMRULE_END - RES_POOLNUMRULE_BEGIN) );
     847           0 :     return *pNumRuleUINameArray;
     848             : }
     849             : 
     850           0 : const ::std::vector<OUString>& SwStyleNameMapper::GetTextProgNameArray()
     851             : {
     852           0 :     if (!pTextProgNameArray)
     853             :         pTextProgNameArray = lcl_NewProgNameArray(TextProgNameTable,
     854           0 :             sizeof ( TextProgNameTable ) / sizeof ( SwTableEntry ) );
     855           0 :     return *pTextProgNameArray;
     856             : }
     857             : 
     858           0 : const ::std::vector<OUString>& SwStyleNameMapper::GetListsProgNameArray()
     859             : {
     860           0 :     if (!pListsProgNameArray)
     861             :         pListsProgNameArray = lcl_NewProgNameArray( ListsProgNameTable,
     862           0 :             sizeof ( ListsProgNameTable ) / sizeof ( SwTableEntry ) );
     863           0 :     return *pListsProgNameArray;
     864             : }
     865             : 
     866           0 : const ::std::vector<OUString>& SwStyleNameMapper::GetExtraProgNameArray()
     867             : {
     868           0 :     if (!pExtraProgNameArray)
     869             :         pExtraProgNameArray = lcl_NewProgNameArray( ExtraProgNameTable,
     870           0 :             sizeof ( ExtraProgNameTable ) / sizeof ( SwTableEntry ) );
     871           0 :     return *pExtraProgNameArray;
     872             : }
     873             : 
     874           0 : const ::std::vector<OUString>& SwStyleNameMapper::GetRegisterProgNameArray()
     875             : {
     876           0 :     if (!pRegisterProgNameArray)
     877             :         pRegisterProgNameArray = lcl_NewProgNameArray( RegisterProgNameTable,
     878           0 :             sizeof ( RegisterProgNameTable ) / sizeof ( SwTableEntry ) );
     879           0 :     return *pRegisterProgNameArray;
     880             : }
     881             : 
     882           0 : const ::std::vector<OUString>& SwStyleNameMapper::GetDocProgNameArray()
     883             : {
     884           0 :     if (!pDocProgNameArray)
     885             :         pDocProgNameArray = lcl_NewProgNameArray( DocProgNameTable,
     886           0 :             sizeof ( DocProgNameTable ) / sizeof ( SwTableEntry ) );
     887           0 :     return *pDocProgNameArray;
     888             : }
     889             : 
     890           0 : const ::std::vector<OUString>& SwStyleNameMapper::GetHTMLProgNameArray()
     891             : {
     892           0 :     if (!pHTMLProgNameArray)
     893             :         pHTMLProgNameArray = lcl_NewProgNameArray( HTMLProgNameTable,
     894           0 :             sizeof ( HTMLProgNameTable ) / sizeof ( SwTableEntry ) );
     895           0 :     return *pHTMLProgNameArray;
     896             : }
     897             : 
     898           0 : const ::std::vector<OUString>& SwStyleNameMapper::GetFrmFmtProgNameArray()
     899             : {
     900           0 :     if (!pFrmFmtProgNameArray)
     901             :         pFrmFmtProgNameArray = lcl_NewProgNameArray( FrmFmtProgNameTable,
     902           0 :             sizeof ( FrmFmtProgNameTable ) / sizeof ( SwTableEntry ) );
     903           0 :     return *pFrmFmtProgNameArray;
     904             : }
     905             : 
     906           0 : const ::std::vector<OUString>& SwStyleNameMapper::GetChrFmtProgNameArray()
     907             : {
     908           0 :     if (!pChrFmtProgNameArray)
     909             :         pChrFmtProgNameArray = lcl_NewProgNameArray( ChrFmtProgNameTable,
     910           0 :             sizeof ( ChrFmtProgNameTable ) / sizeof ( SwTableEntry ) );
     911           0 :     return *pChrFmtProgNameArray;
     912             : }
     913             : 
     914           0 : const ::std::vector<OUString>& SwStyleNameMapper::GetHTMLChrFmtProgNameArray()
     915             : {
     916           0 :     if (!pHTMLChrFmtProgNameArray)
     917             :         pHTMLChrFmtProgNameArray = lcl_NewProgNameArray( HTMLChrFmtProgNameTable,
     918           0 :             sizeof ( HTMLChrFmtProgNameTable ) / sizeof ( SwTableEntry ) );
     919           0 :     return *pHTMLChrFmtProgNameArray;
     920             : }
     921             : 
     922           0 : const ::std::vector<OUString>& SwStyleNameMapper::GetPageDescProgNameArray()
     923             : {
     924           0 :     if (!pPageDescProgNameArray)
     925             :         pPageDescProgNameArray = lcl_NewProgNameArray( PageDescProgNameTable,
     926           0 :             sizeof ( PageDescProgNameTable ) / sizeof ( SwTableEntry ) );
     927           0 :     return *pPageDescProgNameArray;
     928             : }
     929             : 
     930           0 : const ::std::vector<OUString>& SwStyleNameMapper::GetNumRuleProgNameArray()
     931             : {
     932           0 :     if (!pNumRuleProgNameArray)
     933             :         pNumRuleProgNameArray = lcl_NewProgNameArray( NumRuleProgNameTable,
     934           0 :             sizeof ( NumRuleProgNameTable ) / sizeof ( SwTableEntry ) );
     935           0 :     return *pNumRuleProgNameArray;
     936             : }
     937             : 
     938             : const OUString
     939           0 : SwStyleNameMapper::GetSpecialExtraProgName(const OUString& rExtraUIName)
     940             : {
     941           0 :     return lcl_GetSpecialExtraName( rExtraUIName, true );
     942             : }
     943             : 
     944             : const OUString
     945           0 : SwStyleNameMapper::GetSpecialExtraUIName(const OUString& rExtraProgName)
     946             : {
     947           0 :     return lcl_GetSpecialExtraName( rExtraProgName, false );
     948             : }
     949             : 
     950             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10