LCOV - code coverage report
Current view: top level - libreoffice/sd/source/core - stlpool.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 459 714 64.3 %
Date: 2012-12-17 Functions: 17 38 44.7 %
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             : 
      21             : #include <com/sun/star/lang/DisposedException.hpp>
      22             : #include <editeng/eeitem.hxx>
      23             : #include <editeng/fhgtitem.hxx>
      24             : #include <editeng/colritem.hxx>
      25             : #include <editeng/cntritem.hxx>
      26             : #include <editeng/shdditem.hxx>
      27             : #include <editeng/crsditem.hxx>
      28             : #include <editeng/udlnitem.hxx>
      29             : #include <editeng/wghtitem.hxx>
      30             : #include <editeng/postitem.hxx>
      31             : #include <editeng/fontitem.hxx>
      32             : #include <svl/poolitem.hxx>
      33             : #include <svx/xfillit0.hxx>
      34             : #include <svx/xlineit0.hxx>
      35             : #include <editeng/ulspitem.hxx>
      36             : #include <editeng/numitem.hxx>
      37             : #include <editeng/brshitem.hxx>
      38             : #include <editeng/editeng.hxx>
      39             : #include <svl/smplhint.hxx>
      40             : #include <editeng/langitem.hxx>
      41             : #include <editeng/charreliefitem.hxx>
      42             : #include <editeng/emphitem.hxx>
      43             : #include <svx/sdr/table/tabledesign.hxx>
      44             : #include <editeng/akrnitem.hxx>
      45             : 
      46             : #include <svx/svdattr.hxx>
      47             : #include "eetext.hxx"
      48             : #include <svx/xtable.hxx>           // fuer RGB_Color
      49             : #include <editeng/bulitem.hxx>
      50             : #include <editeng/lrspitem.hxx>
      51             : #include <editeng/adjitem.hxx>
      52             : #include <svl/itempool.hxx>
      53             : 
      54             : #include "stlpool.hxx"
      55             : #include "sdresid.hxx"
      56             : #include "stlsheet.hxx"
      57             : #include "glob.hrc"
      58             : #include "glob.hxx"
      59             : #include "drawdoc.hxx"
      60             : #include "sdmod.hxx"
      61             : #include "sdpage.hxx"
      62             : #include "helpids.h"
      63             : #include <svl/itemset.hxx>
      64             : #include "app.hrc"
      65             : 
      66             : using ::rtl::OUString;
      67             : using namespace ::com::sun::star::uno;
      68             : using namespace ::com::sun::star::lang;
      69             : using namespace ::com::sun::star::style;
      70             : using namespace ::com::sun::star::container;
      71             : 
      72             : // ----------------------------------------------------------
      73             : 
      74          40 : SdStyleSheetPool::SdStyleSheetPool(SfxItemPool const& _rPool, SdDrawDocument* pDocument)
      75             : :   SdStyleSheetPoolBase( _rPool )
      76             : ,   mpActualStyleSheet(NULL)
      77          40 : ,   mpDoc(pDocument)
      78             : {
      79          40 :     if( mpDoc )
      80             :     {
      81          40 :         rtl::Reference< SfxStyleSheetPool > xPool( this );
      82             : 
      83             :         // create graphics family
      84          40 :         mxGraphicFamily = new SdStyleFamily( xPool, SD_STYLE_FAMILY_GRAPHICS );
      85          40 :         mxCellFamily = new SdStyleFamily( xPool, SD_STYLE_FAMILY_CELL );
      86             : 
      87          40 :         mxTableFamily = sdr::table::CreateTableDesignFamily();
      88          40 :         Reference< XNamed > xNamed( mxTableFamily, UNO_QUERY );
      89          40 :         if( xNamed.is() )
      90          40 :             msTableFamilyName = xNamed->getName();
      91             : 
      92             :         // create presentation families, one for each master page
      93          40 :         const sal_uInt16 nCount = mpDoc->GetMasterSdPageCount(PK_STANDARD);
      94          40 :         for( sal_uInt16 nPage = 0; nPage < nCount; ++nPage )
      95          40 :             AddStyleFamily( mpDoc->GetMasterSdPage(nPage,PK_STANDARD) );
      96             : 
      97             :     }
      98          40 : }
      99             : 
     100             : // ----------------------------------------------------------
     101             : 
     102          72 : SdStyleSheetPool::~SdStyleSheetPool()
     103             : {
     104             :     DBG_ASSERT( mpDoc == NULL, "sd::SdStyleSheetPool::~SdStyleSheetPool(), dispose me first!" );
     105          72 : }
     106             : 
     107             : // ----------------------------------------------------------
     108             : 
     109        1946 : SfxStyleSheetBase* SdStyleSheetPool::Create(const String& rName, SfxStyleFamily eFamily, sal_uInt16 _nMask )
     110             : {
     111        1946 :     return new SdStyleSheet(rName, *this, eFamily, _nMask);
     112             : }
     113             : 
     114             : // ----------------------------------------------------------
     115             : 
     116           0 : SfxStyleSheetBase* SdStyleSheetPool::Create(const SdStyleSheet& rStyle)
     117             : {
     118           0 :     return new SdStyleSheet( rStyle );
     119             : }
     120             : 
     121             : // ----------------------------------------------------------
     122             : 
     123           0 : SfxStyleSheetBase* SdStyleSheetPool::GetTitleSheet(const String& rLayoutName)
     124             : {
     125           0 :     String aName(rLayoutName);
     126           0 :     aName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR ));
     127           0 :     aName += String(SdResId(STR_LAYOUT_TITLE));
     128           0 :     SfxStyleSheetBase* pResult = Find(aName, SD_STYLE_FAMILY_MASTERPAGE);
     129           0 :     return pResult;
     130             : }
     131             : 
     132             : /*************************************************************************
     133             : |*
     134             : |* eine Liste der Gliederungstextvorlagen fuer ein Praesentationlayout
     135             : |* erstellen, der Aufrufer muss die Liste wieder loeschen
     136             : |*
     137             : \************************************************************************/
     138             : 
     139          60 : void SdStyleSheetPool::CreateOutlineSheetList (const String& rLayoutName, std::vector<SfxStyleSheetBase*> &rOutlineStyles)
     140             : {
     141          60 :     String aName(rLayoutName);
     142          60 :     aName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR ));
     143          60 :     aName += String(SdResId(STR_LAYOUT_OUTLINE));
     144             : 
     145         600 :     for (sal_uInt16 nSheet = 1; nSheet < 10; nSheet++)
     146             :     {
     147         540 :         String aFullName(aName);
     148         540 :         aFullName.Append( sal_Unicode( ' ' ));
     149         540 :         aFullName.Append( String::CreateFromInt32( (sal_Int32)nSheet ));
     150         540 :         SfxStyleSheetBase* pSheet = Find(aFullName, SD_STYLE_FAMILY_MASTERPAGE);
     151             : 
     152         540 :         if (pSheet)
     153         540 :             rOutlineStyles.push_back(pSheet);
     154         600 :     }
     155          60 : }
     156             : 
     157             : /*************************************************************************
     158             : |*
     159             : |* StyleSheets mit Defaultweren fuer das genannte Praesentationslayout erzeugen
     160             : |*
     161             : \************************************************************************/
     162             : 
     163          26 : void SdStyleSheetPool::CreateLayoutStyleSheets(const String& rLayoutName, sal_Bool bCheck /*= sal_False*/ )
     164             : {
     165          26 :     const sal_uInt16 nUsedMask = SFXSTYLEBIT_ALL & ~SFXSTYLEBIT_USERDEF;
     166             : 
     167             :     (void)bCheck;
     168          26 :     sal_Bool bCreated = sal_False;
     169             : 
     170          26 :     SfxStyleSheetBase* pSheet = NULL;
     171             : 
     172          26 :     String aPrefix(rLayoutName);
     173          26 :     String aSep( RTL_CONSTASCII_USTRINGPARAM( SD_LT_SEPARATOR ));
     174          26 :     aPrefix.Insert(aSep);
     175             : 
     176          26 :     Font aLatinFont, aCJKFont, aCTLFont;
     177             : 
     178          26 :     mpDoc->getDefaultFonts( aLatinFont, aCJKFont, aCTLFont );
     179             : 
     180             :     // Font fuer Titel und Gliederung
     181          26 :     SvxFontItem aSvxFontItem( aLatinFont.GetFamily(), aLatinFont.GetName(), aLatinFont.GetStyleName(), aLatinFont.GetPitch(),
     182          52 :                               aLatinFont.GetCharSet(), EE_CHAR_FONTINFO );
     183             : 
     184          26 :     SvxFontItem aSvxFontItemCJK( aCJKFont.GetFamily(), aCJKFont.GetName(), aCJKFont.GetStyleName(), aCJKFont.GetPitch(),
     185          52 :                                  aCJKFont.GetCharSet(), EE_CHAR_FONTINFO_CJK );
     186             : 
     187          26 :     SvxFontItem aSvxFontItemCTL( aCTLFont.GetFamily(), aCTLFont.GetName(), aCTLFont.GetStyleName(), aCTLFont.GetPitch(),
     188          52 :                                  aCTLFont.GetCharSet(), EE_CHAR_FONTINFO_CTL );
     189             : 
     190          26 :     Font aBulletFont( GetBulletFont() );
     191             : 
     192             :     /**************************************************************************
     193             :     * Gliederungsebenen
     194             :     **************************************************************************/
     195          26 :     String aName(SdResId(STR_LAYOUT_OUTLINE));
     196          26 :     String aHelpFile;
     197             : 
     198          26 :     SfxStyleSheetBase* pParent = NULL;
     199          26 :     SvxLRSpaceItem aSvxLRSpaceItem( EE_PARA_LRSPACE );
     200          26 :     SvxULSpaceItem aSvxULSpaceItem( EE_PARA_ULSPACE );
     201             :     sal_uInt16 nLevel;
     202             : 
     203         260 :     for( nLevel = 1; nLevel < 10; nLevel++)
     204             :     {
     205         234 :         String aLevelName(aName);
     206         234 :         aLevelName.Append( sal_Unicode( ' ' ));
     207         234 :         aLevelName.Append( String::CreateFromInt32( sal_Int32( nLevel )));
     208             : 
     209         234 :         aLevelName.Insert(aPrefix, 0);
     210             : 
     211         234 :         if (!Find(aLevelName, SD_STYLE_FAMILY_MASTERPAGE))
     212             :         {
     213         216 :             bCreated = sal_True;
     214         216 :             pSheet = &Make(aLevelName, SD_STYLE_FAMILY_MASTERPAGE,nUsedMask);
     215         216 :             pSheet->SetHelpId( aHelpFile, HID_PSEUDOSHEET_OUTLINE + nLevel );
     216             : 
     217         216 :             pSheet->SetParent( String() );
     218             : 
     219             :             // Attributierung fuer Level 1, die anderen Ebenen "erben"
     220         216 :             if (nLevel == 1)
     221             :             {
     222          24 :                 SfxItemSet&     rSet = pSheet->GetItemSet();
     223             : 
     224          24 :                 rSet.Put(aSvxFontItem);
     225          24 :                 rSet.Put(aSvxFontItemCJK);
     226          24 :                 rSet.Put(aSvxFontItemCTL);
     227          24 :                 rSet.Put( SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC ) );
     228          24 :                 rSet.Put( SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CJK ) );
     229          24 :                 rSet.Put( SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CTL ) );
     230          24 :                 rSet.Put( SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT ) );
     231          24 :                 rSet.Put( SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CJK ) );
     232          24 :                 rSet.Put( SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CTL ) );
     233          24 :                 rSet.Put( SvxUnderlineItem(UNDERLINE_NONE, EE_CHAR_UNDERLINE ) );
     234          24 :                 rSet.Put( SvxOverlineItem(UNDERLINE_NONE, EE_CHAR_OVERLINE ) );
     235          24 :                 rSet.Put( SvxCrossedOutItem(STRIKEOUT_NONE, EE_CHAR_STRIKEOUT ) );
     236          24 :                 rSet.Put( SvxShadowedItem(sal_False, EE_CHAR_SHADOW ) );
     237          24 :                 rSet.Put( SvxContourItem(sal_False, EE_CHAR_OUTLINE ) );
     238          24 :                 rSet.Put( SvxEmphasisMarkItem(EMPHASISMARK_NONE, EE_CHAR_EMPHASISMARK ) );
     239          24 :                 rSet.Put( SvxCharReliefItem(RELIEF_NONE, EE_CHAR_RELIEF) );
     240          24 :                 rSet.Put( SvxColorItem( Color(COL_AUTO), EE_CHAR_COLOR) );
     241          24 :                 rSet.Put( XLineStyleItem(XLINE_NONE) );
     242          24 :                 rSet.Put( XFillStyleItem(XFILL_NONE) );
     243          24 :                 rSet.Put( SdrTextFitToSizeTypeItem(SDRTEXTFIT_AUTOFIT) );
     244          24 :                 rSet.Put( SdrTextAutoGrowHeightItem(sal_False) );
     245             :                 // #i16874# enable kerning by default but only for new documents
     246          24 :                 rSet.Put( SvxAutoKernItem( sal_True, EE_CHAR_PAIRKERNING ) );
     247             : 
     248          24 :                 if( nLevel == 1 )
     249             :                 {
     250          24 :                     Font f( GetBulletFont() );
     251          24 :                     PutNumBulletItem( pSheet, f );
     252             :                 }
     253             :             }
     254             : 
     255         216 :             sal_uLong nFontSize = 20;
     256         216 :             sal_uInt16 nLower = 100;
     257             : 
     258         216 :             switch (nLevel)
     259             :             {
     260             :                 case 1:
     261             :                 {
     262          24 :                     nFontSize = 32;
     263          24 :                     nLower = 500;
     264             :                 }
     265          24 :                 break;
     266             : 
     267             :                 case 2:
     268             :                 {
     269          24 :                     nFontSize = 28;
     270          24 :                     nLower = 400;
     271             :                 }
     272          24 :                 break;
     273             : 
     274             :                 case 3:
     275             :                 {
     276          24 :                     nFontSize = 24;
     277          24 :                     nLower = 300;
     278             :                 }
     279          24 :                 break;
     280             : 
     281             :                 case 4:
     282             :                 {
     283          24 :                     nLower = 200;
     284             :                 }
     285          24 :                 break;
     286             :             }
     287             : 
     288             :             // FontSize
     289         216 :             nFontSize = (sal_uInt16)((nFontSize * 2540L) / 72);  // Pt --> 1/100 mm
     290         216 :             SfxItemSet& rOutlineSet = pSheet->GetItemSet();
     291         216 :             rOutlineSet.Put( SvxFontHeightItem( nFontSize, 100, EE_CHAR_FONTHEIGHT ) );
     292         216 :             rOutlineSet.Put( SvxFontHeightItem( nFontSize, 100, EE_CHAR_FONTHEIGHT_CJK ) );
     293         216 :             rOutlineSet.Put( SvxFontHeightItem( SdDrawDocument::convertFontHeightToCTL( nFontSize ), 100, EE_CHAR_FONTHEIGHT_CTL ) );
     294             : 
     295             :             // Line distance (downwards). Stuff around here cleaned up in i35937
     296         216 :             aSvxULSpaceItem.SetLower(nLower);
     297         216 :             pSheet->GetItemSet().Put(aSvxULSpaceItem);
     298             :         }
     299         234 :     }
     300             : 
     301             :     // if we created outline styles, we need to chain them
     302          26 :     if( bCreated )
     303             :     {
     304          24 :         pParent = NULL;
     305         240 :         for (nLevel = 1; nLevel < 10; nLevel++)
     306             :         {
     307         216 :             String aLevelName(aName);
     308         216 :             aLevelName.Append( sal_Unicode( ' ' ));
     309         216 :             aLevelName.Append( String::CreateFromInt32( sal_Int32( nLevel )));
     310             : 
     311         216 :             aLevelName.Insert(aPrefix, 0);
     312             : 
     313         216 :             pSheet = Find(aLevelName, SD_STYLE_FAMILY_MASTERPAGE);
     314             : 
     315             :             DBG_ASSERT( pSheet, "missing layout style!");
     316             : 
     317         216 :             if( pSheet )
     318             :             {
     319         216 :                 if (pParent)
     320         192 :                     pSheet->SetParent(pParent->GetName());
     321         216 :                 pParent = pSheet;
     322             :             }
     323         216 :         }
     324             :     }
     325             : 
     326             :     /**************************************************************************
     327             :     * Titel
     328             :     **************************************************************************/
     329          26 :     aName = String(SdResId(STR_LAYOUT_TITLE));
     330          26 :     aName.Insert(aPrefix, 0);
     331             : 
     332          26 :     if (!Find(aName, SD_STYLE_FAMILY_MASTERPAGE))
     333             :     {
     334          24 :         bCreated = sal_True;
     335             : 
     336          24 :         pSheet = &Make(aName, SD_STYLE_FAMILY_MASTERPAGE,nUsedMask);
     337          24 :         pSheet->SetHelpId( aHelpFile, HID_PSEUDOSHEET_TITLE );
     338          24 :         pSheet->SetParent(String());
     339          24 :         SfxItemSet& rTitleSet = pSheet->GetItemSet();
     340          24 :         rTitleSet.Put(XLineStyleItem(XLINE_NONE));
     341          24 :         rTitleSet.Put(XFillStyleItem(XFILL_NONE));
     342          24 :         rTitleSet.Put(aSvxFontItem);
     343          24 :         rTitleSet.Put(aSvxFontItemCJK);
     344          24 :         rTitleSet.Put(aSvxFontItemCTL);
     345          24 :         rTitleSet.Put(SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC ) );
     346          24 :         rTitleSet.Put(SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CJK ) );
     347          24 :         rTitleSet.Put(SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CTL ) );
     348          24 :         rTitleSet.Put(SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT ) );
     349          24 :         rTitleSet.Put(SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CJK ) );
     350          24 :         rTitleSet.Put(SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CTL ) );
     351          24 :         rTitleSet.Put(SvxFontHeightItem( 1552, 100, EE_CHAR_FONTHEIGHT ) );                 // 44 pt
     352          24 :         rTitleSet.Put(SvxFontHeightItem( 1552, 100, EE_CHAR_FONTHEIGHT_CJK ) );                 // 44 pt
     353          24 :         rTitleSet.Put(SvxFontHeightItem( SdDrawDocument::convertFontHeightToCTL( 1552 ), 100, EE_CHAR_FONTHEIGHT_CTL ) );                   // 44 pt
     354          24 :         rTitleSet.Put(SvxUnderlineItem(UNDERLINE_NONE, EE_CHAR_UNDERLINE ));
     355          24 :         rTitleSet.Put(SvxOverlineItem(UNDERLINE_NONE, EE_CHAR_OVERLINE ));
     356          24 :         rTitleSet.Put(SvxCrossedOutItem(STRIKEOUT_NONE, EE_CHAR_STRIKEOUT ));
     357          24 :         rTitleSet.Put(SvxShadowedItem(sal_False, EE_CHAR_SHADOW ));
     358          24 :         rTitleSet.Put(SvxContourItem(sal_False, EE_CHAR_OUTLINE ));
     359          24 :         rTitleSet.Put( SvxEmphasisMarkItem(EMPHASISMARK_NONE, EE_CHAR_EMPHASISMARK ) );
     360          24 :         rTitleSet.Put( SvxCharReliefItem(RELIEF_NONE, EE_CHAR_RELIEF ) );
     361          24 :         rTitleSet.Put(SvxColorItem( Color(COL_AUTO), EE_CHAR_COLOR ));
     362          24 :         rTitleSet.Put(SvxAdjustItem(SVX_ADJUST_CENTER, EE_PARA_JUST ));
     363          24 :         rTitleSet.Put( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_CENTER ) );
     364             :         // #i16874# enable kerning by default but only for new documents
     365          24 :         rTitleSet.Put( SvxAutoKernItem( sal_True, EE_CHAR_PAIRKERNING ) );
     366             : 
     367          24 :         aBulletFont.SetSize(Size(0,1552));                  // 44 pt
     368          24 :         PutNumBulletItem( pSheet, aBulletFont );
     369             :     }
     370             : 
     371             :     /**************************************************************************
     372             :     * Untertitel
     373             :     **************************************************************************/
     374          26 :     aName = String(SdResId(STR_LAYOUT_SUBTITLE));
     375          26 :     aName.Insert(aPrefix, 0);
     376             : 
     377          26 :     if (!Find(aName, SD_STYLE_FAMILY_MASTERPAGE))
     378             :     {
     379          24 :         bCreated = sal_True;
     380             : 
     381          24 :         pSheet = &Make(aName, SD_STYLE_FAMILY_MASTERPAGE,nUsedMask);
     382          24 :         pSheet->SetHelpId( aHelpFile, HID_PSEUDOSHEET_SUBTITLE );
     383          24 :         pSheet->SetParent(String());
     384          24 :         SfxItemSet& rSubtitleSet = pSheet->GetItemSet();
     385          24 :         rSubtitleSet.Put(XLineStyleItem(XLINE_NONE));
     386          24 :         rSubtitleSet.Put(XFillStyleItem(XFILL_NONE));
     387          24 :         rSubtitleSet.Put(aSvxFontItem);
     388          24 :         rSubtitleSet.Put(aSvxFontItemCJK);
     389          24 :         rSubtitleSet.Put(aSvxFontItemCTL);
     390          24 :         rSubtitleSet.Put(SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC ) );
     391          24 :         rSubtitleSet.Put(SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CJK ) );
     392          24 :         rSubtitleSet.Put(SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CTL ) );
     393          24 :         rSubtitleSet.Put(SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT ) );
     394          24 :         rSubtitleSet.Put(SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CJK ) );
     395          24 :         rSubtitleSet.Put(SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CTL ) );
     396          24 :         rSubtitleSet.Put( SvxFontHeightItem( 1129, 100, EE_CHAR_FONTHEIGHT ) );     // 32 pt
     397          24 :         rSubtitleSet.Put( SvxFontHeightItem( 1129, 100, EE_CHAR_FONTHEIGHT_CJK ) ); // 32 pt
     398          24 :         rSubtitleSet.Put( SvxFontHeightItem( SdDrawDocument::convertFontHeightToCTL( 1129 ), 100, EE_CHAR_FONTHEIGHT_CTL ) ); // 32 pt
     399          24 :         rSubtitleSet.Put(SvxUnderlineItem(UNDERLINE_NONE, EE_CHAR_UNDERLINE ));
     400          24 :         rSubtitleSet.Put(SvxOverlineItem(UNDERLINE_NONE, EE_CHAR_OVERLINE ));
     401          24 :         rSubtitleSet.Put(SvxCrossedOutItem(STRIKEOUT_NONE, EE_CHAR_STRIKEOUT ));
     402          24 :         rSubtitleSet.Put(SvxShadowedItem(sal_False, EE_CHAR_SHADOW ));
     403          24 :         rSubtitleSet.Put(SvxContourItem(sal_False, EE_CHAR_OUTLINE ));
     404          24 :         rSubtitleSet.Put( SvxEmphasisMarkItem(EMPHASISMARK_NONE, EE_CHAR_EMPHASISMARK ) );
     405          24 :         rSubtitleSet.Put( SvxCharReliefItem(RELIEF_NONE, EE_CHAR_RELIEF ) );
     406          24 :         rSubtitleSet.Put(SvxColorItem( Color(COL_AUTO), EE_CHAR_COLOR ));
     407          24 :         rSubtitleSet.Put(SvxAdjustItem(SVX_ADJUST_CENTER, EE_PARA_JUST ));
     408          24 :         rSubtitleSet.Put( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_CENTER ) );
     409             :         // #i16874# enable kerning by default but only for new documents
     410          24 :         rSubtitleSet.Put( SvxAutoKernItem( sal_True, EE_CHAR_PAIRKERNING ) );
     411          24 :         aSvxLRSpaceItem.SetTxtLeft(0);
     412          24 :         rSubtitleSet.Put(aSvxLRSpaceItem);
     413             : 
     414          24 :         Font aTmpFont( GetBulletFont() );
     415          24 :         aTmpFont.SetSize(Size(0, 1129));        // 32 pt
     416          24 :         PutNumBulletItem( pSheet, aTmpFont );
     417             :     }
     418             : 
     419             :     /**************************************************************************
     420             :     * Notizen
     421             :     **************************************************************************/
     422          26 :     aName = String(SdResId(STR_LAYOUT_NOTES));
     423          26 :     aName.Insert(aPrefix, 0);
     424             : 
     425          26 :     if (!Find(aName, SD_STYLE_FAMILY_MASTERPAGE))
     426             :     {
     427          24 :         bCreated = sal_True;
     428             : 
     429          24 :         pSheet = &Make(aName, SD_STYLE_FAMILY_MASTERPAGE,nUsedMask);
     430          24 :         pSheet->SetHelpId( aHelpFile, HID_PSEUDOSHEET_NOTES );
     431          24 :         pSheet->SetParent(String());
     432          24 :         SfxItemSet& rNotesSet = pSheet->GetItemSet();
     433          24 :         rNotesSet.Put(XLineStyleItem(XLINE_NONE));
     434          24 :         rNotesSet.Put(XFillStyleItem(XFILL_NONE));
     435          24 :         rNotesSet.Put(aSvxFontItem);
     436          24 :         rNotesSet.Put(aSvxFontItemCJK);
     437          24 :         rNotesSet.Put(aSvxFontItemCTL);
     438          24 :         rNotesSet.Put( SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC ) );
     439          24 :         rNotesSet.Put( SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CJK ) );
     440          24 :         rNotesSet.Put( SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CTL ) );
     441          24 :         rNotesSet.Put( SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT ) );
     442          24 :         rNotesSet.Put( SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CJK ) );
     443          24 :         rNotesSet.Put( SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CTL ) );
     444          24 :         rNotesSet.Put( SvxFontHeightItem( 705, 100, EE_CHAR_FONTHEIGHT ) );     // 20 pt
     445          24 :         rNotesSet.Put( SvxFontHeightItem( 705, 100, EE_CHAR_FONTHEIGHT_CJK ) ); // 20 pt
     446          24 :         rNotesSet.Put( SvxFontHeightItem( SdDrawDocument::convertFontHeightToCTL( 705 ), 100, EE_CHAR_FONTHEIGHT_CTL ) ); // 20 pt
     447          24 :         rNotesSet.Put( SvxUnderlineItem(UNDERLINE_NONE, EE_CHAR_UNDERLINE ) );
     448          24 :         rNotesSet.Put( SvxOverlineItem(UNDERLINE_NONE, EE_CHAR_OVERLINE ) );
     449          24 :         rNotesSet.Put( SvxCrossedOutItem(STRIKEOUT_NONE, EE_CHAR_STRIKEOUT ) );
     450          24 :         rNotesSet.Put( SvxShadowedItem(sal_False, EE_CHAR_SHADOW ) );
     451          24 :         rNotesSet.Put( SvxContourItem(sal_False, EE_CHAR_OUTLINE ) );
     452          24 :         rNotesSet.Put( SvxEmphasisMarkItem(EMPHASISMARK_NONE, EE_CHAR_EMPHASISMARK ) );
     453          24 :         rNotesSet.Put( SvxCharReliefItem(RELIEF_NONE, EE_CHAR_RELIEF) );
     454          24 :         rNotesSet.Put( SvxColorItem( Color(COL_AUTO), EE_CHAR_COLOR ) );
     455          24 :         rNotesSet.Put( SvxLRSpaceItem( 0, 0, 600, -600, EE_PARA_LRSPACE  ) );
     456             :         // #i16874# enable kerning by default but only for new documents
     457          24 :         rNotesSet.Put( SvxAutoKernItem( sal_True, EE_CHAR_PAIRKERNING ) );
     458             : 
     459             : /* #i35937# */
     460             : 
     461             :     }
     462             : 
     463             :     /**************************************************************************
     464             :     * Hintergrundobjekte
     465             :     **************************************************************************/
     466          26 :     aName = String(SdResId(STR_LAYOUT_BACKGROUNDOBJECTS));
     467          26 :     aName.Insert(aPrefix, 0);
     468             : 
     469          26 :     if (!Find(aName, SD_STYLE_FAMILY_MASTERPAGE))
     470             :     {
     471          24 :         bCreated = sal_True;
     472             : 
     473          24 :         pSheet = &Make(aName, SD_STYLE_FAMILY_MASTERPAGE,nUsedMask);
     474          24 :         pSheet->SetHelpId( aHelpFile, HID_PSEUDOSHEET_BACKGROUNDOBJECTS );
     475          24 :         pSheet->SetParent(String());
     476          24 :         SfxItemSet& rBackgroundObjectsSet = pSheet->GetItemSet();
     477          24 :         rBackgroundObjectsSet.Put(SdrShadowItem(sal_False));
     478          24 :         rBackgroundObjectsSet.Put(SdrShadowColorItem(String(), Color(COL_GRAY)));
     479          24 :         rBackgroundObjectsSet.Put(SdrShadowXDistItem(200)); // 3 mm Schattendistanz
     480          24 :         rBackgroundObjectsSet.Put(SdrShadowYDistItem(200));
     481             :         // #i16874# enable kerning by default but only for new documents
     482          24 :         rBackgroundObjectsSet.Put( SvxAutoKernItem( sal_True, EE_CHAR_PAIRKERNING ) );
     483          24 :         rBackgroundObjectsSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_BLOCK));
     484             :     }
     485             : 
     486             :     /**************************************************************************
     487             :     * Hintergrund
     488             :     **************************************************************************/
     489          26 :     aName = String(SdResId(STR_LAYOUT_BACKGROUND));
     490          26 :     aName.Insert(aPrefix, 0);
     491             : 
     492          26 :     if (!Find(aName, SD_STYLE_FAMILY_MASTERPAGE))
     493             :     {
     494          24 :         bCreated = sal_True;
     495             : 
     496          24 :         pSheet = &Make(aName, SD_STYLE_FAMILY_MASTERPAGE,nUsedMask);
     497          24 :         pSheet->SetHelpId( aHelpFile, HID_PSEUDOSHEET_BACKGROUND );
     498          24 :         pSheet->SetParent(String());
     499          24 :         SfxItemSet& rBackgroundSet = pSheet->GetItemSet();
     500          24 :         rBackgroundSet.Put(XLineStyleItem(XLINE_NONE));
     501          24 :         rBackgroundSet.Put(XFillStyleItem(XFILL_NONE));
     502             :         // #i16874# enable kerning by default but only for new documents
     503          24 :         rBackgroundSet.Put( SvxAutoKernItem( sal_True, EE_CHAR_PAIRKERNING ) );
     504             :     }
     505             : 
     506          26 :     DBG_ASSERT( !bCheck || !bCreated, "missing layout style sheets detected!" );
     507          26 : }
     508             : 
     509             : /*************************************************************************
     510             : |*
     511             : |* Graphik-StyleSheets  aus dem Quellpool in diesen Pool kopieren
     512             : |*
     513             : |* (rSourcePool kann nicht const sein, weil SfxStyleSheetPoolBase::Find
     514             : |*  nicht const ist)
     515             : |*
     516             : \************************************************************************/
     517             : 
     518           0 : void SdStyleSheetPool::CopyGraphicSheets(SdStyleSheetPool& rSourcePool)
     519             : {
     520           0 :     CopySheets( rSourcePool, SD_STYLE_FAMILY_GRAPHICS );
     521           0 : }
     522             : 
     523           0 : void SdStyleSheetPool::CopyCellSheets(SdStyleSheetPool& rSourcePool)
     524             : {
     525           0 :     CopySheets( rSourcePool, SD_STYLE_FAMILY_CELL );
     526           0 : }
     527             : 
     528           0 : void SdStyleSheetPool::CopyTableStyles(SdStyleSheetPool& rSourcePool)
     529             : {
     530           0 :     Reference< XIndexAccess > xSource( rSourcePool.mxTableFamily, UNO_QUERY );
     531           0 :     Reference< XNameContainer > xTarget( mxTableFamily, UNO_QUERY );
     532           0 :     Reference< XSingleServiceFactory > xFactory( mxTableFamily, UNO_QUERY );
     533             : 
     534           0 :     if( xSource.is() && xFactory.is() && mxTableFamily.is() )
     535             :     {
     536           0 :         for( sal_Int32 nIndex = 0; nIndex < xSource->getCount(); nIndex++ ) try
     537             :         {
     538           0 :             Reference< XStyle > xSourceTableStyle( xSource->getByIndex( nIndex ), UNO_QUERY );
     539           0 :             if( xSourceTableStyle.is() )
     540             :             {
     541           0 :                 Reference< XStyle > xNewTableStyle( xFactory->createInstance(), UNO_QUERY );
     542           0 :                 if( xNewTableStyle.is() )
     543             :                 {
     544           0 :                     Reference< XNameAccess> xSourceNames( xSourceTableStyle, UNO_QUERY_THROW );
     545             : 
     546           0 :                     Sequence< OUString > aStyleNames( xSourceNames->getElementNames() );
     547           0 :                     OUString* pStyleNames( aStyleNames.getArray() );
     548             : 
     549           0 :                     Reference< XNameReplace > xTargetNames( xNewTableStyle, UNO_QUERY );
     550             : 
     551           0 :                     sal_Int32 nNames = aStyleNames.getLength();
     552           0 :                     while( nNames-- )
     553             :                     {
     554           0 :                         const OUString aName( *pStyleNames++ );
     555           0 :                         Reference< XStyle > xSourceStyle( xSourceNames->getByName( aName ), UNO_QUERY );
     556           0 :                         Reference< XStyle > xTargetStyle;
     557           0 :                         if( xSourceStyle.is() ) try
     558             :                         {
     559           0 :                             mxCellFamily->getByName( xSourceStyle->getName() ) >>= xTargetStyle;
     560             :                         }
     561           0 :                         catch( Exception& )
     562             :                         {
     563             :                             OSL_FAIL( "sd::SdStyleSheetPool::CopyTableStyles(), exception caught!" );
     564             :                         }
     565             : 
     566           0 :                         if( xTargetStyle.is() )
     567           0 :                             xTargetNames->replaceByName( aName, Any( xTargetStyle ) );
     568           0 :                     }
     569             :                 }
     570             : 
     571           0 :                 OUString sName( Reference< XNamed >( xSourceTableStyle, UNO_QUERY_THROW )->getName() );
     572           0 :                 if( xTarget->hasByName( sName ) )
     573           0 :                     xTarget->replaceByName( sName, Any( xNewTableStyle ) );
     574             :                 else
     575           0 :                     xTarget->insertByName( sName, Any( xNewTableStyle ) );
     576           0 :             }
     577             :         }
     578           0 :         catch( Exception& )
     579             :         {
     580             :             OSL_FAIL("sd::SdStyleSheetPool::CopyTableStyles(), exception caught!");
     581             :         }
     582           0 :     }
     583           0 : }
     584             : 
     585           0 : void SdStyleSheetPool::CopySheets(SdStyleSheetPool& rSourcePool, SfxStyleFamily eFamily )
     586             : {
     587           0 :     String aHelpFile;
     588             : 
     589           0 :     sal_uInt32 nCount = rSourcePool.aStyles.size();
     590             : 
     591           0 :     std::vector< std::pair< rtl::Reference< SfxStyleSheetBase >, String > > aNewStyles;
     592             : 
     593           0 :     for (sal_uInt32 n = 0; n < nCount; n++)
     594             :     {
     595           0 :         rtl::Reference< SfxStyleSheetBase > xSheet( rSourcePool.aStyles[sal::static_int_cast<sal_uInt16>(n)] );
     596             : 
     597           0 :         if( xSheet->GetFamily() == eFamily )
     598             :         {
     599           0 :             String aName( xSheet->GetName() );
     600           0 :             if ( !Find( aName, eFamily ) )
     601             :             {
     602           0 :                 rtl::Reference< SfxStyleSheetBase > xNewSheet( &Make( aName, eFamily ) );
     603             : 
     604           0 :                 xNewSheet->SetMask( xSheet->GetMask() );
     605             : 
     606             :                 // Also set parent relation for copied style sheets
     607           0 :                 String aParent( xSheet->GetParent() );
     608           0 :                 if( aParent.Len() )
     609           0 :                     aNewStyles.push_back( std::pair< rtl::Reference< SfxStyleSheetBase >, String >( xNewSheet, aParent ) );
     610             : 
     611           0 :                 xNewSheet->SetHelpId( aHelpFile, xSheet->GetHelpId( aHelpFile ) );
     612           0 :                 xNewSheet->GetItemSet().Put( xSheet->GetItemSet() );
     613           0 :             }
     614             :         }
     615           0 :     }
     616             : 
     617             :     // set parents on newly added stylesheets
     618           0 :     std::vector< std::pair< rtl::Reference< SfxStyleSheetBase >, String > >::iterator aIter;
     619           0 :     for( aIter = aNewStyles.begin(); aIter != aNewStyles.end(); ++aIter )
     620             :     {
     621             :         DBG_ASSERT( rSourcePool.Find( (*aIter).second, eFamily ), "StyleSheet has invalid parent: Family mismatch" );
     622           0 :         (*aIter).first->SetParent( (*aIter).second );
     623           0 :     }
     624           0 : }
     625             : 
     626             : 
     627             : /*************************************************************************
     628             : |*
     629             : |* StyleSheets des genannten Praesentationslayouts aus dem Quellpool in diesen
     630             : |* Pool kopieren. Kopiert werden nur solche StyleSheets, die in diesem Pool
     631             : |* noch nicht vorhanden sind.
     632             : |* pCreatedSheets wird - wenn ungleich NULL - mit Zeigern auf die erzeugten
     633             : |* StyleSheets gefuellt.
     634             : |*
     635             : |* (rSourcePool kann nicht const sein, weil SfxStyleSheetPoolBase::Find
     636             : |*  nicht const ist)
     637             : |*
     638             : \************************************************************************/
     639             : 
     640           0 : void SdStyleSheetPool::CopyLayoutSheets(const String& rLayoutName, SdStyleSheetPool& rSourcePool, SdStyleSheetVector& rCreatedSheets)
     641             : {
     642           0 :     SfxStyleSheetBase* pSheet = NULL;
     643             : 
     644           0 :     String aOutlineTag(SdResId(STR_LAYOUT_OUTLINE));
     645             : 
     646           0 :     std::vector<String> aNameList;
     647           0 :     CreateLayoutSheetNames(rLayoutName,aNameList);
     648             : 
     649           0 :     String sEmpty;
     650           0 :     for (std::vector<String>::const_iterator it = aNameList.begin(); it != aNameList.end(); ++it)
     651             :     {
     652           0 :         pSheet = Find(*it, SD_STYLE_FAMILY_MASTERPAGE);
     653           0 :         if (!pSheet)
     654             :         {
     655           0 :             SfxStyleSheetBase* pSourceSheet = rSourcePool.Find(*it, SD_STYLE_FAMILY_MASTERPAGE);
     656             :             DBG_ASSERT(pSourceSheet, "CopyLayoutSheets: Quellvorlage nicht gefunden");
     657           0 :             if (pSourceSheet)
     658             :             {
     659             :                 // falls einer mit Methusalem-Doks. ankommt
     660           0 :                 SfxStyleSheetBase& rNewSheet = Make(*it, SD_STYLE_FAMILY_MASTERPAGE);
     661           0 :                 rNewSheet.SetHelpId( sEmpty, pSourceSheet->GetHelpId( sEmpty ) );
     662           0 :                 rNewSheet.GetItemSet().Put(pSourceSheet->GetItemSet());
     663           0 :                 rCreatedSheets.push_back( SdStyleSheetRef( static_cast< SdStyleSheet* >( &rNewSheet ) ) );
     664             :             }
     665             :         }
     666             :     }
     667             : 
     668             :     // Sonderbehandlung fuer Gliederungsvorlagen: Parentbeziehungen aufbauen
     669           0 :     std::vector<SfxStyleSheetBase*> aOutlineSheets;
     670           0 :     CreateOutlineSheetList(rLayoutName,aOutlineSheets);
     671             : 
     672           0 :     if( !aOutlineSheets.empty() )
     673             :     {
     674           0 :         std::vector<SfxStyleSheetBase*>::iterator it = aOutlineSheets.begin();
     675           0 :         SfxStyleSheetBase* pParent = *it;
     676           0 :         ++it;
     677             : 
     678           0 :         while (it != aOutlineSheets.end())
     679             :         {
     680           0 :             pSheet = *it;
     681             : 
     682           0 :             if (!pSheet)
     683           0 :                 break;
     684             : 
     685           0 :             if (pSheet->GetParent().Len() == 0)
     686           0 :                 pSheet->SetParent(pParent->GetName());
     687             : 
     688           0 :             pParent = pSheet;
     689             : 
     690           0 :             ++it;
     691             :         }
     692           0 :     }
     693           0 : }
     694             : 
     695             : /*************************************************************************
     696             : |*
     697             : |* Liste mit den Namen der Praesentationsvorlagen eines Layouts erzeugen.
     698             : |* Die Liste und die enthaltenen Strings gehoeren dem Caller!
     699             : |*
     700             : \************************************************************************/
     701             : 
     702           0 : void SdStyleSheetPool::CreateLayoutSheetNames(const String& rLayoutName, std::vector<String> &aNameList) const
     703             : {
     704           0 :     String aPrefix(rLayoutName);
     705           0 :     String aSep( RTL_CONSTASCII_USTRINGPARAM( SD_LT_SEPARATOR ));
     706           0 :     aPrefix.Insert(aSep);
     707             : 
     708           0 :     String aName(SdResId(STR_LAYOUT_OUTLINE));
     709           0 :     String aStr;
     710             : 
     711           0 :     for (sal_uInt16 nLevel = 1; nLevel < 10; nLevel++)
     712             :     {
     713           0 :         aStr = String( aPrefix );
     714           0 :         aStr.Append(aName);
     715           0 :         aStr.Append( sal_Unicode( ' ' ));
     716           0 :         aStr.Append( String::CreateFromInt32( sal_Int32( nLevel )));
     717           0 :         aNameList.push_back(aStr);
     718             :     }
     719             : 
     720           0 :     aStr = String(SdResId(STR_LAYOUT_TITLE));
     721           0 :     aStr.Insert(aPrefix, 0);
     722           0 :     aNameList.push_back(aStr);
     723             : 
     724           0 :     aStr = String(SdResId(STR_LAYOUT_SUBTITLE));
     725           0 :     aStr.Insert(aPrefix, 0);
     726           0 :     aNameList.push_back(aStr);
     727             : 
     728           0 :     aStr = String(SdResId(STR_LAYOUT_NOTES));
     729           0 :     aStr.Insert(aPrefix, 0);
     730           0 :     aNameList.push_back(aStr);
     731             : 
     732           0 :     aStr = String(SdResId(STR_LAYOUT_BACKGROUNDOBJECTS));
     733           0 :     aStr.Insert(aPrefix, 0);
     734           0 :     aNameList.push_back(aStr);
     735             : 
     736           0 :     aStr = String(SdResId(STR_LAYOUT_BACKGROUND));
     737           0 :     aStr.Insert(aPrefix, 0);
     738           0 :     aNameList.push_back(aStr);
     739           0 : }
     740             : 
     741             : /*************************************************************************
     742             : |*
     743             : |* Liste mit Zeigern auf Praesentationsvorlagen eines Layouts erzeugen.
     744             : |* Die Liste gehoert dem Caller!
     745             : |*
     746             : \************************************************************************/
     747             : 
     748           0 : void SdStyleSheetPool::CreateLayoutSheetList(const String& rLayoutName, SdStyleSheetVector& rLayoutSheets )
     749             : {
     750           0 :     String aLayoutNameWithSep(rLayoutName);
     751           0 :     aLayoutNameWithSep.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR ));
     752           0 :     sal_uInt16 nLen = aLayoutNameWithSep.Len();
     753             : 
     754           0 :     SfxStyleSheetIterator aIter(this, SD_STYLE_FAMILY_MASTERPAGE);
     755           0 :     SfxStyleSheetBase* pSheet = aIter.First();
     756             : 
     757           0 :     while (pSheet)
     758             :     {
     759           0 :         if (pSheet->GetName().Match(aLayoutNameWithSep) == nLen)
     760           0 :             rLayoutSheets.push_back( SdStyleSheetRef( static_cast< SdStyleSheet* >( pSheet ) ) );
     761           0 :         pSheet = aIter.Next();
     762           0 :     }
     763           0 : }
     764             : 
     765             : /*************************************************************************
     766             : |*
     767             : |* ggfs. PseudoStyleSheets erzeugen
     768             : |*
     769             : \************************************************************************/
     770             : 
     771          26 : void SdStyleSheetPool::CreatePseudosIfNecessary()
     772             : {
     773          26 :     String aName;
     774          26 :     String aHelpFile;
     775          26 :     SfxStyleSheetBase* pSheet = NULL;
     776          26 :     SfxStyleSheetBase* pParent = NULL;
     777             : 
     778          26 :     sal_uInt16 nUsedMask = SFXSTYLEBIT_USED;
     779             : 
     780          26 :     aName = String(SdResId(STR_PSEUDOSHEET_TITLE));
     781          26 :     if( (pSheet = Find(aName, SD_STYLE_FAMILY_PSEUDO)) == 0 )
     782             :     {
     783          24 :         pSheet = &Make(aName, SD_STYLE_FAMILY_PSEUDO, nUsedMask);
     784          24 :         pSheet->SetParent( String() );
     785          24 :         ((SfxStyleSheet*)pSheet)->StartListening(*this);
     786             :     }
     787          26 :     pSheet->SetHelpId( aHelpFile, HID_PSEUDOSHEET_TITLE );
     788             : 
     789          26 :     aName = String(SdResId(STR_PSEUDOSHEET_SUBTITLE));
     790          26 :     if( (pSheet = Find(aName, SD_STYLE_FAMILY_PSEUDO)) == 0 )
     791             :     {
     792          24 :         pSheet = &Make(aName, SD_STYLE_FAMILY_PSEUDO, nUsedMask);
     793          24 :         pSheet->SetParent(String());
     794          24 :         ((SfxStyleSheet*)pSheet)->StartListening(*this);
     795             :     }
     796          26 :     pSheet->SetHelpId( aHelpFile, HID_PSEUDOSHEET_SUBTITLE );
     797             : 
     798          26 :     aName = String(SdResId(STR_PSEUDOSHEET_BACKGROUNDOBJECTS));
     799          26 :     if( (pSheet = Find(aName, SD_STYLE_FAMILY_PSEUDO)) == 0 )
     800             :     {
     801          24 :         pSheet = &Make(aName, SD_STYLE_FAMILY_PSEUDO, nUsedMask);
     802          24 :         pSheet->SetParent( String() );
     803          24 :         ((SfxStyleSheet*)pSheet)->StartListening(*this);
     804             :     }
     805          26 :     pSheet->SetHelpId( aHelpFile, HID_PSEUDOSHEET_BACKGROUNDOBJECTS );
     806             : 
     807          26 :     aName = String(SdResId(STR_PSEUDOSHEET_BACKGROUND));
     808          26 :     if( (pSheet = Find(aName, SD_STYLE_FAMILY_PSEUDO)) == 0 )
     809             :     {
     810          24 :         pSheet = &Make(aName, SD_STYLE_FAMILY_PSEUDO, nUsedMask);
     811          24 :         pSheet->SetParent( String() );
     812          24 :         ((SfxStyleSheet*)pSheet)->StartListening(*this);
     813             :     }
     814          26 :     pSheet->SetHelpId( aHelpFile, HID_PSEUDOSHEET_BACKGROUND );
     815             : 
     816          26 :     aName = String(SdResId(STR_PSEUDOSHEET_NOTES));
     817          26 :     if( (pSheet = Find(aName, SD_STYLE_FAMILY_PSEUDO)) == 0 )
     818             :     {
     819          24 :         pSheet = &Make(aName, SD_STYLE_FAMILY_PSEUDO, nUsedMask);
     820          24 :         pSheet->SetParent( String() );
     821          24 :         ((SfxStyleSheet*)pSheet)->StartListening(*this);
     822             :     }
     823          26 :     pSheet->SetHelpId( aHelpFile, HID_PSEUDOSHEET_NOTES );
     824             : 
     825          26 :     pParent = NULL;
     826          26 :     SetSearchMask(SD_STYLE_FAMILY_PSEUDO);
     827          26 :     aName = String(SdResId(STR_PSEUDOSHEET_OUTLINE));
     828         260 :     for (sal_uInt16 nLevel = 1; nLevel < 10; nLevel++)
     829             :     {
     830         234 :         String aLevelName(aName);
     831         234 :         aLevelName.Append( sal_Unicode( ' ' ));
     832         234 :         aLevelName.Append( String::CreateFromInt32( sal_Int32( nLevel )));
     833             : 
     834         234 :         if( (pSheet = Find(aLevelName, SD_STYLE_FAMILY_PSEUDO)) == 0 )
     835             :         {
     836         216 :             pSheet = &Make(aLevelName, SD_STYLE_FAMILY_PSEUDO, nUsedMask);
     837             : 
     838         216 :             if (pSheet)
     839             :             {
     840         216 :                 if (pParent)
     841         192 :                     pSheet->SetParent(pParent->GetName());
     842         216 :                 pParent = pSheet;
     843         216 :                 ((SfxStyleSheet*)pSheet)->StartListening(*this);
     844             :             }
     845             :         }
     846         234 :         pSheet->SetHelpId( aHelpFile, HID_PSEUDOSHEET_OUTLINE + nLevel );
     847         260 :     }
     848          26 : }
     849             : 
     850             : 
     851             : /*************************************************************************
     852             : |*
     853             : |* Standard-Styles den richtigen Namen in der Programm-Sprache geben
     854             : |*
     855             : \************************************************************************/
     856             : 
     857           0 : void SdStyleSheetPool::UpdateStdNames()
     858             : {
     859           0 :     String aHelpFile;
     860           0 :     sal_uInt32  nCount = aStyles.size();
     861           0 :     std::vector<SfxStyleSheetBase*> aEraseList;
     862             : 
     863           0 :     for( sal_uInt32 n=0; n < nCount; n++ )
     864             :     {
     865           0 :         SfxStyleSheetBase* pStyle = aStyles[ n ].get();
     866             : 
     867           0 :         if( !pStyle->IsUserDefined() )
     868             :         {
     869           0 :             String aOldName     = pStyle->GetName();
     870           0 :             sal_uLong nHelpId       = pStyle->GetHelpId( aHelpFile );
     871           0 :             SfxStyleFamily eFam = pStyle->GetFamily();
     872             : 
     873           0 :             sal_Bool bHelpKnown = sal_True;
     874           0 :             String aNewName;
     875           0 :             sal_uInt16 nNameId = 0;
     876           0 :             switch( nHelpId )
     877             :             {
     878           0 :                 case HID_STANDARD_STYLESHEET_NAME:  nNameId = STR_STANDARD_STYLESHEET_NAME; break;
     879           0 :                 case HID_POOLSHEET_OBJWITHARROW:    nNameId = STR_POOLSHEET_OBJWITHARROW;   break;
     880           0 :                 case HID_POOLSHEET_OBJWITHSHADOW:   nNameId = STR_POOLSHEET_OBJWITHSHADOW;  break;
     881           0 :                 case HID_POOLSHEET_OBJWITHOUTFILL:  nNameId = STR_POOLSHEET_OBJWITHOUTFILL; break;
     882           0 :                 case HID_POOLSHEET_TEXT:            nNameId = STR_POOLSHEET_TEXT;           break;
     883           0 :                 case HID_POOLSHEET_TEXTBODY:        nNameId = STR_POOLSHEET_TEXTBODY;       break;
     884           0 :                 case HID_POOLSHEET_TEXTBODY_JUSTIFY:nNameId = STR_POOLSHEET_TEXTBODY_JUSTIFY;break;
     885           0 :                 case HID_POOLSHEET_TEXTBODY_INDENT: nNameId = STR_POOLSHEET_TEXTBODY_INDENT;break;
     886           0 :                 case HID_POOLSHEET_TITLE:           nNameId = STR_POOLSHEET_TITLE;          break;
     887           0 :                 case HID_POOLSHEET_TITLE1:          nNameId = STR_POOLSHEET_TITLE1;         break;
     888           0 :                 case HID_POOLSHEET_TITLE2:          nNameId = STR_POOLSHEET_TITLE2;         break;
     889           0 :                 case HID_POOLSHEET_HEADLINE:        nNameId = STR_POOLSHEET_HEADLINE;       break;
     890           0 :                 case HID_POOLSHEET_HEADLINE1:       nNameId = STR_POOLSHEET_HEADLINE1;      break;
     891           0 :                 case HID_POOLSHEET_HEADLINE2:       nNameId = STR_POOLSHEET_HEADLINE2;      break;
     892           0 :                 case HID_POOLSHEET_MEASURE:         nNameId = STR_POOLSHEET_MEASURE;        break;
     893             : 
     894           0 :                 case HID_PSEUDOSHEET_TITLE:         nNameId = STR_PSEUDOSHEET_TITLE;        break;
     895           0 :                 case HID_PSEUDOSHEET_SUBTITLE:      nNameId = STR_PSEUDOSHEET_SUBTITLE;     break;
     896             :                 case HID_PSEUDOSHEET_OUTLINE1:
     897             :                 case HID_PSEUDOSHEET_OUTLINE2:
     898             :                 case HID_PSEUDOSHEET_OUTLINE3:
     899             :                 case HID_PSEUDOSHEET_OUTLINE4:
     900             :                 case HID_PSEUDOSHEET_OUTLINE5:
     901             :                 case HID_PSEUDOSHEET_OUTLINE6:
     902             :                 case HID_PSEUDOSHEET_OUTLINE7:
     903             :                 case HID_PSEUDOSHEET_OUTLINE8:
     904           0 :                 case HID_PSEUDOSHEET_OUTLINE9:      nNameId = STR_PSEUDOSHEET_OUTLINE;      break;
     905           0 :                 case HID_PSEUDOSHEET_BACKGROUNDOBJECTS: nNameId = STR_PSEUDOSHEET_BACKGROUNDOBJECTS; break;
     906           0 :                 case HID_PSEUDOSHEET_BACKGROUND:    nNameId = STR_PSEUDOSHEET_BACKGROUND;   break;
     907           0 :                 case HID_PSEUDOSHEET_NOTES:         nNameId = STR_PSEUDOSHEET_NOTES;        break;
     908             : 
     909           0 :                 case HID_SD_CELL_STYLE_DEFAULT:         nNameId = STR_STANDARD_STYLESHEET_NAME; break;
     910           0 :                 case HID_SD_CELL_STYLE_BANDED:          nNameId = STR_POOLSHEET_BANDED_CELL; break;
     911           0 :                 case HID_SD_CELL_STYLE_HEADER:          nNameId = STR_POOLSHEET_HEADER; break;
     912           0 :                 case HID_SD_CELL_STYLE_TOTAL:           nNameId = STR_POOLSHEET_TOTAL; break;
     913           0 :                 case HID_SD_CELL_STYLE_FIRST_COLUMN:    nNameId = STR_POOLSHEET_FIRST_COLUMN; break;
     914           0 :                 case HID_SD_CELL_STYLE_LAST_COLUMN:     nNameId = STR_POOLSHEET_LAST_COLUMN; break;
     915             : 
     916             :                 default:
     917             :                     // 0 oder falsche (alte) HelpId
     918           0 :                     bHelpKnown = sal_False;
     919             :             }
     920           0 :             if( bHelpKnown )
     921             :             {
     922           0 :                 if( nNameId )
     923             :                 {
     924           0 :                     aNewName = String( SdResId( nNameId ) );
     925           0 :                     if( nNameId == STR_PSEUDOSHEET_OUTLINE )
     926             :                     {
     927           0 :                         aNewName.Append( sal_Unicode( ' ' ));
     928           0 :                         aNewName.Append( String::CreateFromInt32( sal_Int32( nHelpId - HID_PSEUDOSHEET_OUTLINE )));
     929             :                     }
     930             :                 }
     931             : 
     932           0 :                 if( aNewName.Len() && aNewName != aOldName )
     933             :                 {
     934           0 :                     SfxStyleSheetBase* pSheetFound = Find( aNewName, eFam );
     935             : 
     936           0 :                     if ( !pSheetFound )
     937             :                     {
     938             :                         // Sheet existiert noch nicht: Altes Sheet wird umbenannt
     939           0 :                         pStyle->SetName( aNewName );    // setzt auch Parents um
     940             :                     }
     941             :                     else
     942             :                     {
     943             :                         // Sheet existiert schon: Altes Sheet muss entfernt werden
     944           0 :                         aEraseList.push_back( pStyle );
     945             :                     }
     946             :                 }
     947           0 :             }
     948             :         }
     949             :     }
     950             : 
     951             :     // Styles, welche nicht umbenannt werden konnten, muessen entfernt werden
     952           0 :     for ( size_t i = 0, n = aEraseList.size(); i < n; ++i )
     953           0 :         Remove( aEraseList[ i ] );
     954           0 : }
     955             : // --------------------------------------------------------------------
     956             : // Neues SvxNumBulletItem fuer das jeweilige StyleSheet setzen
     957             : // --------------------------------------------------------------------
     958             : 
     959         112 : void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet,
     960             :                                          Font& rBulletFont )
     961             : {
     962         112 :     String aHelpFile;
     963         112 :     sal_uLong nHelpId = pSheet->GetHelpId( aHelpFile );
     964         112 :     SfxItemSet& rSet = pSheet->GetItemSet();
     965             : 
     966         112 :     switch ( nHelpId )
     967             :     {
     968             :         case HID_STANDARD_STYLESHEET_NAME :
     969             :         {
     970             :             // Standard-Vorlage
     971          30 :             SvxNumberFormat aNumberFormat(SVX_NUM_CHAR_SPECIAL);
     972          30 :             aNumberFormat.SetBulletFont(&rBulletFont);
     973          30 :             aNumberFormat.SetBulletChar( 0x25CF ); // StarBats: 0xF000 + 34
     974          30 :             aNumberFormat.SetBulletRelSize(45);
     975          30 :             aNumberFormat.SetBulletColor(Color(COL_AUTO));
     976          30 :             aNumberFormat.SetStart(1);
     977          30 :             aNumberFormat.SetNumAdjust(SVX_ADJUST_LEFT);
     978             : 
     979          30 :             SvxNumRule aNumRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, 10 , sal_False);
     980             : 
     981         330 :             for( sal_uInt16 i = 0; i < aNumRule.GetLevelCount(); i++ )
     982             :             {
     983         300 :                 const short nLSpace = (i + 1) * 600;
     984         300 :                 aNumberFormat.SetLSpace(nLSpace);
     985         300 :                 aNumberFormat.SetAbsLSpace(nLSpace);
     986         300 :                 aNumberFormat.SetFirstLineOffset(-600);
     987         300 :                 aNumRule.SetLevel( i, aNumberFormat );
     988             :             }
     989             : 
     990          30 :             rSet.Put( SvxNumBulletItem( aNumRule, EE_PARA_NUMBULLET ) );
     991          30 :             ((SfxStyleSheet*)pSheet)->Broadcast(SfxSimpleHint( SFX_HINT_DATACHANGED ) );
     992             :         }
     993          30 :         break;
     994             : 
     995             :         case HID_PSEUDOSHEET_TITLE:
     996             :             /* title gets same bullet as subtitle and not that page symbol anymore */
     997             :         case HID_PSEUDOSHEET_SUBTITLE :
     998             :         {
     999             :             // Untertitel-Vorlage
    1000          52 :             SvxNumRule* pDefaultRule = ((SvxNumBulletItem*) rSet.GetPool()->GetSecondaryPool()->GetPoolDefaultItem(EE_PARA_NUMBULLET))->GetNumRule();
    1001             :             DBG_ASSERT( pDefaultRule, "Wo ist mein Default? [CL]" );
    1002             : 
    1003          52 :             if(pDefaultRule)
    1004             :             {
    1005          52 :                 SvxNumRule aNumRule(pDefaultRule->GetFeatureFlags(), 10, sal_False);
    1006         572 :                 for(sal_uInt16 i=0; i < aNumRule.GetLevelCount(); i++)
    1007             :                 {
    1008         520 :                     SvxNumberFormat aFrmt( pDefaultRule->GetLevel(i) );
    1009         520 :                     aFrmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
    1010             :                     // #i93908# clear suffix for bullet lists
    1011         520 :                     aFrmt.SetPrefix(::rtl::OUString());
    1012         520 :                     aFrmt.SetSuffix(::rtl::OUString());
    1013         520 :                     aFrmt.SetStart(1);
    1014         520 :                     aFrmt.SetBulletRelSize(45);
    1015         520 :                     aFrmt.SetBulletChar( 0x25CF );  // StarBats: 0xF000 + 34
    1016         520 :                     aFrmt.SetBulletFont(&rBulletFont);
    1017         520 :                     aNumRule.SetLevel(i, aFrmt);
    1018         520 :                 }
    1019             : 
    1020          52 :                 rSet.Put( SvxNumBulletItem( aNumRule, EE_PARA_NUMBULLET ) );
    1021          52 :                 ((SfxStyleSheet*)pSheet)->Broadcast(SfxSimpleHint( SFX_HINT_DATACHANGED ) );
    1022             :             }
    1023             :         }
    1024          52 :         break;
    1025             : 
    1026             :         case HID_PSEUDOSHEET_OUTLINE + 1 :
    1027             :         {
    1028             :             // Gliederungs-Vorlage
    1029          26 :             SvxNumberFormat aNumberFormat(SVX_NUM_CHAR_SPECIAL);
    1030          26 :             aNumberFormat.SetBulletColor(Color(COL_AUTO));
    1031          26 :             aNumberFormat.SetStart(1);
    1032          26 :             aNumberFormat.SetNumAdjust(SVX_ADJUST_LEFT);
    1033             : 
    1034             :             SvxNumRule aNumRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE|NUM_SYMBOL_ALIGNMENT,
    1035          26 :                                  10, sal_False );
    1036         286 :             for( sal_uInt16 i = 0; i < aNumRule.GetLevelCount(); i++ )
    1037             :             {
    1038         260 :                 aNumberFormat.SetBulletChar( 0x25CF );  // StarBats: 0xF000 + 34
    1039         260 :                 aNumberFormat.SetBulletRelSize(45);
    1040         260 :                 const short nLSpace = (i + 1) * 1200;
    1041         260 :                 aNumberFormat.SetLSpace(nLSpace);
    1042         260 :                 aNumberFormat.SetAbsLSpace(nLSpace);
    1043         260 :                 short nFirstLineOffset = -600;
    1044             : 
    1045         260 :                 sal_uLong nFontSize = 20;
    1046         260 :                 switch(i)
    1047             :                 {
    1048             :                     case 0:
    1049             :                     {
    1050          26 :                         nFontSize = 32;
    1051          26 :                         nFirstLineOffset = -900;
    1052             :                     }
    1053          26 :                     break;
    1054             : 
    1055             :                     case 1:
    1056             :                     {
    1057          26 :                         aNumberFormat.SetBulletChar( 0x2013 );  // StarBats: 0xF000 + 150
    1058          26 :                         aNumberFormat.SetBulletRelSize(75);
    1059          26 :                         nFontSize = 32;
    1060          26 :                         nFirstLineOffset = -900;
    1061             :                     }
    1062          26 :                     break;
    1063             : 
    1064             :                     case 2:
    1065             :                     {
    1066          26 :                         nFontSize = 28;
    1067          26 :                         nFirstLineOffset = -800;
    1068             :                     }
    1069          26 :                     break;
    1070             : 
    1071             :                     case 3:
    1072             :                     {
    1073          26 :                         aNumberFormat.SetBulletChar( 0x2013 );  // StarBats: 0xF000 + 150
    1074          26 :                         aNumberFormat.SetBulletRelSize(75);
    1075          26 :                         nFontSize = 24;
    1076             :                     }
    1077          26 :                     break;
    1078             :                 }
    1079             : 
    1080         260 :                 aNumberFormat.SetFirstLineOffset(nFirstLineOffset);
    1081         260 :                 nFontSize = (sal_uInt16)((nFontSize * 2540L) / 72);  // Pt --> 1/100 mm
    1082         260 :                 rBulletFont.SetSize(Size(0,846));       // 24 pt
    1083         260 :                 aNumberFormat.SetBulletFont(&rBulletFont);
    1084         260 :                 aNumRule.SetLevel( i, aNumberFormat );
    1085             :             }
    1086             : 
    1087          26 :             rSet.Put( SvxNumBulletItem( aNumRule, EE_PARA_NUMBULLET ) );
    1088          26 :             ((SfxStyleSheet*)pSheet)->Broadcast(SfxSimpleHint( SFX_HINT_DATACHANGED ) );
    1089             :         }
    1090          26 :         break;
    1091         112 :     }
    1092         112 : }
    1093             : 
    1094             : /*************************************************************************
    1095             : |*
    1096             : |* Standard Bullet-Font erzeugen (ohne Groesse)
    1097             : |*
    1098             : \************************************************************************/
    1099             : 
    1100         140 : Font SdStyleSheetPool::GetBulletFont() const
    1101             : {
    1102         140 :     Font aBulletFont( OUString( "StarSymbol" ), Size(0, 1000) );
    1103         140 :     aBulletFont.SetCharSet(RTL_TEXTENCODING_UNICODE);
    1104         140 :     aBulletFont.SetWeight(WEIGHT_NORMAL);
    1105         140 :     aBulletFont.SetUnderline(UNDERLINE_NONE);
    1106         140 :     aBulletFont.SetOverline(UNDERLINE_NONE);
    1107         140 :     aBulletFont.SetStrikeout(STRIKEOUT_NONE);
    1108         140 :     aBulletFont.SetItalic(ITALIC_NONE);
    1109         140 :     aBulletFont.SetOutline(sal_False);
    1110         140 :     aBulletFont.SetShadow(sal_False);
    1111         140 :     aBulletFont.SetColor(Color(COL_AUTO));
    1112         140 :     aBulletFont.SetTransparent(sal_True);
    1113             : 
    1114         140 :     return aBulletFont;
    1115             : }
    1116             : 
    1117             : // --------------------------------------------------------------------
    1118             : 
    1119          34 : void SdStyleSheetPool::AddStyleFamily( const SdPage* pPage )
    1120             : {
    1121          34 :     rtl::Reference< SfxStyleSheetPool > xPool( this );
    1122          34 :     maStyleFamilyMap[pPage] = new SdStyleFamily( xPool, pPage );
    1123          34 : }
    1124             : 
    1125             : // --------------------------------------------------------------------
    1126             : 
    1127          20 : void SdStyleSheetPool::RemoveStyleFamily( const SdPage* pPage )
    1128             : {
    1129          20 :     SdStyleFamilyMap::iterator iter( maStyleFamilyMap.find( pPage ) );
    1130          20 :     if( iter != maStyleFamilyMap.end() )
    1131             :     {
    1132          20 :         SdStyleFamilyRef xStyle( (*iter).second );
    1133          20 :         maStyleFamilyMap.erase( iter );
    1134             : 
    1135          20 :         if( xStyle.is() ) try
    1136             :         {
    1137          20 :             xStyle->dispose();
    1138             :         }
    1139           0 :         catch( Exception& )
    1140             :         {
    1141          20 :         }
    1142             :     }
    1143          20 : }
    1144             : 
    1145             : // --------------------------------------------------------------------
    1146             : 
    1147         370 : void SdStyleSheetPool::throwIfDisposed() throw(::com::sun::star::uno::RuntimeException)
    1148             : {
    1149         370 :     if( mpDoc == NULL )
    1150           0 :         throw DisposedException();
    1151         370 : }
    1152             : 
    1153             : // --------------------------------------------------------------------
    1154             : // XServiceInfo
    1155             : // --------------------------------------------------------------------
    1156             : 
    1157           0 : OUString SAL_CALL SdStyleSheetPool::getImplementationName() throw(RuntimeException)
    1158             : {
    1159           0 :     return OUString( "SdStyleSheetPool" );
    1160             : }
    1161             : 
    1162             : // --------------------------------------------------------------------
    1163             : 
    1164             : static const sal_Char* gpServiceName = "com.sun.star.style.StyleFamilies";
    1165             : 
    1166           0 : sal_Bool SAL_CALL SdStyleSheetPool::supportsService( const OUString& ServiceName ) throw(RuntimeException)
    1167             : {
    1168           0 :     return ServiceName.equalsAscii( gpServiceName );
    1169             : }
    1170             : 
    1171             : // --------------------------------------------------------------------
    1172             : 
    1173           0 : Sequence< OUString > SAL_CALL SdStyleSheetPool::getSupportedServiceNames() throw(RuntimeException)
    1174             : {
    1175           0 :     OUString aStr( OUString::createFromAscii( gpServiceName ) );
    1176           0 :     return Sequence< OUString >( &aStr, 1 );
    1177             : }
    1178             : 
    1179             : // --------------------------------------------------------------------
    1180             : // XNameAccess
    1181             : // --------------------------------------------------------------------
    1182             : 
    1183         294 : Any SAL_CALL SdStyleSheetPool::getByName( const OUString& aName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException)
    1184             : {
    1185         294 :     throwIfDisposed();
    1186             : 
    1187         294 :     if( mxGraphicFamily->getName() == aName )
    1188         180 :         return Any( Reference< XNameAccess >( static_cast< XNameAccess* >( mxGraphicFamily.get() ) ) );
    1189             : 
    1190         114 :     if( mxCellFamily->getName() == aName )
    1191           6 :         return Any( Reference< XNameAccess >( static_cast< XNameAccess* >( mxCellFamily.get() ) ) );
    1192             : 
    1193         108 :     if( msTableFamilyName == aName )
    1194          32 :         return Any( mxTableFamily );
    1195             : 
    1196          76 :     for( SdStyleFamilyMap::iterator iter( maStyleFamilyMap.begin() ); iter != maStyleFamilyMap.end(); ++iter )
    1197             :     {
    1198          76 :         if( (*iter).second->getName() == aName )
    1199          76 :             return Any( Reference< XNameAccess >( static_cast< XNameAccess* >( (*iter).second.get() ) ) );
    1200             :     }
    1201             : 
    1202           0 :     throw NoSuchElementException();
    1203             : }
    1204             : 
    1205             : // --------------------------------------------------------------------
    1206             : 
    1207           0 : Sequence< OUString > SAL_CALL SdStyleSheetPool::getElementNames() throw(RuntimeException)
    1208             : {
    1209           0 :     throwIfDisposed();
    1210             : 
    1211           0 :     Sequence< OUString > aNames( maStyleFamilyMap.size() + 3 );
    1212           0 :     OUString* pNames = aNames.getArray();
    1213             : 
    1214           0 :     *pNames++ = mxGraphicFamily->getName();
    1215           0 :     *pNames++ = mxCellFamily->getName();
    1216           0 :     *pNames++ = msTableFamilyName;
    1217             : 
    1218           0 :     for( SdStyleFamilyMap::iterator iter( maStyleFamilyMap.begin() ); iter != maStyleFamilyMap.end(); ++iter )
    1219             :     {
    1220           0 :         *pNames++ = (*iter).second->getName();
    1221             :     }
    1222             : 
    1223           0 :     return aNames;
    1224             : }
    1225             : 
    1226             : // --------------------------------------------------------------------
    1227             : 
    1228          76 : sal_Bool SAL_CALL SdStyleSheetPool::hasByName( const OUString& aName ) throw(RuntimeException)
    1229             : {
    1230          76 :     throwIfDisposed();
    1231             : 
    1232          76 :     if( mxGraphicFamily->getName() == aName )
    1233           0 :         return sal_True;
    1234             : 
    1235          76 :     if( mxCellFamily->getName() == aName )
    1236           0 :         return sal_True;
    1237             : 
    1238          76 :     if( msTableFamilyName == aName )
    1239           0 :         return sal_True;
    1240             : 
    1241         116 :     for( SdStyleFamilyMap::iterator iter( maStyleFamilyMap.begin() ); iter != maStyleFamilyMap.end(); ++iter )
    1242             :     {
    1243          76 :         if( (*iter).second->getName() == aName )
    1244          36 :             return sal_True;
    1245             :     }
    1246             : 
    1247          40 :     return sal_False;
    1248             : }
    1249             : 
    1250             : // --------------------------------------------------------------------
    1251             : // XElementAccess
    1252             : // --------------------------------------------------------------------
    1253             : 
    1254           0 : Type SAL_CALL SdStyleSheetPool::getElementType() throw(RuntimeException)
    1255             : {
    1256           0 :     throwIfDisposed();
    1257             : 
    1258           0 :     return XNameAccess::static_type();
    1259             : }
    1260             : 
    1261             : // --------------------------------------------------------------------
    1262             : 
    1263           0 : sal_Bool SAL_CALL SdStyleSheetPool::hasElements() throw(RuntimeException)
    1264             : {
    1265           0 :     return sal_True;
    1266             : }
    1267             : 
    1268             : // --------------------------------------------------------------------
    1269             : // XIndexAccess
    1270             : // --------------------------------------------------------------------
    1271             : 
    1272           0 : sal_Int32 SAL_CALL SdStyleSheetPool::getCount() throw(RuntimeException)
    1273             : {
    1274           0 :     throwIfDisposed();
    1275             : 
    1276           0 :     return maStyleFamilyMap.size() + 3;
    1277             : }
    1278             : 
    1279             : // --------------------------------------------------------------------
    1280             : 
    1281           0 : Any SAL_CALL SdStyleSheetPool::getByIndex( sal_Int32 Index ) throw(IndexOutOfBoundsException, WrappedTargetException, RuntimeException)
    1282             : {
    1283           0 :     switch( Index )
    1284             :     {
    1285             :     case 0:
    1286           0 :         return Any( Reference< XNameAccess >( static_cast< XNameAccess* >( mxGraphicFamily.get() ) ) );
    1287             : 
    1288             :     case 1:
    1289           0 :         return Any( Reference< XNameAccess >( static_cast< XNameAccess* >( mxCellFamily.get() ) ) );
    1290             : 
    1291             :     case 2:
    1292           0 :         return Any( mxTableFamily );
    1293             : 
    1294             :     default:
    1295             :         {
    1296           0 :             Index -= 3;
    1297           0 :             if( (Index < 0) || (Index >= sal::static_int_cast<sal_Int32>(maStyleFamilyMap.size())) )
    1298           0 :                 throw IndexOutOfBoundsException();
    1299           0 :             SdStyleFamilyMap::iterator iter( maStyleFamilyMap.begin() );
    1300           0 :             while( Index-- )
    1301           0 :                 ++iter;
    1302             : 
    1303           0 :             return Any( Reference< XNameAccess >( static_cast< XNameAccess* >( (*iter).second.get() ) ) );
    1304             :         }
    1305             :     }
    1306             : }
    1307             : 
    1308             : // --------------------------------------------------------------------
    1309             : // XComponent
    1310             : // --------------------------------------------------------------------
    1311             : 
    1312          36 : void SAL_CALL SdStyleSheetPool::dispose() throw (RuntimeException)
    1313             : {
    1314          36 :     if( mpDoc )
    1315             :     {
    1316          36 :         mxGraphicFamily->dispose();
    1317          36 :         mxGraphicFamily.clear();
    1318          36 :         mxCellFamily->dispose();
    1319          36 :         mxCellFamily.clear();
    1320             : 
    1321          36 :         Reference< XComponent > xComp( mxTableFamily, UNO_QUERY );
    1322          36 :         if( xComp.is() )
    1323          36 :             xComp->dispose();
    1324          36 :         mxTableFamily = 0;
    1325             : 
    1326          36 :         SdStyleFamilyMap aTempMap;
    1327          36 :         aTempMap.swap( maStyleFamilyMap );
    1328             : 
    1329          46 :         for( SdStyleFamilyMap::iterator iter( aTempMap.begin() ); iter != aTempMap.end(); ++iter ) try
    1330             :         {
    1331          10 :             (*iter).second->dispose();
    1332             :         }
    1333           0 :         catch( Exception& )
    1334             :         {
    1335             :         }
    1336             : 
    1337          36 :         mpDoc = 0;
    1338             : 
    1339          36 :         Clear();
    1340             :     }
    1341          36 : }
    1342             : 
    1343             : // --------------------------------------------------------------------
    1344             : 
    1345           0 : void SAL_CALL SdStyleSheetPool::addEventListener( const Reference< XEventListener >& /*xListener*/ ) throw (RuntimeException)
    1346             : {
    1347           0 : }
    1348             : 
    1349             : // --------------------------------------------------------------------
    1350             : 
    1351           0 : void SAL_CALL SdStyleSheetPool::removeEventListener( const Reference< XEventListener >& /*aListener*/ ) throw (RuntimeException)
    1352             : {
    1353           0 : }
    1354             : 
    1355             : // --------------------------------------------------------------------
    1356             : 
    1357           0 : SdStyleSheetVector SdStyleSheetPool::CreateChildList( SdStyleSheet* pSheet )
    1358             : {
    1359           0 :     SdStyleSheetVector aResult;
    1360             : 
    1361           0 :     sal_uInt16 nListenerCount = pSheet->GetListenerCount();
    1362           0 :     if (nListenerCount > 0)
    1363             :     {
    1364           0 :         for (sal_uInt16 n = 0; n < nListenerCount; n++)
    1365             :         {
    1366           0 :             SdStyleSheet* pChild = dynamic_cast< SdStyleSheet* >( pSheet->GetListener(n) );
    1367           0 :             if(pChild && pChild->GetParent() == pSheet->GetName())
    1368             :             {
    1369           0 :                 aResult.push_back( SdStyleSheetRef( pChild ) );
    1370             :             }
    1371             :         }
    1372             :     }
    1373             : 
    1374           0 :     return aResult;
    1375             : }
    1376             : 
    1377             : // --------------------------------------------------------------------
    1378             : 
    1379        2570 : void SAL_CALL SdStyleSheetPool::acquire (void) throw ()
    1380             : {
    1381        2570 :     SdStyleSheetPoolBase::acquire();
    1382        2570 : }
    1383             : 
    1384        2242 : void SAL_CALL SdStyleSheetPool::release (void) throw ()
    1385             : {
    1386        2242 :     SdStyleSheetPoolBase::release();
    1387        2242 : }
    1388             : 
    1389             : // --------------------------------------------------------------------
    1390             : 
    1391             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10