LCOV - code coverage report
Current view: top level - libreoffice/sd/source/core - drawdoc4.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 493 696 70.8 %
Date: 2012-12-17 Functions: 14 28 50.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             : 
      21             : #include <com/sun/star/style/XStyle.hpp>
      22             : #include <com/sun/star/container/XNameAccess.hpp>
      23             : #include <i18npool/mslangid.hxx>
      24             : #include <sfx2/docfile.hxx>
      25             : #include <sfx2/dispatch.hxx>
      26             : #include "Outliner.hxx"
      27             : #include <comphelper/processfactory.hxx>
      28             : #include <editeng/outliner.hxx>
      29             : 
      30             : #include "../ui/inc/DrawDocShell.hxx"
      31             : #include <editeng/eeitem.hxx>
      32             : #include <vcl/svapp.hxx>
      33             : #include <eetext.hxx>
      34             : 
      35             : #include <editeng/akrnitem.hxx>
      36             : 
      37             : #include <svx/svxids.hrc>
      38             : #include <svl/srchitem.hxx>
      39             : #include <editeng/lrspitem.hxx>
      40             : #include <editeng/ulspitem.hxx>
      41             : #include <editeng/lspcitem.hxx>
      42             : #include <editeng/adjitem.hxx>
      43             : #include <svx/dialogs.hrc>
      44             : #include <svx/dialmgr.hxx>                  // SVX_RESSTR
      45             : #include <editeng/bulitem.hxx>
      46             : #include <svx/xtable.hxx>
      47             : #include <svx/sxmsuitm.hxx>
      48             : #include <editeng/borderline.hxx>
      49             : #include <editeng/boxitem.hxx>
      50             : #include <svx/xit.hxx>
      51             : #include <svx/xlineit0.hxx>
      52             : #include <svx/sdshitm.hxx>
      53             : #include <svx/svdotext.hxx>
      54             : #include <svx/xfillit0.hxx>
      55             : #include <svx/sdshcitm.hxx>
      56             : #include <editeng/editstat.hxx>
      57             : #include <editeng/colritem.hxx>
      58             : #include <editeng/fhgtitem.hxx>
      59             : #include <editeng/wghtitem.hxx>
      60             : #include <editeng/postitem.hxx>
      61             : #include <editeng/crsditem.hxx>
      62             : #include <editeng/udlnitem.hxx>
      63             : #include <editeng/cntritem.hxx>
      64             : #include <editeng/emphitem.hxx>
      65             : #include <editeng/fontitem.hxx>
      66             : #include <editeng/shdditem.hxx>
      67             : #include <svx/xbtmpit.hxx>
      68             : #include <svx/xflhtit.hxx>
      69             : #include <svx/xflgrit.hxx>
      70             : #include <svx/xflclit.hxx>
      71             : #include <svx/xlnedcit.hxx>
      72             : #include <svx/xlnstcit.hxx>
      73             : #include <svx/xlnedwit.hxx>
      74             : #include <svx/xlnstwit.hxx>
      75             : #include <svx/xlnedit.hxx>
      76             : #include <editeng/charreliefitem.hxx>
      77             : #include <svx/xlnstit.hxx>
      78             : #include <svx/xlndsit.hxx>
      79             : #include <svx/xlnwtit.hxx>
      80             : #include <svx/xlnclit.hxx>
      81             : #include <svx/svditer.hxx>
      82             : #include <svx/svdogrp.hxx>
      83             : #include <tools/shl.hxx>
      84             : #include <editeng/numitem.hxx>
      85             : #include <editeng/editeng.hxx>
      86             : #include <editeng/unolingu.hxx>
      87             : #include <com/sun/star/linguistic2/XHyphenator.hpp>
      88             : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
      89             : #include <svl/itempool.hxx>
      90             : #include <editeng/outlobj.hxx>
      91             : #include <sfx2/viewfrm.hxx>
      92             : #include <editeng/langitem.hxx>
      93             : #include <editeng/frmdiritem.hxx>
      94             : 
      95             : #include "sdresid.hxx"
      96             : #include "drawdoc.hxx"
      97             : #include "sdpage.hxx"
      98             : #include "glob.hrc"
      99             : #include "glob.hxx"
     100             : #include "stlpool.hxx"
     101             : #include "helpids.h"
     102             : #include "sdiocmpt.hxx"
     103             : #include "shapelist.hxx"
     104             : #include <basegfx/point/b2dpoint.hxx>
     105             : #include <basegfx/polygon/b2dpolygon.hxx>
     106             : #include <svl/itemset.hxx>
     107             : #include "app.hrc"
     108             : 
     109             : using ::rtl::OUString;
     110             : using namespace ::com::sun::star;
     111             : using namespace ::com::sun::star::uno;
     112             : using namespace ::com::sun::star::lang;
     113             : using namespace ::com::sun::star::style;
     114             : using namespace ::com::sun::star::container;
     115             : using namespace ::com::sun::star::linguistic2;
     116             : using namespace ::sd;
     117             : 
     118             : /*************************************************************************
     119             : |*
     120             : |* CreateLayoutTemplates, Layoutvorlagen erzeugen
     121             : |*
     122             : |* Z.Zt. (31.03.95) speichert der StyleSheetPool nur diejenigen Sheets, die
     123             : |* ein ItemSet haben. Damit alle Sheets gespeichert werden, wird die ItemSet-
     124             : |* Erzeugung mit einem GetItemSet-Aufruf erzwungen.
     125             : |* Dies kann entfallen, sobald der Pool auch Sheets ohne ItemSet speichert.
     126             : |*
     127             : \************************************************************************/
     128             : 
     129          26 : void SdDrawDocument::CreateLayoutTemplates()
     130             : {
     131          26 :     SdStyleSheetPool*       pSSPool = (SdStyleSheetPool*)GetStyleSheetPool();
     132          26 :     SfxStyleSheetBase*      pSheet = NULL;
     133          26 :     String                  aHelpFile;
     134          26 :     String                  aStdName = String(SdResId(STR_STANDARD_STYLESHEET_NAME));
     135             : 
     136             :     // ---- Standardvorlage -----------------------------------------------
     137             : 
     138             :     // nicht benutzt, nicht benutzerdefiniert
     139             :     // SB hatte wahrscheinlich Probleme mit SFXSTYLEBIT_AUTO, da dann gar nichts
     140             :     // mehr im Gestalter angezeigt wird. Dieses Problem ist zu 364 j behoben worden
     141             :     // sal_uInt16 nMask = SFXSTYLEBIT_ALL & ~(SFXSTYLEBIT_USED | SFXSTYLEBIT_USERDEF);
     142          26 :     sal_uInt16 nMask = SFXSTYLEBIT_AUTO;
     143             : 
     144          26 :     String aName(aStdName);
     145          26 :     pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
     146          26 :     pSheet->SetHelpId( aHelpFile, HID_STANDARD_STYLESHEET_NAME );
     147          26 :     SfxItemSet& rISet = pSheet->GetItemSet();
     148          26 :     SfxItemPool* pPool = rISet.GetPool();
     149             : 
     150          26 :     String   aNullStr;
     151             : 
     152          26 :     ::basegfx::B2DPolyPolygon aNullPolyPolygon;
     153          26 :     Color    aNullCol(RGB_Color(COL_DEFAULT_SHAPE_STROKE));
     154             : 
     155          26 :     XDash     aNullDash;
     156          26 :     XGradient aNullGrad(aNullCol,RGB_Color(COL_WHITE));
     157          26 :               aNullGrad.SetStartIntens( 100 );
     158          26 :               aNullGrad.SetEndIntens( 100 );
     159          26 :     XHatch    aNullHatch(aNullCol);
     160             : 
     161             :                     // Linienattribute (Extended OutputDevice)
     162          26 :     rISet.Put(XLineStyleItem(XLINE_SOLID));
     163          26 :     rISet.Put(XLineColorItem(String(), RGB_Color(COL_DEFAULT_SHAPE_STROKE)));
     164          26 :     rISet.Put(XLineWidthItem(0));
     165          26 :     rISet.Put(XLineDashItem(pPool,aNullDash));
     166          26 :     rISet.Put(XLineStartItem(pPool,aNullPolyPolygon));
     167          26 :     rISet.Put(XLineEndItem(pPool,aNullPolyPolygon));
     168          26 :     rISet.Put(XLineStartWidthItem(200));
     169          26 :     rISet.Put(XLineEndWidthItem(200));
     170          26 :     rISet.Put(XLineStartCenterItem());
     171          26 :     rISet.Put(XLineEndCenterItem());
     172          26 :     rISet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_BLOCK));
     173             : 
     174             :                     // Fuellattribute (Extended OutputDevice)
     175          26 :     rISet.Put(XFillStyleItem(XFILL_SOLID));
     176          26 :     rISet.Put(XFillColorItem(String(), RGB_Color(COL_DEFAULT_SHAPE_FILLING)));
     177             : 
     178          26 :     rISet.Put( XFillGradientItem( aNullGrad) );
     179          26 :     rISet.Put(XFillHatchItem(pPool,aNullHatch));
     180          26 :     Size    aNullSize( 32, 32 );
     181          26 :     Color   aNullColor( COL_WHITE );
     182          26 :     Bitmap  aNullBmp( aNullSize, 8 );
     183          26 :     aNullBmp.Erase( aNullColor );
     184          26 :     rISet.Put(XFillBitmapItem(pPool,aNullBmp));
     185             : 
     186             :                     // Schattenattribute (Drawing Engine)
     187          26 :     rISet.Put(SdrShadowItem(sal_False));
     188          26 :     rISet.Put(SdrShadowColorItem(aNullStr, RGB_Color(COL_GRAY)));
     189          26 :     rISet.Put(SdrShadowXDistItem(200));         // 3 mm Schattendistanz
     190          26 :     rISet.Put(SdrShadowYDistItem(200));
     191             : 
     192          26 :     Font aLatinFont, aCJKFont, aCTLFont;
     193             : 
     194          26 :     getDefaultFonts( aLatinFont, aCJKFont, aCTLFont );
     195             : 
     196          26 :     SvxFontItem aSvxFontItem( aLatinFont.GetFamily(), aLatinFont.GetName(), aLatinFont.GetStyleName(), aLatinFont.GetPitch(),
     197          52 :                               aLatinFont.GetCharSet(), EE_CHAR_FONTINFO );
     198             : 
     199          26 :     SvxFontItem aSvxFontItemCJK( aCJKFont.GetFamily(), aCJKFont.GetName(), aCJKFont.GetStyleName(), aCJKFont.GetPitch(),
     200          52 :                                  aCJKFont.GetCharSet(), EE_CHAR_FONTINFO_CJK );
     201             : 
     202          26 :     SvxFontItem aSvxFontItemCTL( aCTLFont.GetFamily(), aCTLFont.GetName(), aCTLFont.GetStyleName(), aCTLFont.GetPitch(),
     203          52 :                                  aCTLFont.GetCharSet(), EE_CHAR_FONTINFO_CTL );
     204             : 
     205          26 :     rISet.Put( aSvxFontItem );
     206          26 :     rISet.Put( aSvxFontItemCJK );
     207          26 :     rISet.Put( aSvxFontItemCTL );
     208             : 
     209          26 :     rISet.Put( SvxFontHeightItem( 635, 100, EE_CHAR_FONTHEIGHT ) );     // sj: (i33745) changed default from 24 to 18 pt
     210          26 :     rISet.Put( SvxFontHeightItem( 635, 100, EE_CHAR_FONTHEIGHT_CJK ) ); // 18 pt
     211          26 :     rISet.Put( SvxFontHeightItem( convertFontHeightToCTL( 635 ), 100, EE_CHAR_FONTHEIGHT_CTL ) ); // 18 pt
     212             : 
     213          26 :     rISet.Put( SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT ) );
     214          26 :     rISet.Put( SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CJK ) );
     215          26 :     rISet.Put( SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CTL ) );
     216             : 
     217          26 :     rISet.Put( SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC ) );
     218          26 :     rISet.Put( SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CJK ) );
     219          26 :     rISet.Put( SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CTL ) );
     220             : 
     221          26 :     rISet.Put(SvxContourItem(sal_False, EE_CHAR_OUTLINE ));
     222          26 :     rISet.Put(SvxShadowedItem(sal_False, EE_CHAR_SHADOW ));
     223          26 :     rISet.Put(SvxUnderlineItem(UNDERLINE_NONE, EE_CHAR_UNDERLINE));
     224          26 :     rISet.Put(SvxOverlineItem(UNDERLINE_NONE, EE_CHAR_OVERLINE));
     225          26 :     rISet.Put(SvxCrossedOutItem(STRIKEOUT_NONE, EE_CHAR_STRIKEOUT ));
     226          26 :     rISet.Put(SvxEmphasisMarkItem(EMPHASISMARK_NONE, EE_CHAR_EMPHASISMARK));
     227          26 :     rISet.Put(SvxCharReliefItem(RELIEF_NONE, EE_CHAR_RELIEF));
     228          26 :     rISet.Put(SvxColorItem(Color(COL_AUTO), EE_CHAR_COLOR ));
     229             : 
     230             :     // Absatzattribute (Edit Engine)
     231          26 :     rISet.Put(SvxLRSpaceItem(EE_PARA_LRSPACE));
     232          26 :     rISet.Put(SvxULSpaceItem(EE_PARA_ULSPACE));
     233             : 
     234          26 :     rISet.Put( SdrTextLeftDistItem( 250 ) );    // sj: (i33745) using text frame distances seems to be a better default
     235          26 :     rISet.Put( SdrTextRightDistItem( 250 ) );
     236          26 :     rISet.Put( SdrTextUpperDistItem( 125 ) );
     237          26 :     rISet.Put( SdrTextLowerDistItem( 125 ) );
     238             : 
     239          26 :     rISet.Put( SvxLineSpacingItem( LINE_SPACE_DEFAULT_HEIGHT, EE_PARA_SBL ) );
     240             : 
     241             :     // #i16874# enable kerning by default but only for new documents
     242          26 :     rISet.Put( SvxAutoKernItem( sal_True, EE_CHAR_PAIRKERNING ) );
     243             : 
     244             :     // Bullet
     245             :     // BulletItem und BulletFont fuer Titel und Gliederung
     246          26 :     SvxBulletItem aBulletItem(EE_PARA_BULLET);
     247             :                             // die sind in allen Ebenen identisch
     248          26 :     aBulletItem.SetStyle(BS_BULLET);
     249          26 :     aBulletItem.SetStart(1);
     250          26 :     aBulletItem.SetScale(45);           // in Prozent
     251             : 
     252          26 :     Font aBulletFont( pSSPool->GetBulletFont() );
     253             : 
     254          26 :     aBulletFont.SetSize(Size(0,635));   // sj: (i33745) changed default from 24 to 18 pt
     255             : 
     256          26 :     aBulletItem.SetFont(aBulletFont);
     257          26 :     aBulletItem.SetSymbol( 0x25CF );                    // Punkt
     258          26 :     rISet.Put(aBulletItem);
     259             : 
     260             :     // Neues BulletItem
     261          26 :     pSSPool->PutNumBulletItem( pSheet, aBulletFont );
     262             : 
     263          26 :     SfxItemSet* pISet = NULL;
     264             : 
     265             :     // ---- Objekt mit Pfeilspitze ----------------------------------------
     266             : 
     267          26 :     aName = String(SdResId(STR_POOLSHEET_OBJWITHARROW));
     268          26 :     pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
     269          26 :     pSheet->SetParent(aStdName);
     270          26 :     pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_OBJWITHARROW );
     271          26 :     pISet = &pSheet->GetItemSet();
     272             : 
     273          26 :     pISet->Put(XLineStyleItem(XLINE_SOLID));
     274          26 :     pISet->Put(XLineColorItem(String(), RGB_Color(COL_BLACK)));
     275          26 :     pISet->Put(XLineWidthItem(150));
     276             : 
     277          26 :     ::basegfx::B2DPolygon aArrow;
     278          26 :     aArrow.append(::basegfx::B2DPoint(10.0, 0.0));
     279          26 :     aArrow.append(::basegfx::B2DPoint(0.0, 30.0));
     280          26 :     aArrow.append(::basegfx::B2DPoint(20.0, 30.0));
     281          26 :     aArrow.setClosed(true);
     282          26 :     pISet->Put(XLineStartItem(SVX_RESSTR(RID_SVXSTR_ARROW),::basegfx::B2DPolyPolygon(aArrow)));
     283             : 
     284          26 :     pISet->Put(XLineStartWidthItem(700));
     285          26 :     pISet->Put(XLineEndWidthItem(300));
     286          26 :     pISet->Put(XLineStartCenterItem(sal_True));
     287             : 
     288             :     // ---- Objekt mit Schatten -------------------------------------------
     289             : 
     290          26 :     aName = String(SdResId(STR_POOLSHEET_OBJWITHSHADOW));
     291          26 :     pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
     292          26 :     pSheet->SetParent(aStdName);
     293          26 :     pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_OBJWITHSHADOW );
     294          26 :     pISet = &pSheet->GetItemSet();
     295             : 
     296          26 :     pISet->Put(SdrShadowItem(sal_True));
     297          26 :     pISet->Put(SdrShadowColorItem(aNullStr, RGB_Color(COL_GRAY)));
     298          26 :     pISet->Put(SdrShadowXDistItem(200));        // 3 mm Schattendistanz
     299          26 :     pISet->Put(SdrShadowYDistItem(200));
     300             : 
     301             :     // ---- Objekt ohne F�llung -------------------------------------------
     302             : 
     303          26 :     aName = String(SdResId(STR_POOLSHEET_OBJWITHOUTFILL));
     304          26 :     pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
     305          26 :     pSheet->SetParent(aStdName);
     306          26 :     pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_OBJWITHOUTFILL );
     307          26 :     pISet = &pSheet->GetItemSet();
     308             : 
     309          26 :     pISet->Put(XFillStyleItem(XFILL_NONE));
     310          26 :     pISet->Put(XLineColorItem(String(), RGB_Color(COL_BLACK)));
     311             : 
     312             :     // ---- Text ----------------------------------------------------------
     313             : 
     314          26 :     aName = String(SdResId(STR_POOLSHEET_TEXT));
     315          26 :     pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
     316          26 :     pSheet->SetParent(aStdName);
     317          26 :     pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_TEXT );
     318          26 :     pISet = &pSheet->GetItemSet();
     319             : 
     320          26 :     pISet->Put(XLineStyleItem(XLINE_NONE));
     321          26 :     pISet->Put(XFillStyleItem(XFILL_NONE));
     322             : 
     323             :     // ---- Textk�rper ----------------------------------------------------
     324             : 
     325          26 :     aName = String(SdResId(STR_POOLSHEET_TEXTBODY));
     326          26 :     pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
     327          26 :     pSheet->SetParent(aStdName);
     328          26 :     pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_TEXTBODY );
     329          26 :     pISet = &pSheet->GetItemSet();
     330             : 
     331          26 :     pISet->Put(XLineStyleItem(XLINE_NONE));
     332          26 :     pISet->Put(XFillStyleItem(XFILL_NONE));
     333             : 
     334          26 :     pISet->Put(SvxFontHeightItem(564, 100, EE_CHAR_FONTHEIGHT));        // 16 pt
     335             : 
     336             :     // ---- Textk�rper mit Blocksatz --------------------------------------
     337             : 
     338          26 :     aName = String(SdResId(STR_POOLSHEET_TEXTBODY_JUSTIFY));
     339          26 :     pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
     340          26 :     pSheet->SetParent(aStdName);
     341          26 :     pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_TEXTBODY_JUSTIFY );
     342          26 :     pISet = &pSheet->GetItemSet();
     343             : 
     344          26 :     pISet->Put(XLineStyleItem(XLINE_NONE));
     345          26 :     pISet->Put(XFillStyleItem(XFILL_NONE));
     346             : 
     347          26 :     pISet->Put(SvxAdjustItem(SVX_ADJUST_BLOCK, EE_PARA_JUST ));
     348             : 
     349             :     // ---- Textkoerper mit Einzug -----------------------------------------
     350             : 
     351          26 :     aName = String(SdResId(STR_POOLSHEET_TEXTBODY_INDENT));
     352          26 :     pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
     353          26 :     pSheet->SetParent(aStdName);
     354          26 :     pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_TEXTBODY_INDENT );
     355          26 :     pISet = &pSheet->GetItemSet();
     356             : 
     357          26 :     pISet->Put(XLineStyleItem(XLINE_NONE));
     358          26 :     pISet->Put(XFillStyleItem(XFILL_NONE));
     359             : 
     360          26 :     SvxLRSpaceItem aLRSpaceItem( EE_PARA_LRSPACE );
     361          26 :     aLRSpaceItem.SetTxtFirstLineOfst(600);      // Erstzeileneinzug 6mm, rechts 0
     362          26 :     pISet->Put(aLRSpaceItem);
     363             : 
     364             :     // ---- Titel ---------------------------------------------------------
     365             : 
     366          26 :     aName = String(SdResId(STR_POOLSHEET_TITLE));
     367          26 :     pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
     368          26 :     pSheet->SetParent(aStdName);
     369          26 :     pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_TITLE );
     370          26 :     pISet = &pSheet->GetItemSet();
     371             : 
     372          26 :     pISet->Put(XLineStyleItem(XLINE_NONE));
     373          26 :     pISet->Put(XFillStyleItem(XFILL_NONE));
     374             : 
     375          26 :     pISet->Put(SvxFontHeightItem(1551, 100, EE_CHAR_FONTHEIGHT ));      // 44 pt
     376             : 
     377             :     // ---- Titel1 --------------------------------------------------------
     378             : 
     379          26 :     aName = String(SdResId(STR_POOLSHEET_TITLE1));
     380          26 :     pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
     381          26 :     pSheet->SetParent(aStdName);
     382          26 :     pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_TITLE1 );
     383          26 :     pISet = &pSheet->GetItemSet();
     384             : 
     385          26 :     pISet->Put(XLineStyleItem(XLINE_NONE));
     386          26 :     pISet->Put(XFillStyleItem(XFILL_SOLID));
     387          26 :     pISet->Put(XFillColorItem(String(), RGB_Color(COL_CYAN)));
     388             : 
     389          26 :     pISet->Put(SdrShadowItem(sal_True));
     390          26 :     pISet->Put(SdrShadowColorItem(aNullStr, RGB_Color(COL_GRAY)));
     391          26 :     pISet->Put(SdrShadowXDistItem(200));        // 2 mm Schattendistanz
     392          26 :     pISet->Put(SdrShadowYDistItem(200));
     393             : 
     394          26 :     pISet->Put(SvxFontHeightItem(846, 100, EE_CHAR_FONTHEIGHT ));       // 24 pt
     395             : 
     396          26 :     pISet->Put(SvxAdjustItem(SVX_ADJUST_CENTER, EE_PARA_JUST ));
     397             : 
     398             :     // ---- Titel2 --------------------------------------------------------
     399             : 
     400          26 :     aName = String(SdResId(STR_POOLSHEET_TITLE2));
     401          26 :     pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
     402          26 :     pSheet->SetParent(aStdName);
     403          26 :     pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_TITLE2 );
     404          26 :     pISet = &pSheet->GetItemSet();
     405             : 
     406          26 :     pISet->Put(XLineWidthItem(50));
     407             : 
     408             :     // Farbe nicht aus der Farbtabelle holen, denn da kann diese Farbe
     409             :     // geloescht oder veraendert sein
     410          26 :     Color aOrange4(255, 204, 153);
     411          26 :     pISet->Put(XFillColorItem(String(), aOrange4));
     412             : 
     413          26 :     pISet->Put(SdrShadowItem(sal_True));
     414          26 :     pISet->Put(SdrShadowColorItem(aNullStr, RGB_Color(COL_GRAY)));
     415          26 :     pISet->Put(SdrShadowXDistItem(200));        // 2 mm Schattendistanz
     416          26 :     pISet->Put(SdrShadowYDistItem(200));
     417             : 
     418          26 :     pISet->Put(SvxFontHeightItem(1270, 100, EE_CHAR_FONTHEIGHT ));      // 36 pt
     419             : 
     420          26 :     SvxLRSpaceItem aLRSpItem( 200, 200, 0, 0, EE_PARA_LRSPACE);
     421          26 :     pISet->Put( aLRSpItem );    // Erstzeileneinzug 0 mm, links und rechts 2 mm
     422             : 
     423          26 :     pISet->Put(SvxULSpaceItem(100, 100, EE_PARA_ULSPACE ));      // Absatzrand oben/unten 1 mm
     424             : 
     425          26 :     pISet->Put(SvxAdjustItem(SVX_ADJUST_CENTER, EE_PARA_JUST ));
     426             : 
     427             :     // ---- Ueberschrift ---------------------------------------------------
     428             : 
     429          26 :     aName = String(SdResId(STR_POOLSHEET_HEADLINE));
     430          26 :     pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
     431          26 :     pSheet->SetParent(aStdName);
     432          26 :     pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_HEADLINE );
     433          26 :     pISet = &pSheet->GetItemSet();
     434             : 
     435          26 :     pISet->Put(XLineStyleItem(XLINE_NONE));
     436          26 :     pISet->Put(XFillStyleItem(XFILL_NONE));
     437             : 
     438          26 :     pISet->Put(SvxFontHeightItem(846, 100, EE_CHAR_FONTHEIGHT ));        // 24 pt
     439             : 
     440          26 :     pISet->Put(SvxULSpaceItem(420, 210, EE_PARA_ULSPACE ));      // Absatzrand oben 4,2 mm,
     441             :                                                 // unten 2,1 mm
     442             : 
     443             :     // ---- Ueberschrift1 --------------------------------------------------
     444             : 
     445          26 :     aName = String(SdResId(STR_POOLSHEET_HEADLINE1));
     446          26 :     pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
     447          26 :     pSheet->SetParent(aStdName);
     448          26 :     pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_HEADLINE1 );
     449          26 :     pISet = &pSheet->GetItemSet();
     450             : 
     451          26 :     pISet->Put(XLineStyleItem(XLINE_NONE));
     452          26 :     pISet->Put(XFillStyleItem(XFILL_NONE));
     453             : 
     454          26 :     pISet->Put(SvxWeightItem(WEIGHT_BOLD, EE_CHAR_WEIGHT ));
     455             : 
     456          26 :     pISet->Put(SvxFontHeightItem(635, 100, EE_CHAR_FONTHEIGHT ));       // 18 pt
     457             : 
     458          26 :     pISet->Put(SvxULSpaceItem(420, 210, EE_PARA_ULSPACE ));      // Absatzrand oben 4,2 mm,
     459             :                                                 // unten 2,1 mm
     460             : 
     461             :     // ---- Ueberschrift2 --------------------------------------------------
     462             : 
     463          26 :     aName = String(SdResId(STR_POOLSHEET_HEADLINE2));
     464          26 :     pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
     465          26 :     pSheet->SetParent(aStdName);
     466          26 :     pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_HEADLINE2 );
     467          26 :     pISet = &pSheet->GetItemSet();
     468             : 
     469          26 :     pISet->Put(XLineStyleItem(XLINE_NONE));
     470          26 :     pISet->Put(XFillStyleItem(XFILL_NONE));
     471             : 
     472          26 :     pISet->Put(SvxPostureItem(ITALIC_NORMAL, EE_CHAR_ITALIC ));
     473          26 :     pISet->Put(SvxWeightItem(WEIGHT_BOLD, EE_CHAR_WEIGHT));
     474             : 
     475          26 :     pISet->Put(SvxFontHeightItem(494, 100, EE_CHAR_FONTHEIGHT ));        // 14 pt
     476             : 
     477          26 :     pISet->Put(SvxULSpaceItem(420, 210, EE_PARA_ULSPACE ));      // Absatzrand oben 4,2 mm,
     478             :                                                 // unten 2,1 mm
     479             : 
     480             :     // ---- Bemassung --------------------------------------------------
     481             : 
     482          26 :     aName = String(SdResId(STR_POOLSHEET_MEASURE));
     483          26 :     pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
     484          26 :     pSheet->SetParent(aStdName);
     485          26 :     pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_MEASURE );
     486          26 :     pISet = &pSheet->GetItemSet();
     487             : 
     488          26 :     pISet->Put(XFillStyleItem(XFILL_NONE));
     489          26 :     pISet->Put(XLineColorItem(String(), RGB_Color(COL_BLACK)));
     490             : 
     491          26 :     pISet->Put(SvxFontHeightItem(423, 100, EE_CHAR_FONTHEIGHT ));         // 12 pt
     492             : 
     493          26 :     pISet->Put(XLineStartItem(SVX_RESSTR(RID_SVXSTR_ARROW),::basegfx::B2DPolyPolygon(aArrow)));
     494          26 :     pISet->Put(XLineStartWidthItem(200));
     495          26 :     pISet->Put(XLineEndItem(SVX_RESSTR(RID_SVXSTR_ARROW),::basegfx::B2DPolyPolygon(aArrow)));
     496          26 :     pISet->Put(XLineEndWidthItem(200));
     497          26 :     pISet->Put(XLineStyleItem(XLINE_SOLID));
     498          26 :     pISet->Put(SdrMeasureShowUnitItem(true));
     499             : 
     500             :     // Praesentationsvorlagen fuer das Standardlayout erzeugen
     501          26 :     String aPrefix = String(SdResId(STR_LAYOUT_DEFAULT_NAME));
     502          26 :     pSSPool->CreateLayoutStyleSheets(aPrefix);
     503          26 : }
     504             : 
     505         858 : static Any implMakeSolidCellStyle( SdStyleSheetPool* pSSPool, const OUString& rName, const OUString rParent, const Color& rColor )
     506             : {
     507         858 :     SfxStyleSheetBase* pSheet = &(pSSPool->Make(rName, SD_STYLE_FAMILY_CELL, SFXSTYLEBIT_AUTO));
     508         858 :     pSheet->SetParent(rParent);
     509         858 :     SfxItemSet* pISet = &pSheet->GetItemSet();
     510         858 :     pISet->Put(XFillStyleItem(XFILL_SOLID));
     511         858 :     pISet->Put(XFillColorItem(String(), rColor));
     512             : 
     513         858 :     return Any( Reference< XStyle >( static_cast< XWeak* >( pSheet ), UNO_QUERY ) );
     514             : }
     515             : 
     516         286 : static void implCreateTableTemplate( const Reference< XNameContainer >& xTableFamily, const OUString& rName, const Any& rBody, const Any& rHeading, const Any& rBanding )
     517             : {
     518         286 :     if( xTableFamily.is() ) try
     519             :     {
     520         286 :         if( !xTableFamily->hasByName( OUString( rName ) ) )
     521             :         {
     522         264 :             Reference< XSingleServiceFactory > xFactory( xTableFamily, UNO_QUERY_THROW );
     523         264 :             Reference< XNameReplace > xDefaultTableStyle( xFactory->createInstance(), UNO_QUERY_THROW );
     524         264 :             xTableFamily->insertByName( OUString( rName ), Any( xDefaultTableStyle ) );
     525             : 
     526         264 :             xDefaultTableStyle->replaceByName( "body", rBody  );
     527         264 :             xDefaultTableStyle->replaceByName( "odd-rows" , rBanding );
     528         264 :             xDefaultTableStyle->replaceByName( "odd-columns" , rBanding );
     529         264 :             xDefaultTableStyle->replaceByName( "first-row" , rHeading );
     530         264 :             xDefaultTableStyle->replaceByName( "first-column" , rHeading );
     531         264 :             xDefaultTableStyle->replaceByName( "last-row" , rHeading );
     532         264 :             xDefaultTableStyle->replaceByName( "last-column" , rHeading );
     533             :         }
     534             :     }
     535           0 :     catch( Exception& )
     536             :     {
     537             :         OSL_FAIL("sd::implCreateTableTemplate(), exception caught!");
     538             :     }
     539         286 : }
     540             : 
     541          26 : void SdDrawDocument::CreateDefaultCellStyles()
     542             : {
     543          26 :     SdStyleSheetPool*       pSSPool = static_cast< SdStyleSheetPool* >(GetStyleSheetPool());
     544          26 :     SfxStyleSheetBase*      pSheet = NULL;
     545          26 :     String                  aHelpFile;
     546             : 
     547          26 :     Reference< XNameContainer > xTableFamily( pSSPool->getByName( "table" ), UNO_QUERY );
     548             : 
     549             :     // ---- Default -----------------------------------------------
     550             : 
     551          26 :     sal_uInt16 nMask = SFXSTYLEBIT_AUTO;
     552             : 
     553          26 :     OUString aDefaultCellStyleName( "default" );
     554             : 
     555          26 :     pSheet = &(pSSPool->Make(aDefaultCellStyleName, SD_STYLE_FAMILY_CELL, nMask));
     556          26 :     pSheet->SetHelpId( aHelpFile, HID_SD_CELL_STYLE_DEFAULT );
     557          26 :     SfxItemSet& rISet = pSheet->GetItemSet();
     558             : 
     559          26 :     String   aNullStr;
     560             : 
     561          26 :     Color    aNullCol(RGB_Color(COL_BLACK));
     562             : 
     563          26 :     XDash     aNullDash;
     564          26 :     XGradient aNullGrad(aNullCol,RGB_Color(COL_WHITE));
     565          26 :               aNullGrad.SetStartIntens( 100 );
     566          26 :               aNullGrad.SetEndIntens( 100 );
     567          26 :     XHatch    aNullHatch(aNullCol);
     568             : 
     569          26 :     rISet.Put(XFillStyleItem(XFILL_SOLID));
     570          26 :     rISet.Put(XFillColorItem(String(), RGB_Color(0x00ccccff)));
     571             : 
     572          26 :     Font aLatinFont, aCJKFont, aCTLFont;
     573             : 
     574          26 :     getDefaultFonts( aLatinFont, aCJKFont, aCTLFont );
     575             : 
     576          26 :     SvxFontItem aSvxFontItem( aLatinFont.GetFamily(), aLatinFont.GetName(), aLatinFont.GetStyleName(), aLatinFont.GetPitch(),
     577          52 :                               aLatinFont.GetCharSet(), EE_CHAR_FONTINFO );
     578             : 
     579          26 :     SvxFontItem aSvxFontItemCJK( aCJKFont.GetFamily(), aCJKFont.GetName(), aCJKFont.GetStyleName(), aCJKFont.GetPitch(),
     580          52 :                                  aCJKFont.GetCharSet(), EE_CHAR_FONTINFO_CJK );
     581             : 
     582          26 :     SvxFontItem aSvxFontItemCTL( aCTLFont.GetFamily(), aCTLFont.GetName(), aCTLFont.GetStyleName(), aCTLFont.GetPitch(),
     583          52 :                                  aCTLFont.GetCharSet(), EE_CHAR_FONTINFO_CTL );
     584             : 
     585          26 :     rISet.Put( aSvxFontItem );
     586          26 :     rISet.Put( aSvxFontItemCJK );
     587          26 :     rISet.Put( aSvxFontItemCTL );
     588             : 
     589          26 :     rISet.Put( SvxFontHeightItem( 635, 100, EE_CHAR_FONTHEIGHT ) );     // sj: (i33745) changed default from 24 to 18 pt
     590          26 :     rISet.Put( SvxFontHeightItem( 635, 100, EE_CHAR_FONTHEIGHT_CJK ) ); // 18 pt
     591          26 :     rISet.Put( SvxFontHeightItem( convertFontHeightToCTL( 635 ), 100, EE_CHAR_FONTHEIGHT_CTL ) ); // 18 pt
     592             : 
     593          26 :     rISet.Put(SvxColorItem(Color(COL_AUTO), EE_CHAR_COLOR ));
     594             : 
     595             :     // Absatzattribute (Edit Engine)
     596          26 :     rISet.Put(SvxLRSpaceItem(EE_PARA_LRSPACE));
     597          26 :     rISet.Put(SvxULSpaceItem(EE_PARA_ULSPACE));
     598             : 
     599          26 :     rISet.Put( SdrTextLeftDistItem( 250 ) );
     600          26 :     rISet.Put( SdrTextRightDistItem( 250 ) );
     601          26 :     rISet.Put( SdrTextUpperDistItem( 130 ) );
     602          26 :     rISet.Put( SdrTextLowerDistItem( 130 ) );
     603             : 
     604          26 :     rISet.Put( SvxLineSpacingItem( LINE_SPACE_DEFAULT_HEIGHT, EE_PARA_SBL ) );
     605          26 :     rISet.Put( SvxAutoKernItem( sal_True, EE_CHAR_PAIRKERNING ) );
     606          26 :     rISet.Put( SdrTextVertAdjustItem(SDRTEXTVERTADJUST_TOP) );
     607          26 :     rISet.Put( SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_LEFT) );
     608             : 
     609          26 :     Color aWhite( COL_WHITE );
     610             :     ::editeng::SvxBorderLine aBorderLine(
     611          26 :             &aWhite, 1, table::BorderLineStyle::SOLID);
     612             : 
     613          26 :     SvxBoxItem aBoxItem( SDRATTR_TABLE_BORDER );
     614          26 :     aBoxItem.SetLine( &aBorderLine, BOX_LINE_TOP );
     615          26 :     aBoxItem.SetLine( &aBorderLine, BOX_LINE_BOTTOM );
     616          26 :     aBoxItem.SetLine( &aBorderLine, BOX_LINE_LEFT );
     617          26 :     aBoxItem.SetLine( &aBorderLine, BOX_LINE_RIGHT );
     618             : 
     619          26 :     rISet.Put( aBoxItem );
     620             : 
     621          26 :     Any aDefaultCellStyle( Reference< XStyle >( static_cast< XWeak* >( pSheet ), UNO_QUERY ) );
     622             : 
     623             :     // ---- default --------------------------------------------------
     624             : 
     625          26 :     Any aGray1( implMakeSolidCellStyle( pSSPool, "gray1" , aDefaultCellStyleName, RGB_COLORDATA(230,230,230)));
     626          26 :     Any aGray2( implMakeSolidCellStyle( pSSPool, "gray2" , aDefaultCellStyleName, RGB_COLORDATA(204,204,204)));
     627          26 :     Any aGray3( implMakeSolidCellStyle( pSSPool, "gray3" , aDefaultCellStyleName, RGB_COLORDATA(179,179,179)));
     628             : 
     629          26 :     implCreateTableTemplate( xTableFamily, "default" , aGray1, aGray3, aGray2 );
     630             : 
     631             :     // ---- BW ------------------------------------------------
     632             : 
     633          26 :     Any aBW1( implMakeSolidCellStyle( pSSPool, "bw1" , aDefaultCellStyleName, RGB_COLORDATA(255,255,255)));
     634          26 :     Any aBW2( implMakeSolidCellStyle( pSSPool, "bw2" , aDefaultCellStyleName, RGB_COLORDATA(230,230,230)));
     635          26 :     Any aBW3( implMakeSolidCellStyle( pSSPool, "bw3" , aDefaultCellStyleName, RGB_COLORDATA(0,0,0)));
     636             : 
     637          26 :     implCreateTableTemplate( xTableFamily, "bw" , aBW1, aBW3, aBW2 );
     638             : 
     639             :     // ---- Orange --------------------------------------------------
     640             : 
     641          26 :     Any aOrange1( implMakeSolidCellStyle( pSSPool, "orange1" , aDefaultCellStyleName, RGB_COLORDATA(255,204,153)));
     642          26 :     Any aOrange2( implMakeSolidCellStyle( pSSPool, "orange2" , aDefaultCellStyleName, RGB_COLORDATA(255,153,102)));
     643          26 :     Any aOrange3( implMakeSolidCellStyle( pSSPool, "orange3" , aDefaultCellStyleName, RGB_COLORDATA(255,102,51)));
     644             : 
     645          26 :     implCreateTableTemplate( xTableFamily, "orange" , aOrange1, aOrange3, aOrange2 );
     646             : 
     647             :     // ---- Turquise --------------------------------------------------
     648             : 
     649          26 :     Any aTurquise1( implMakeSolidCellStyle( pSSPool, "turquise1" , aDefaultCellStyleName, RGB_COLORDATA(71,184,184)));
     650          26 :     Any aTurquise2( implMakeSolidCellStyle( pSSPool, "turquise2" , aDefaultCellStyleName, RGB_COLORDATA(51,163,163)));
     651          26 :     Any aTurquise3( implMakeSolidCellStyle( pSSPool, "turquise3" , aDefaultCellStyleName, RGB_COLORDATA(25,138,138)));
     652             : 
     653          26 :     implCreateTableTemplate( xTableFamily, "turquise" , aTurquise1, aTurquise3, aTurquise2 );
     654             : 
     655             :     // ---- Gray ------------------------------------------------
     656             : 
     657          26 :     Any aBlue1( implMakeSolidCellStyle( pSSPool, "blue1" , aDefaultCellStyleName, RGB_COLORDATA(153,204,255)));
     658          26 :     Any aBlue2( implMakeSolidCellStyle( pSSPool, "blue2" , aDefaultCellStyleName, RGB_COLORDATA(0,153,255)));
     659          26 :     Any aBlue3( implMakeSolidCellStyle( pSSPool, "blue3" , aDefaultCellStyleName, RGB_COLORDATA(0,102,204)));
     660             : 
     661          26 :     implCreateTableTemplate( xTableFamily, "blue" , aBlue1, aBlue3, aBlue2 );
     662             : 
     663             :     // ---- Sun ------------------------------------------------
     664             : 
     665          26 :     Any aSun1( implMakeSolidCellStyle( pSSPool, "sun1" , aDefaultCellStyleName, RGB_COLORDATA(230,230,255)));
     666          26 :     Any aSun2( implMakeSolidCellStyle( pSSPool, "sun2" , aDefaultCellStyleName, RGB_COLORDATA(204,204,255)));
     667          26 :     Any aSun3( implMakeSolidCellStyle( pSSPool, "sun3" , aDefaultCellStyleName, RGB_COLORDATA(153,153,255)));
     668             : 
     669          26 :     implCreateTableTemplate( xTableFamily, "sun" , aSun1, aSun3, aSun2 );
     670             : 
     671             :     // ---- Earth ----------------------------------------------
     672             : 
     673          26 :     Any aEarth1( implMakeSolidCellStyle( pSSPool, "earth1" , aDefaultCellStyleName, RGB_COLORDATA(255,255,204)));
     674          26 :     Any aEarth2( implMakeSolidCellStyle( pSSPool, "earth2" , aDefaultCellStyleName, RGB_COLORDATA(255,204,153)));
     675          26 :     Any aEarth3( implMakeSolidCellStyle( pSSPool, "earth3" , aDefaultCellStyleName, RGB_COLORDATA(204,102,51)));
     676             : 
     677          26 :     implCreateTableTemplate( xTableFamily, "earth" , aEarth1, aEarth3, aEarth2 );
     678             : 
     679             :     // ---- Green ----------------------------------------------
     680             : 
     681          26 :     Any aGreen1( implMakeSolidCellStyle( pSSPool, "green1" , aDefaultCellStyleName, RGB_COLORDATA(255,255,204)));
     682          26 :     Any aGreen2( implMakeSolidCellStyle( pSSPool, "green2" , aDefaultCellStyleName, RGB_COLORDATA(148,189,94)));
     683          26 :     Any aGreen3( implMakeSolidCellStyle( pSSPool, "green3" , aDefaultCellStyleName, RGB_COLORDATA(92,133,38)));
     684             : 
     685          26 :     implCreateTableTemplate( xTableFamily, "green" , aGreen1, aGreen3, aGreen2 );
     686             : 
     687             :     // ---- Seetang ----------------------------------------------
     688             : 
     689          26 :     Any aSeetang1( implMakeSolidCellStyle( pSSPool, "seetang1" , aDefaultCellStyleName, RGB_COLORDATA(204,255,255)));
     690          26 :     Any aSeetang2( implMakeSolidCellStyle( pSSPool, "seetang2" , aDefaultCellStyleName, RGB_COLORDATA(71,184,184)));
     691          26 :     Any aSeetang3( implMakeSolidCellStyle( pSSPool, "seetang3" , aDefaultCellStyleName, RGB_COLORDATA(51,163,163)));
     692             : 
     693          26 :     implCreateTableTemplate( xTableFamily, "seetang" , aSeetang1, aSeetang3, aSeetang2 );
     694             : 
     695             :     // ---- LightBlue ----------------------------------------------
     696             : 
     697          26 :     Any aLightBlue1( implMakeSolidCellStyle( pSSPool, "lightblue1" , aDefaultCellStyleName, RGB_COLORDATA(255,255,255)));
     698          26 :     Any aLightBlue2( implMakeSolidCellStyle( pSSPool, "lightblue2" , aDefaultCellStyleName, RGB_COLORDATA(230,230,255)));
     699          26 :     Any aLightBlue3( implMakeSolidCellStyle( pSSPool, "lightblue3" , aDefaultCellStyleName, RGB_COLORDATA(153,153,204)));
     700             : 
     701          26 :     implCreateTableTemplate( xTableFamily, "lightblue" , aLightBlue1, aLightBlue3, aLightBlue2 );
     702             : 
     703             :     // ---- Yellow ----------------------------------------------
     704             : 
     705          26 :     Any aYellow1( implMakeSolidCellStyle( pSSPool, "yellow1" , aDefaultCellStyleName, RGB_COLORDATA(255,255,204)));
     706          26 :     Any aYellow2( implMakeSolidCellStyle( pSSPool, "yellow2" , aDefaultCellStyleName, RGB_COLORDATA(255,255,153)));
     707          26 :     Any aYellow3( implMakeSolidCellStyle( pSSPool, "yellow3" , aDefaultCellStyleName, RGB_COLORDATA(255,204,153)));
     708             : 
     709          26 :     implCreateTableTemplate( xTableFamily, "yellow" , aYellow1, aYellow3, aYellow2 );
     710          26 : }
     711             : 
     712             : /*************************************************************************
     713             : |*
     714             : |* Anzahl der Seiten, die eine masterPage referenzieren
     715             : |*
     716             : \************************************************************************/
     717             : 
     718           0 : sal_uInt16 SdDrawDocument::GetMasterPageUserCount(SdrPage* pMaster) const
     719             : {
     720           0 :     sal_uInt16 nResult = 0;
     721             :     sal_uInt16 nPage;
     722           0 :     sal_uInt16 nPageCount = GetPageCount();
     723             : 
     724           0 :     for (nPage = 0; nPage < nPageCount; nPage++)
     725             :     {
     726           0 :         const SdrPage* pPage = GetPage(nPage);
     727             : 
     728           0 :         if(pPage->TRG_HasMasterPage())
     729             :         {
     730           0 :             if(&(pPage->TRG_GetMasterPage()) == pMaster)
     731             :             {
     732           0 :                 nResult++;
     733             :             }
     734             :         }
     735             :     }
     736           0 :     return nResult;
     737             : }
     738             : 
     739             : 
     740             : /*************************************************************************
     741             : |*
     742             : |* OnlineSpelling im Hintergrund beenden
     743             : |*
     744             : \************************************************************************/
     745             : 
     746          36 : void SdDrawDocument::StopOnlineSpelling()
     747             : {
     748          36 :     if (mpOnlineSpellingTimer && mpOnlineSpellingTimer->IsActive())
     749             :     {
     750           0 :         mpOnlineSpellingTimer->Stop();
     751             :     }
     752             : 
     753          36 :     delete mpOnlineSpellingTimer;
     754          36 :     mpOnlineSpellingTimer = NULL;
     755             : 
     756          36 :     delete mpOnlineSpellingList;
     757          36 :     mpOnlineSpellingList = NULL;
     758          36 : }
     759             : 
     760             : /*************************************************************************
     761             : |*
     762             : |* OnlineSpelling im Hintergrund starten
     763             : |*
     764             : \************************************************************************/
     765             : 
     766           0 : void SdDrawDocument::StartOnlineSpelling(sal_Bool bForceSpelling)
     767             : {
     768           0 :     if (mbOnlineSpell && (bForceSpelling || mbInitialOnlineSpellingEnabled) &&
     769           0 :         mpDocSh && !mpDocSh->IsReadOnly() )
     770             :     {
     771           0 :         StopOnlineSpelling();
     772             : 
     773           0 :         ::sd::Outliner* pOutl = GetInternalOutliner(sal_True);
     774             : 
     775           0 :         Reference< XSpellChecker1 > xSpellChecker( LinguMgr::GetSpellChecker() );
     776           0 :         if ( xSpellChecker.is() )
     777           0 :             pOutl->SetSpeller( xSpellChecker );
     778             : 
     779           0 :         Reference< XHyphenator > xHyphenator( LinguMgr::GetHyphenator() );
     780           0 :         if( xHyphenator.is() )
     781           0 :             pOutl->SetHyphenator( xHyphenator );
     782             : 
     783           0 :         pOutl->SetDefaultLanguage( meLanguage );
     784             : 
     785           0 :         mpOnlineSpellingList = new ShapeList;
     786             :         sal_uInt16 nPage;
     787             : 
     788           0 :         for ( nPage = 0; nPage < GetPageCount(); nPage++ )
     789             :         {
     790             :             // Alle Pages durchsuchen
     791           0 :             FillOnlineSpellingList((SdPage*) GetPage(nPage));
     792             :         }
     793             : 
     794           0 :         for (nPage = 0; nPage < GetMasterPageCount(); nPage++)
     795             :         {
     796             :             // Alle MasterPages durchsuchen
     797           0 :             FillOnlineSpellingList((SdPage*) GetMasterPage(nPage));
     798             :         }
     799             : 
     800           0 :         mpOnlineSpellingList->seekShape(0);
     801           0 :         mpOnlineSpellingTimer = new Timer();
     802           0 :         mpOnlineSpellingTimer->SetTimeoutHdl( LINK(this, SdDrawDocument, OnlineSpellingHdl) );
     803           0 :         mpOnlineSpellingTimer->SetTimeout(250);
     804           0 :         mpOnlineSpellingTimer->Start();
     805             :     }
     806           0 : }
     807             : 
     808             : /*************************************************************************
     809             : |*
     810             : |* OnlineSpelling-Liste fuellen
     811             : |*
     812             : \************************************************************************/
     813             : 
     814           0 : void SdDrawDocument::FillOnlineSpellingList(SdPage* pPage)
     815             : {
     816           0 :     SdrObject* pObj = NULL;
     817           0 :     SdrObjListIter aIter(*pPage, IM_FLAT);
     818             : 
     819           0 :     while (aIter.IsMore())
     820             :     {
     821           0 :         pObj = aIter.Next();
     822             : 
     823           0 :         if( !pObj )
     824           0 :             continue;
     825             : 
     826           0 :         if (pObj->GetOutlinerParaObject())
     827             :         {
     828             :             // Textobjekt gefunden
     829           0 :             mpOnlineSpellingList->addShape(*pObj);
     830             :         }
     831           0 :         else if (pObj->GetObjIdentifier() == OBJ_GRUP)
     832             :         {
     833             :             // Gruppenobjekt gefunden
     834           0 :             SdrObjListIter aGroupIter(*((SdrObjGroup*)pObj)->GetSubList(),
     835           0 :                                       IM_DEEPNOGROUPS);
     836             : 
     837           0 :             sal_Bool bSubTextObjFound = sal_False;
     838             : 
     839           0 :             while (aGroupIter.IsMore() && !bSubTextObjFound)
     840             :             {
     841           0 :                 if (aGroupIter.Next()->GetOutlinerParaObject())
     842             :                 {
     843             :                     // Textobjekt im Gruppenobjekt gefunden
     844           0 :                     bSubTextObjFound = sal_True;
     845             :                 }
     846             :             }
     847             : 
     848           0 :             if (bSubTextObjFound)
     849             :             {
     850           0 :                 mpOnlineSpellingList->addShape(*pObj);
     851           0 :             }
     852             :         }
     853           0 :     }
     854           0 : }
     855             : 
     856             : /*************************************************************************
     857             : |*
     858             : |* OnlineSpelling im Hintergrund
     859             : |*
     860             : \************************************************************************/
     861             : 
     862           0 : IMPL_LINK_NOARG(SdDrawDocument, OnlineSpellingHdl)
     863             : {
     864           0 :     if (mpOnlineSpellingList!=NULL
     865           0 :         && ( !mbOnlineSpell || mpOnlineSpellingList->hasMore()))
     866             :     {
     867             :         /**********************************************************************
     868             :         * Naechstes Objekt spellen
     869             :         **********************************************************************/
     870           0 :         SdrObject* pObj = mpOnlineSpellingList->getNextShape();
     871             : 
     872           0 :         if (pObj)
     873             :         {
     874           0 :             if (pObj->GetOutlinerParaObject() && pObj->ISA(SdrTextObj))
     875             :             {
     876             :                 // Textobjekt spellen
     877           0 :                 SpellObject((SdrTextObj*) pObj);
     878             :             }
     879           0 :             else if (pObj->GetObjIdentifier() == OBJ_GRUP)
     880             :             {
     881             :                 // Gruppenobjekt gefunden
     882           0 :                 SdrObjListIter aGroupIter(*((SdrObjGroup*)pObj)->GetSubList(),
     883           0 :                                           IM_DEEPNOGROUPS);
     884             : 
     885           0 :                 SdrObject* pSubObj = NULL;
     886             : 
     887           0 :                 while (aGroupIter.IsMore())
     888             :                 {
     889           0 :                     pSubObj = aGroupIter.Next();
     890             : 
     891           0 :                     if (pSubObj->GetOutlinerParaObject() && pSubObj->ISA(SdrTextObj))
     892             :                     {
     893             :                         // Textobjekt im Gruppenobjekt gefunden
     894           0 :                         SpellObject((SdrTextObj*) pSubObj);
     895             :                     }
     896           0 :                 }
     897             :             }
     898             :         }
     899             : 
     900             :         // Weitersuchen
     901           0 :         mpOnlineSpellingTimer->Start();
     902             :     }
     903             :     else
     904             :     {
     905             :         // Spelling wurde initial durchgefuehrt
     906           0 :         mbInitialOnlineSpellingEnabled = sal_False;
     907             : 
     908             :         // Suche beenden
     909           0 :         StopOnlineSpelling();
     910             : 
     911           0 :         delete mpOnlineSearchItem;
     912           0 :         mpOnlineSearchItem = NULL;
     913             :     }
     914             : 
     915           0 :     return(0);
     916             : }
     917             : 
     918             : /*************************************************************************
     919             : |*
     920             : |* Objekt spellen (fuer OnlineSpelling)
     921             : |*
     922             : \************************************************************************/
     923             : 
     924           0 : void SdDrawDocument::SpellObject(SdrTextObj* pObj)
     925             : {
     926           0 :     if (pObj && pObj->GetOutlinerParaObject() /* && pObj != pView->GetTextEditObject() */)
     927             :     {
     928           0 :         mbHasOnlineSpellErrors = sal_False;
     929           0 :         ::sd::Outliner* pOutl = GetInternalOutliner(sal_True);
     930           0 :         pOutl->SetUpdateMode(sal_True);
     931           0 :         Link aEvtHdl = pOutl->GetStatusEventHdl();
     932           0 :         pOutl->SetStatusEventHdl(LINK(this, SdDrawDocument, OnlineSpellEventHdl));
     933             : 
     934           0 :         sal_uInt16 nOldOutlMode = pOutl->GetMode();
     935           0 :         sal_uInt16 nOutlMode = OUTLINERMODE_TEXTOBJECT;
     936           0 :         if (((SdrTextObj*) pObj)->GetObjInventor() == SdrInventor &&
     937           0 :             ((SdrTextObj*) pObj)->GetObjIdentifier() == OBJ_OUTLINETEXT)
     938             :         {
     939           0 :             nOutlMode = OUTLINERMODE_OUTLINEOBJECT;
     940             :         }
     941           0 :         pOutl->Init( nOutlMode );
     942             : 
     943             :         // Text in den Outliner setzen
     944           0 :         pOutl->SetText(*((SdrTextObj*) pObj)->GetOutlinerParaObject());
     945             : 
     946           0 :         if (!mpOnlineSearchItem || pOutl->HasText(*mpOnlineSearchItem))
     947             :         {
     948             :             // Spelling
     949           0 :             pOutl->CompleteOnlineSpelling();
     950             : 
     951           0 :             if (mbHasOnlineSpellErrors)
     952             :             {
     953           0 :                 sd::ModifyGuard aGuard( this );
     954           0 :                 SdrModel* pModel = pObj->GetModel();
     955           0 :                 bool bLock = sal_False;
     956           0 :                 if ( pModel )
     957             :                 {
     958           0 :                     bLock = pModel->isLocked();
     959           0 :                     pModel->setLock(true);
     960             :                 }
     961             :                 // taking text from the outliner
     962           0 :                 ((SdrTextObj*) pObj)->SetOutlinerParaObject( pOutl->CreateParaObject() );
     963             : 
     964           0 :                 pObj->BroadcastObjectChange();
     965           0 :                 if ( pModel )
     966           0 :                     pModel->setLock(bLock);
     967             :             }
     968             :         }
     969             : 
     970           0 :         pOutl->SetStatusEventHdl(aEvtHdl);
     971           0 :         pOutl->SetUpdateMode(sal_False);
     972           0 :         pOutl->Init( nOldOutlMode );
     973           0 :         mbHasOnlineSpellErrors = sal_False;
     974             :     }
     975           0 : }
     976             : 
     977             : /*************************************************************************
     978             : |*
     979             : |* Objekt wurde ins Model eingefuegt
     980             : |*
     981             : \************************************************************************/
     982        1426 : void SdDrawDocument::InsertObject(SdrObject* pObj, SdPage* /*pPage*/)
     983             : {
     984        1426 :     if(mpOnlineSpellingList && pObj)
     985             :     {
     986           0 :         if (pObj->GetOutlinerParaObject() || (pObj->GetObjIdentifier() == OBJ_GRUP))
     987             :         {
     988             :             // Objekt in OnlineSpelling-Liste aufnehmen
     989           0 :             mpOnlineSpellingList->addShape(*pObj);
     990             :         }
     991             :     }
     992        1426 : }
     993             : 
     994             : /*************************************************************************
     995             : |*
     996             : |* Objekt wurde aus dem Model entfernt
     997             : |*
     998             : \************************************************************************/
     999         214 : void SdDrawDocument::RemoveObject(SdrObject* pObj, SdPage* /*pPage*/)
    1000             : {
    1001         214 :     if(mpOnlineSpellingList && pObj)
    1002             :     {
    1003           0 :         if (pObj->GetOutlinerParaObject() || (pObj->GetObjIdentifier() == OBJ_GRUP))
    1004             :         {
    1005             :             // Objekt in OnlineSpelling-Liste durch NULL-Pointer ersetzt
    1006           0 :             mpOnlineSpellingList->removeShape(*pObj);
    1007             :         }
    1008             :     }
    1009         214 : }
    1010             : 
    1011             : /*************************************************************************
    1012             : |*
    1013             : |* Callback fuer ExecuteSpellPopup()
    1014             : |*
    1015             : \************************************************************************/
    1016           0 : IMPL_LINK(SdDrawDocument, OnlineSpellEventHdl, EditStatus*, pEditStat)
    1017             : {
    1018           0 :     sal_uLong nStat = pEditStat->GetStatusWord();
    1019           0 :     mbHasOnlineSpellErrors = (nStat & EE_STAT_WRONGWORDCHANGED) != 0;
    1020             : 
    1021           0 :     return(0);
    1022             : }
    1023             : 
    1024             : /*************************************************************************
    1025             : |*
    1026             : |* Callback fuer ExecuteSpellPopup()
    1027             : |*
    1028             : \************************************************************************/
    1029             : 
    1030             : // removed link and replaced with Imp method
    1031           0 : void SdDrawDocument::ImpOnlineSpellCallback(SpellCallbackInfo* pInfo, SdrObject* pObj, SdrOutliner* pOutl)
    1032             : {
    1033           0 :     delete mpOnlineSearchItem;
    1034           0 :     mpOnlineSearchItem = NULL;
    1035             : 
    1036           0 :     sal_uInt16 nCommand = pInfo->nCommand;
    1037             : 
    1038           0 :     if (nCommand == SPELLCMD_IGNOREWORD
    1039             :         // restart when add to dictionary takes place, too.
    1040             :         || nCommand == SPELLCMD_ADDTODICTIONARY)
    1041             :     {
    1042           0 :         if(pObj && pOutl && pObj->ISA(SdrTextObj))
    1043             :         {
    1044           0 :             sal_Bool bModified(IsChanged());
    1045           0 :             ((SdrTextObj*)pObj)->SetOutlinerParaObject(pOutl->CreateParaObject());
    1046           0 :             SetChanged(bModified);
    1047           0 :             pObj->BroadcastObjectChange();
    1048             :         }
    1049             : 
    1050           0 :         mpOnlineSearchItem = new SvxSearchItem( SID_SEARCH_ITEM );
    1051           0 :         mpOnlineSearchItem->SetSearchString(pInfo->aWord);
    1052           0 :         StartOnlineSpelling();
    1053             :     }
    1054           0 :     else if (nCommand == SPELLCMD_STARTSPELLDLG)
    1055             :     {
    1056             :         SfxViewFrame::Current()->GetDispatcher()->Execute( SID_SPELL_DIALOG,
    1057           0 :             SFX_CALLMODE_ASYNCHRON );
    1058             :     }
    1059           0 : }
    1060             : 
    1061             : /*************************************************************************
    1062             : |*
    1063             : |* Eindeutige Namen der StandardLayer durch sprachabhaengige Namen ersetzen
    1064             : |*
    1065             : \************************************************************************/
    1066           0 : void SdDrawDocument::RestoreLayerNames()
    1067             : {
    1068           0 :     SdrLayerAdmin& rLayerAdmin = GetLayerAdmin();
    1069           0 :     sal_uInt16 nLayerCount = rLayerAdmin.GetLayerCount();
    1070             : 
    1071           0 :     for (sal_uInt16 nLayer = 0; nLayer < nLayerCount; nLayer++)
    1072             :     {
    1073           0 :         SdrLayer* pLayer = rLayerAdmin.GetLayer(nLayer);
    1074             : 
    1075           0 :         if (pLayer)
    1076             :         {
    1077           0 :             String aLayerName(pLayer->GetName());
    1078             : 
    1079           0 :             if (aLayerName.EqualsAscii( "LAYER_LAYOUT" ))
    1080             :             {
    1081           0 :                 pLayer->SetName(String(SdResId(STR_LAYER_LAYOUT)));
    1082             :             }
    1083           0 :             else if (aLayerName.EqualsAscii( "LAYER_BCKGRND" ))
    1084             :             {
    1085           0 :                 pLayer->SetName(String(SdResId(STR_LAYER_BCKGRND)));
    1086             :             }
    1087           0 :             else if (aLayerName.EqualsAscii( "LAYER_BACKGRNDOBJ" ))
    1088             :             {
    1089           0 :                 pLayer->SetName(String(SdResId(STR_LAYER_BCKGRNDOBJ)));
    1090             :             }
    1091           0 :             else if (aLayerName.EqualsAscii( "LAYER_CONTROLS" ))
    1092             :             {
    1093           0 :                 pLayer->SetName(String(SdResId(STR_LAYER_CONTROLS)));
    1094             :             }
    1095           0 :             else if (aLayerName.EqualsAscii( "LAYER_MEASURELINES" ))
    1096             :             {
    1097           0 :                 pLayer->SetName(String(SdResId(STR_LAYER_MEASURELINES)));
    1098           0 :             }
    1099             :         }
    1100             :     }
    1101           0 : }
    1102             : 
    1103             : /*************************************************************************
    1104             : |*
    1105             : |* Formatierte Seitennummer zurueckgeben (1, I, i, a, usw.)
    1106             : |*
    1107             : \************************************************************************/
    1108             : 
    1109          92 : String SdDrawDocument::CreatePageNumValue(sal_uInt16 nNum) const
    1110             : {
    1111          92 :     String aPageNumValue;
    1112          92 :     sal_Bool bUpper = sal_False;
    1113             : 
    1114          92 :     switch (mePageNumType)
    1115             :     {
    1116             :         case SVX_CHARS_UPPER_LETTER:
    1117           0 :             aPageNumValue += (sal_Unicode)(char)((nNum - 1) % 26 + 'A');
    1118           0 :             break;
    1119             :         case SVX_CHARS_LOWER_LETTER:
    1120           0 :             aPageNumValue += (sal_Unicode)(char)((nNum - 1) % 26 + 'a');
    1121           0 :             break;
    1122             :         case SVX_ROMAN_UPPER:
    1123           0 :             bUpper = sal_True;
    1124             :         case SVX_ROMAN_LOWER:
    1125           0 :             aPageNumValue += SvxNumberFormat::CreateRomanString(nNum, bUpper);
    1126           0 :             break;
    1127             :         case SVX_NUMBER_NONE:
    1128           0 :             aPageNumValue.Erase();
    1129           0 :             aPageNumValue += sal_Unicode(' ');
    1130           0 :             break;
    1131             :         default:
    1132          92 :             aPageNumValue += rtl::OUString::valueOf(static_cast<sal_Int32>(nNum));
    1133             :     }
    1134             : 
    1135          92 :     return(aPageNumValue);
    1136             : }
    1137             : 
    1138             : 
    1139             : 
    1140             : /*************************************************************************
    1141             : |*
    1142             : |* Layout-Template umbenennen
    1143             : |* Zu beachten ist, das rOldLayoutName im Gegensatz zu rNewName den
    1144             : |* kompletten Layout(!)-Namen enthaelt (inkl. ~LT~)!
    1145             : |*
    1146             : \************************************************************************/
    1147             : 
    1148          10 : void SdDrawDocument::RenameLayoutTemplate(const String& rOldLayoutName, const String& rNewName)
    1149             : {
    1150          10 :     String aOldName(rOldLayoutName);
    1151          10 :     sal_uInt16 nPos = aOldName.SearchAscii( SD_LT_SEPARATOR );
    1152             : 
    1153             :     // erase everything after '~LT~'
    1154          10 :     aOldName.Erase(nPos + sizeof(SD_LT_SEPARATOR) - 1 );
    1155          10 :     sal_uInt16 nLen = aOldName.Len();
    1156             : 
    1157          10 :     std::vector<StyleReplaceData> aReplList;
    1158          10 :     SfxStyleSheetIterator aIter(mxStyleSheetPool.get(), SD_STYLE_FAMILY_MASTERPAGE);
    1159          10 :     SfxStyleSheetBase* pSheet = aIter.First();
    1160             : 
    1161         160 :     while (pSheet)
    1162             :     {
    1163         140 :         String aSheetName = pSheet->GetName();
    1164             : 
    1165             :         // if the sheetname starts with aOldName + "~LT~"
    1166         140 :         if (aSheetName.Match(aOldName) == nLen)
    1167             :         {
    1168         140 :             aSheetName.Erase(0, nLen - sizeof(SD_LT_SEPARATOR) + 1 );
    1169         140 :             aSheetName.Insert(rNewName, 0);
    1170             : 
    1171         140 :             StyleReplaceData aReplData;
    1172         140 :             aReplData.nFamily     = pSheet->GetFamily();
    1173         140 :             aReplData.nNewFamily = pSheet->GetFamily();
    1174         140 :             aReplData.aName   = pSheet->GetName();
    1175         140 :             aReplData.aNewName   = aSheetName;
    1176         140 :             aReplList.push_back(aReplData);
    1177             : 
    1178         140 :             pSheet->SetName(aSheetName);
    1179             :         }
    1180             : 
    1181         140 :         pSheet = aIter.Next();
    1182         140 :     }
    1183             : 
    1184             :     // jetzt noch den Layoutnamen der Zeichen- und der Notizseite
    1185             :     // sowie ihrer Masterpages setzen
    1186          10 :     String aPageLayoutName(rNewName);
    1187          10 :     aPageLayoutName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR ));
    1188          10 :     aPageLayoutName += String(SdResId(STR_LAYOUT_OUTLINE));
    1189             : 
    1190             :     // an allen Seiten, die das jetzt umbeannte Layout benutzen, die
    1191             :     // Textobjekte von der Aenderung unterrichten und Layoutnamen setzen
    1192             :     sal_uInt16 nPage;
    1193          40 :     for (nPage = 0; nPage < GetPageCount(); nPage++)
    1194             :     {
    1195          30 :         SdPage* pPage = (SdPage*) GetPage(nPage);
    1196          30 :         String aTemp(pPage->GetLayoutName());
    1197             : 
    1198          30 :         if (aTemp == rOldLayoutName)
    1199             :         {
    1200          30 :             pPage->SetLayoutName(aPageLayoutName);
    1201             : 
    1202          70 :             for (sal_uLong nObj = 0; nObj < pPage->GetObjCount(); nObj++)
    1203             :             {
    1204          40 :                 SdrObject* pObj = pPage->GetObj(nObj);
    1205             : 
    1206          40 :                 if (pObj->GetObjInventor() == SdrInventor)
    1207             :                 {
    1208          40 :                     switch( pObj->GetObjIdentifier() )
    1209             :                     {
    1210             :                         case OBJ_TEXT:
    1211             :                         case OBJ_OUTLINETEXT:
    1212             :                         case OBJ_TITLETEXT:
    1213             :                         {
    1214          30 :                             OutlinerParaObject* pOPO = ((SdrTextObj*) pObj)->GetOutlinerParaObject();
    1215             : 
    1216          30 :                             if (pOPO)
    1217             :                             {
    1218          30 :                                 std::vector<StyleReplaceData>::iterator it;
    1219         450 :                                 for (it = aReplList.begin(); it != aReplList.end(); ++it)
    1220         420 :                                     pOPO->ChangeStyleSheets( it->aName, it->nFamily, it->aNewName, it->nNewFamily );
    1221             :                             }
    1222             :                         }
    1223          30 :                         break;
    1224             : 
    1225             :                         default:
    1226          10 :                         break;
    1227             :                     }
    1228             :                 }
    1229             :             }
    1230             :         }
    1231          30 :     }
    1232             : 
    1233             :     // und nochmal fuer die Masterpages
    1234             :     // die betroffenen Masterpages erhalten als Seitennamen den Namen
    1235             :     // des Layouts
    1236          40 :     for (nPage = 0; nPage < GetMasterPageCount(); nPage++)
    1237             :     {
    1238          30 :         SdPage* pPage = (SdPage*) GetMasterPage(nPage);
    1239          30 :         String aTemp(pPage->GetLayoutName());
    1240             : 
    1241          30 :         if (aTemp == rOldLayoutName)
    1242             :         {
    1243          30 :             pPage->SetLayoutName(aPageLayoutName);
    1244          30 :             pPage->SetName(rNewName);
    1245             : 
    1246         200 :             for (sal_uLong nObj = 0; nObj < pPage->GetObjCount(); nObj++)
    1247             :             {
    1248         170 :                 SdrObject* pObj = pPage->GetObj(nObj);
    1249             : 
    1250         170 :                 if (pObj->GetObjInventor() == SdrInventor)
    1251             :                 {
    1252         170 :                     switch(pObj->GetObjIdentifier())
    1253             :                     {
    1254             :                         case OBJ_TEXT:
    1255             :                         case OBJ_OUTLINETEXT:
    1256             :                         case OBJ_TITLETEXT:
    1257             :                         {
    1258         110 :                             OutlinerParaObject* pOPO = ((SdrTextObj*)pObj)->GetOutlinerParaObject();
    1259             : 
    1260         110 :                             if (pOPO)
    1261             :                             {
    1262         110 :                                 std::vector<StyleReplaceData>::iterator it;
    1263        1650 :                                 for (it = aReplList.begin(); it != aReplList.end(); ++it)
    1264        1540 :                                     pOPO->ChangeStyleSheets( it->aName, it->nFamily, it->aNewName, it->nNewFamily );
    1265             :                             }
    1266             :                         }
    1267         110 :                         break;
    1268             : 
    1269             :                         default:
    1270          60 :                         break;
    1271             :                     }
    1272             :                 }
    1273             :             }
    1274             :         }
    1275          40 :     }
    1276          10 : }
    1277             : 
    1278             : /*************************************************************************
    1279             : |*
    1280             : |* Outliner-Defaults setzen (Pool-Defaults)
    1281             : |*
    1282             : \************************************************************************/
    1283          40 : void SdDrawDocument::SetTextDefaults() const
    1284             : {
    1285             :     // BulletItem und BulletFont fuer Titel und Gliederung
    1286          40 :     SvxBulletItem aBulletItem(EE_PARA_BULLET);
    1287          40 :     Font aBulletFont( static_cast<SdStyleSheetPool*>( mxStyleSheetPool.get())->GetBulletFont() );
    1288          40 :     aBulletFont.SetSize(Size(0,846));       // 24 pt
    1289          40 :     aBulletItem.SetFont(aBulletFont);
    1290          40 :     aBulletItem.SetStyle(BS_BULLET);
    1291          40 :     aBulletItem.SetStart(1);
    1292          40 :     aBulletItem.SetScale(45);               // in Prozent
    1293          40 :     aBulletItem.SetSymbol( 0x25CF );                // Punkt
    1294          40 :     pItemPool->SetPoolDefaultItem( aBulletItem );
    1295             : 
    1296             :     // Neues BulletItem
    1297          40 :     SvxNumberFormat aNumberFormat(SVX_NUM_CHAR_SPECIAL);
    1298          40 :     aNumberFormat.SetBulletFont(&aBulletFont);
    1299          40 :     aNumberFormat.SetBulletChar( 0x25CF );  // StarBats: 0xF000 + 34
    1300          40 :     aNumberFormat.SetBulletRelSize(45);
    1301          40 :     aNumberFormat.SetBulletColor(Color(COL_AUTO));
    1302          40 :     aNumberFormat.SetStart(1);
    1303          40 :     aNumberFormat.SetNumAdjust(SVX_ADJUST_LEFT);
    1304             : 
    1305          40 :     SvxNumRule aNumRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, 10, sal_False);
    1306             : 
    1307          40 :     aNumberFormat.SetLSpace( 0 );
    1308          40 :     aNumberFormat.SetAbsLSpace( 0 );
    1309          40 :     aNumberFormat.SetFirstLineOffset( 0 );
    1310          40 :     aNumRule.SetLevel( 0, aNumberFormat );
    1311             : 
    1312         400 :     for( sal_uInt16 i = 1; i < aNumRule.GetLevelCount(); i++ )
    1313             :     {
    1314         360 :         const short nLSpace = (i + 1) * 600;
    1315         360 :         aNumberFormat.SetLSpace(nLSpace);
    1316         360 :         aNumberFormat.SetAbsLSpace(nLSpace);
    1317         360 :         aNumberFormat.SetFirstLineOffset(-600);
    1318         360 :         aNumRule.SetLevel( i, aNumberFormat );
    1319             :     }
    1320             : 
    1321          40 :     SvxNumBulletItem aNumBulletItem( aNumRule, EE_PARA_NUMBULLET );
    1322          40 :     pItemPool->SetPoolDefaultItem( aNumBulletItem );
    1323          40 : }
    1324             : 
    1325         214 : ::com::sun::star::text::WritingMode SdDrawDocument::GetDefaultWritingMode() const
    1326             : {
    1327         214 :     const SfxPoolItem*                  pItem = ( pItemPool ? pItemPool->GetPoolDefaultItem( EE_PARA_WRITINGDIR ) : NULL );
    1328         214 :     ::com::sun::star::text::WritingMode eRet = ::com::sun::star::text::WritingMode_LR_TB;
    1329             : 
    1330         214 :     if( pItem )
    1331             :     {
    1332          32 :         switch( ( (SvxFrameDirectionItem&)( *pItem ) ).GetValue() )
    1333             :         {
    1334          32 :             case( FRMDIR_HORI_LEFT_TOP ): eRet = ::com::sun::star::text::WritingMode_LR_TB; break;
    1335           0 :             case( FRMDIR_HORI_RIGHT_TOP ): eRet = ::com::sun::star::text::WritingMode_RL_TB; break;
    1336           0 :             case( FRMDIR_VERT_TOP_RIGHT ): eRet = ::com::sun::star::text::WritingMode_TB_RL; break;
    1337             : 
    1338             :             default:
    1339             :                 OSL_FAIL( "Frame direction not supported yet" );
    1340           0 :             break;
    1341             :         }
    1342             :     }
    1343             : 
    1344         214 :     return eRet;
    1345             : }
    1346             : 
    1347           0 : void SdDrawDocument::SetDefaultWritingMode(::com::sun::star::text::WritingMode eMode )
    1348             : {
    1349           0 :     if( pItemPool )
    1350             :     {
    1351             :         SvxFrameDirection nVal;
    1352           0 :         switch( eMode )
    1353             :         {
    1354           0 :         case ::com::sun::star::text::WritingMode_LR_TB: nVal = FRMDIR_HORI_LEFT_TOP; break;
    1355           0 :         case ::com::sun::star::text::WritingMode_RL_TB: nVal = FRMDIR_HORI_RIGHT_TOP; break;
    1356           0 :         case ::com::sun::star::text::WritingMode_TB_RL: nVal = FRMDIR_VERT_TOP_RIGHT; break;
    1357             :         default:
    1358             :             OSL_FAIL( "Frame direction not supported yet" );
    1359           0 :             return;
    1360             :         }
    1361             : 
    1362           0 :         SvxFrameDirectionItem aModeItem( nVal, EE_PARA_WRITINGDIR );
    1363           0 :         pItemPool->SetPoolDefaultItem( aModeItem );
    1364             : 
    1365           0 :         SvxAdjustItem aAdjust( SVX_ADJUST_LEFT, EE_PARA_JUST );
    1366             : 
    1367           0 :         if( eMode == ::com::sun::star::text::WritingMode_RL_TB )
    1368           0 :             aAdjust.SetEnumValue( SVX_ADJUST_RIGHT );
    1369             : 
    1370           0 :         pItemPool->SetPoolDefaultItem( aAdjust );
    1371             : 
    1372             : 
    1373             :     }
    1374             : }
    1375             : 
    1376          78 : void SdDrawDocument::getDefaultFonts( Font& rLatinFont, Font& rCJKFont, Font& rCTLFont )
    1377             : {
    1378          78 :     LanguageType eLatin = GetLanguage( EE_CHAR_LANGUAGE );
    1379             : 
    1380             :     //  If the UI language is Korean, the default Latin font has to
    1381             :     //  be queried for Korean, too (the Latin language from the document can't be Korean).
    1382             :     //  This is the same logic as in SwDocShell::InitNew.
    1383          78 :     LanguageType eUiLanguage = Application::GetSettings().GetUILanguageTag().getLanguageType();
    1384          78 :     if (MsLangId::isKorean(eUiLanguage))
    1385           0 :         eLatin = eUiLanguage;
    1386             : 
    1387          78 :     rLatinFont = OutputDevice::GetDefaultFont( DEFAULTFONT_LATIN_PRESENTATION, eLatin, DEFAULTFONT_FLAGS_ONLYONE );
    1388          78 :     rCJKFont = OutputDevice::GetDefaultFont( DEFAULTFONT_CJK_PRESENTATION, GetLanguage( EE_CHAR_LANGUAGE_CJK ), DEFAULTFONT_FLAGS_ONLYONE );
    1389          78 :     rCTLFont = OutputDevice::GetDefaultFont( DEFAULTFONT_CTL_PRESENTATION, GetLanguage( EE_CHAR_LANGUAGE_CTL ), DEFAULTFONT_FLAGS_ONLYONE ) ;
    1390          78 : }
    1391             : 
    1392             : /* converts the given western font height to a corresponding ctl font height, deppending on the system language */
    1393         340 : sal_uInt32 SdDrawDocument::convertFontHeightToCTL( sal_uInt32 nWesternFontHeight )
    1394             : {
    1395         340 :     LanguageType eRealCTLLanguage = Application::GetSettings().GetLanguageTag().getLanguageType();
    1396         340 :     if( LANGUAGE_THAI == eRealCTLLanguage )
    1397             :     {
    1398             :         // http://specs.openoffice.org/g11n/font_sizes/42775_42725_Individual_configurable_font_size_for_default_fonts.odt
    1399           0 :         double fTemp = double(nWesternFontHeight) * 1.333;
    1400           0 :         nWesternFontHeight = (sal_uInt32)fTemp;
    1401             :         // make some nice values for UI that displays PT instead of 1/100th mm
    1402           0 :         nWesternFontHeight = ((nWesternFontHeight * 72) + 1270) / 2540L;
    1403           0 :         nWesternFontHeight = ((nWesternFontHeight * 2540L) + 36) / 72;
    1404             :     }
    1405         340 :     return nWesternFontHeight;
    1406             : }
    1407             : 
    1408          12 : SdStyleSheetPool* SdDrawDocument::GetSdStyleSheetPool() const
    1409             : {
    1410          12 :     return dynamic_cast< SdStyleSheetPool* >( GetStyleSheetPool() );
    1411             : }
    1412             : 
    1413           0 : ModifyGuard::ModifyGuard( SdDrawDocument* pDoc )
    1414           0 : : mpDocShell( 0 ), mpDoc( pDoc )
    1415             : {
    1416           0 :     init();
    1417           0 : }
    1418             : 
    1419           0 : void ModifyGuard::init()
    1420             : {
    1421           0 :     if( mpDocShell )
    1422             :     {
    1423           0 :         mpDoc = mpDocShell->GetDoc();
    1424             :     }
    1425           0 :     else if( mpDoc )
    1426             :     {
    1427           0 :         mpDocShell = mpDoc->GetDocSh();
    1428             :     }
    1429             : 
    1430           0 :     mbIsEnableSetModified = mpDocShell ? mpDocShell->IsEnableSetModified() : sal_False;
    1431           0 :     mbIsDocumentChanged = mpDoc ? mpDoc->IsChanged() : sal_False;
    1432             : 
    1433           0 :     if( mbIsEnableSetModified )
    1434           0 :         mpDocShell->EnableSetModified( sal_False );
    1435           0 : }
    1436             : 
    1437           0 : ModifyGuard::~ModifyGuard()
    1438             : {
    1439           0 :     if( mbIsEnableSetModified )
    1440           0 :         mpDocShell->EnableSetModified( sal_True );
    1441             : 
    1442           0 :     if( mpDoc && (mpDoc->IsChanged() != mbIsDocumentChanged) )
    1443           0 :         mpDoc->SetChanged(mbIsDocumentChanged);
    1444           0 : }
    1445             : 
    1446             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10