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