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 ); 19370d3707aSArmin 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 324*4bf7a51aSArmin Le Grand // ---- Object no fill no line ------------------------------------------- 325*4bf7a51aSArmin Le Grand 326*4bf7a51aSArmin Le Grand aName = String(SdResId(STR_POOLSHEET_OBJNOLINENOFILL)); 327*4bf7a51aSArmin Le Grand pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask)); 328*4bf7a51aSArmin Le Grand pSheet->SetParent(aStdName); 329*4bf7a51aSArmin Le Grand pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_OBJNOLINENOFILL ); 330*4bf7a51aSArmin Le Grand pISet = &pSheet->GetItemSet(); 331*4bf7a51aSArmin Le Grand 332*4bf7a51aSArmin Le Grand pISet->Put(XFillStyleItem(XFILL_NONE)); 333*4bf7a51aSArmin Le Grand pISet->Put(XLineStyleItem(XLINE_NONE)); 334*4bf7a51aSArmin Le Grand 335cdf0e10cSrcweir // ---- Text ---------------------------------------------------------- 336cdf0e10cSrcweir 337cdf0e10cSrcweir aName = String(SdResId(STR_POOLSHEET_TEXT)); 338cdf0e10cSrcweir pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask)); 339cdf0e10cSrcweir pSheet->SetParent(aStdName); 340cdf0e10cSrcweir pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_TEXT ); 341cdf0e10cSrcweir pISet = &pSheet->GetItemSet(); 342cdf0e10cSrcweir 343cdf0e10cSrcweir pISet->Put(XLineStyleItem(XLINE_NONE)); 344cdf0e10cSrcweir pISet->Put(XFillStyleItem(XFILL_NONE)); 345cdf0e10cSrcweir 346cdf0e10cSrcweir // ---- Textk�rper ---------------------------------------------------- 347cdf0e10cSrcweir 348cdf0e10cSrcweir aName = String(SdResId(STR_POOLSHEET_TEXTBODY)); 349cdf0e10cSrcweir pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask)); 350cdf0e10cSrcweir pSheet->SetParent(aStdName); 351cdf0e10cSrcweir pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_TEXTBODY ); 352cdf0e10cSrcweir pISet = &pSheet->GetItemSet(); 353cdf0e10cSrcweir 354cdf0e10cSrcweir pISet->Put(XLineStyleItem(XLINE_NONE)); 355cdf0e10cSrcweir pISet->Put(XFillStyleItem(XFILL_NONE)); 356cdf0e10cSrcweir 357cdf0e10cSrcweir pISet->Put(SvxFontHeightItem(564, 100, EE_CHAR_FONTHEIGHT)); // 16 pt 358cdf0e10cSrcweir 359cdf0e10cSrcweir // ---- Textk�rper mit Blocksatz -------------------------------------- 360cdf0e10cSrcweir 361cdf0e10cSrcweir aName = String(SdResId(STR_POOLSHEET_TEXTBODY_JUSTIFY)); 362cdf0e10cSrcweir pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask)); 363cdf0e10cSrcweir pSheet->SetParent(aStdName); 364cdf0e10cSrcweir pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_TEXTBODY_JUSTIFY ); 365cdf0e10cSrcweir pISet = &pSheet->GetItemSet(); 366cdf0e10cSrcweir 367cdf0e10cSrcweir pISet->Put(XLineStyleItem(XLINE_NONE)); 368cdf0e10cSrcweir pISet->Put(XFillStyleItem(XFILL_NONE)); 369cdf0e10cSrcweir 370cdf0e10cSrcweir pISet->Put(SvxAdjustItem(SVX_ADJUST_BLOCK, EE_PARA_JUST )); 371cdf0e10cSrcweir 372cdf0e10cSrcweir // ---- Textkoerper mit Einzug ----------------------------------------- 373cdf0e10cSrcweir 374cdf0e10cSrcweir aName = String(SdResId(STR_POOLSHEET_TEXTBODY_INDENT)); 375cdf0e10cSrcweir pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask)); 376cdf0e10cSrcweir pSheet->SetParent(aStdName); 377cdf0e10cSrcweir pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_TEXTBODY_INDENT ); 378cdf0e10cSrcweir pISet = &pSheet->GetItemSet(); 379cdf0e10cSrcweir 380cdf0e10cSrcweir pISet->Put(XLineStyleItem(XLINE_NONE)); 381cdf0e10cSrcweir pISet->Put(XFillStyleItem(XFILL_NONE)); 382cdf0e10cSrcweir 383cdf0e10cSrcweir SvxLRSpaceItem aLRSpaceItem( EE_PARA_LRSPACE ); 384cdf0e10cSrcweir aLRSpaceItem.SetTxtFirstLineOfst(600); // Erstzeileneinzug 6mm, rechts 0 385cdf0e10cSrcweir pISet->Put(aLRSpaceItem); 386cdf0e10cSrcweir 387cdf0e10cSrcweir /* #i35937# 388cdf0e10cSrcweir // SvxLRSpaceItem hart gesetzt: NumBulletItem anpassen 389cdf0e10cSrcweir SvxNumBulletItem aNumBullet( (const SvxNumBulletItem&) pISet->Get(EE_PARA_NUMBULLET) ); 390cdf0e10cSrcweir EditEngine::ImportBulletItem( aNumBullet, 0, NULL, &aLRSpaceItem ); 391cdf0e10cSrcweir pISet->Put( aNumBullet ); 392cdf0e10cSrcweir */ 393cdf0e10cSrcweir // ---- Titel --------------------------------------------------------- 394cdf0e10cSrcweir 395cdf0e10cSrcweir aName = String(SdResId(STR_POOLSHEET_TITLE)); 396cdf0e10cSrcweir pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask)); 397cdf0e10cSrcweir pSheet->SetParent(aStdName); 398cdf0e10cSrcweir pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_TITLE ); 399cdf0e10cSrcweir pISet = &pSheet->GetItemSet(); 400cdf0e10cSrcweir 401cdf0e10cSrcweir pISet->Put(XLineStyleItem(XLINE_NONE)); 402cdf0e10cSrcweir pISet->Put(XFillStyleItem(XFILL_NONE)); 403cdf0e10cSrcweir 404cdf0e10cSrcweir pISet->Put(SvxFontHeightItem(1551, 100, EE_CHAR_FONTHEIGHT )); // 44 pt 405cdf0e10cSrcweir 406cdf0e10cSrcweir // ---- Titel1 -------------------------------------------------------- 407cdf0e10cSrcweir 408cdf0e10cSrcweir aName = String(SdResId(STR_POOLSHEET_TITLE1)); 409cdf0e10cSrcweir pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask)); 410cdf0e10cSrcweir pSheet->SetParent(aStdName); 411cdf0e10cSrcweir pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_TITLE1 ); 412cdf0e10cSrcweir pISet = &pSheet->GetItemSet(); 413cdf0e10cSrcweir 414cdf0e10cSrcweir pISet->Put(XLineStyleItem(XLINE_NONE)); 415cdf0e10cSrcweir pISet->Put(XFillStyleItem(XFILL_SOLID)); 416cdf0e10cSrcweir pISet->Put(XFillColorItem(String(), RGB_Color(COL_CYAN))); 417cdf0e10cSrcweir 418cdf0e10cSrcweir pISet->Put(SdrShadowItem(sal_True)); 419cdf0e10cSrcweir pISet->Put(SdrShadowColorItem(aNullStr, RGB_Color(COL_GRAY))); 420cdf0e10cSrcweir pISet->Put(SdrShadowXDistItem(200)); // 2 mm Schattendistanz 421cdf0e10cSrcweir pISet->Put(SdrShadowYDistItem(200)); 422cdf0e10cSrcweir 423cdf0e10cSrcweir pISet->Put(SvxFontHeightItem(846, 100, EE_CHAR_FONTHEIGHT )); // 24 pt 424cdf0e10cSrcweir 425cdf0e10cSrcweir pISet->Put(SvxAdjustItem(SVX_ADJUST_CENTER, EE_PARA_JUST )); 426cdf0e10cSrcweir 427cdf0e10cSrcweir // ---- Titel2 -------------------------------------------------------- 428cdf0e10cSrcweir 429cdf0e10cSrcweir aName = String(SdResId(STR_POOLSHEET_TITLE2)); 430cdf0e10cSrcweir pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask)); 431cdf0e10cSrcweir pSheet->SetParent(aStdName); 432cdf0e10cSrcweir pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_TITLE2 ); 433cdf0e10cSrcweir pISet = &pSheet->GetItemSet(); 434cdf0e10cSrcweir 435cdf0e10cSrcweir pISet->Put(XLineWidthItem(50)); 436cdf0e10cSrcweir 437cdf0e10cSrcweir // Farbe nicht aus der Farbtabelle holen, denn da kann diese Farbe 438cdf0e10cSrcweir // geloescht oder veraendert sein 439cdf0e10cSrcweir Color aOrange4(255, 204, 153); 440cdf0e10cSrcweir pISet->Put(XFillColorItem(String(), aOrange4)); 441cdf0e10cSrcweir 442cdf0e10cSrcweir pISet->Put(SdrShadowItem(sal_True)); 443cdf0e10cSrcweir pISet->Put(SdrShadowColorItem(aNullStr, RGB_Color(COL_GRAY))); 444cdf0e10cSrcweir pISet->Put(SdrShadowXDistItem(200)); // 2 mm Schattendistanz 445cdf0e10cSrcweir pISet->Put(SdrShadowYDistItem(200)); 446cdf0e10cSrcweir 447cdf0e10cSrcweir pISet->Put(SvxFontHeightItem(1270, 100, EE_CHAR_FONTHEIGHT )); // 36 pt 448cdf0e10cSrcweir 449cdf0e10cSrcweir SvxLRSpaceItem aLRSpItem( 200, 200, 0, 0, EE_PARA_LRSPACE); 450cdf0e10cSrcweir pISet->Put( aLRSpItem ); // Erstzeileneinzug 0 mm, links und rechts 2 mm 451cdf0e10cSrcweir 452cdf0e10cSrcweir /* #i35937# 453cdf0e10cSrcweir // SvxLRSpaceItem hart gesetzt: NumBulletItem anpassen 454cdf0e10cSrcweir SvxNumBulletItem aNmBullet( (const SvxNumBulletItem&) pISet->Get(EE_PARA_NUMBULLET) ); 455cdf0e10cSrcweir EditEngine::ImportBulletItem( aNmBullet, 0, NULL, &aLRSpItem ); 456cdf0e10cSrcweir pISet->Put( aNmBullet ); 457cdf0e10cSrcweir */ 458cdf0e10cSrcweir 459cdf0e10cSrcweir pISet->Put(SvxULSpaceItem(100, 100, EE_PARA_ULSPACE )); // Absatzrand oben/unten 1 mm 460cdf0e10cSrcweir 461cdf0e10cSrcweir pISet->Put(SvxAdjustItem(SVX_ADJUST_CENTER, EE_PARA_JUST )); 462cdf0e10cSrcweir 463cdf0e10cSrcweir // ---- Ueberschrift --------------------------------------------------- 464cdf0e10cSrcweir 465cdf0e10cSrcweir aName = String(SdResId(STR_POOLSHEET_HEADLINE)); 466cdf0e10cSrcweir pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask)); 467cdf0e10cSrcweir pSheet->SetParent(aStdName); 468cdf0e10cSrcweir pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_HEADLINE ); 469cdf0e10cSrcweir pISet = &pSheet->GetItemSet(); 470cdf0e10cSrcweir 471cdf0e10cSrcweir pISet->Put(XLineStyleItem(XLINE_NONE)); 472cdf0e10cSrcweir pISet->Put(XFillStyleItem(XFILL_NONE)); 473cdf0e10cSrcweir 474cdf0e10cSrcweir pISet->Put(SvxFontHeightItem(846, 100, EE_CHAR_FONTHEIGHT )); // 24 pt 475cdf0e10cSrcweir 476cdf0e10cSrcweir pISet->Put(SvxULSpaceItem(420, 210, EE_PARA_ULSPACE )); // Absatzrand oben 4,2 mm, 477cdf0e10cSrcweir // unten 2,1 mm 478cdf0e10cSrcweir 479cdf0e10cSrcweir // ---- Ueberschrift1 -------------------------------------------------- 480cdf0e10cSrcweir 481cdf0e10cSrcweir aName = String(SdResId(STR_POOLSHEET_HEADLINE1)); 482cdf0e10cSrcweir pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask)); 483cdf0e10cSrcweir pSheet->SetParent(aStdName); 484cdf0e10cSrcweir pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_HEADLINE1 ); 485cdf0e10cSrcweir pISet = &pSheet->GetItemSet(); 486cdf0e10cSrcweir 487cdf0e10cSrcweir pISet->Put(XLineStyleItem(XLINE_NONE)); 488cdf0e10cSrcweir pISet->Put(XFillStyleItem(XFILL_NONE)); 489cdf0e10cSrcweir 490cdf0e10cSrcweir pISet->Put(SvxWeightItem(WEIGHT_BOLD, EE_CHAR_WEIGHT )); 491cdf0e10cSrcweir 492cdf0e10cSrcweir pISet->Put(SvxFontHeightItem(635, 100, EE_CHAR_FONTHEIGHT )); // 18 pt 493cdf0e10cSrcweir 494cdf0e10cSrcweir pISet->Put(SvxULSpaceItem(420, 210, EE_PARA_ULSPACE )); // Absatzrand oben 4,2 mm, 495cdf0e10cSrcweir // unten 2,1 mm 496cdf0e10cSrcweir 497cdf0e10cSrcweir // ---- Ueberschrift2 -------------------------------------------------- 498cdf0e10cSrcweir 499cdf0e10cSrcweir aName = String(SdResId(STR_POOLSHEET_HEADLINE2)); 500cdf0e10cSrcweir pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask)); 501cdf0e10cSrcweir pSheet->SetParent(aStdName); 502cdf0e10cSrcweir pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_HEADLINE2 ); 503cdf0e10cSrcweir pISet = &pSheet->GetItemSet(); 504cdf0e10cSrcweir 505cdf0e10cSrcweir pISet->Put(XLineStyleItem(XLINE_NONE)); 506cdf0e10cSrcweir pISet->Put(XFillStyleItem(XFILL_NONE)); 507cdf0e10cSrcweir 508cdf0e10cSrcweir pISet->Put(SvxPostureItem(ITALIC_NORMAL, EE_CHAR_ITALIC )); 509cdf0e10cSrcweir pISet->Put(SvxWeightItem(WEIGHT_BOLD, EE_CHAR_WEIGHT)); 510cdf0e10cSrcweir 511cdf0e10cSrcweir pISet->Put(SvxFontHeightItem(494, 100, EE_CHAR_FONTHEIGHT )); // 14 pt 512cdf0e10cSrcweir 513cdf0e10cSrcweir pISet->Put(SvxULSpaceItem(420, 210, EE_PARA_ULSPACE )); // Absatzrand oben 4,2 mm, 514cdf0e10cSrcweir // unten 2,1 mm 515cdf0e10cSrcweir 516cdf0e10cSrcweir // ---- Bemassung -------------------------------------------------- 517cdf0e10cSrcweir 518cdf0e10cSrcweir aName = String(SdResId(STR_POOLSHEET_MEASURE)); 519cdf0e10cSrcweir pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask)); 520cdf0e10cSrcweir pSheet->SetParent(aStdName); 521cdf0e10cSrcweir pSheet->SetHelpId( aHelpFile, HID_POOLSHEET_MEASURE ); 522cdf0e10cSrcweir pISet = &pSheet->GetItemSet(); 523cdf0e10cSrcweir 524cdf0e10cSrcweir pISet->Put(XFillStyleItem(XFILL_NONE)); 525cdf0e10cSrcweir pISet->Put(XLineColorItem(String(), RGB_Color(COL_BLACK))); 526cdf0e10cSrcweir 527cdf0e10cSrcweir pISet->Put(SvxFontHeightItem(423, 100, EE_CHAR_FONTHEIGHT )); // 12 pt 528cdf0e10cSrcweir 529cdf0e10cSrcweir pISet->Put(XLineStartItem(SVX_RESSTR(RID_SVXSTR_ARROW),::basegfx::B2DPolyPolygon(aArrow))); 530cdf0e10cSrcweir pISet->Put(XLineStartWidthItem(200)); 531cdf0e10cSrcweir pISet->Put(XLineEndItem(SVX_RESSTR(RID_SVXSTR_ARROW),::basegfx::B2DPolyPolygon(aArrow))); 532cdf0e10cSrcweir pISet->Put(XLineEndWidthItem(200)); 533cdf0e10cSrcweir pISet->Put(XLineStyleItem(XLINE_SOLID)); 534cdf0e10cSrcweir pISet->Put(SdrMeasureShowUnitItem(true)); 535cdf0e10cSrcweir 536cdf0e10cSrcweir // Praesentationsvorlagen fuer das Standardlayout erzeugen 537cdf0e10cSrcweir String aPrefix = String(SdResId(STR_LAYOUT_DEFAULT_NAME)); 538cdf0e10cSrcweir pSSPool->CreateLayoutStyleSheets(aPrefix); 539cdf0e10cSrcweir } 540cdf0e10cSrcweir 541cdf0e10cSrcweir static Any implMakeSolidCellStyle( SdStyleSheetPool* pSSPool, const OUString& rName, const OUString rParent, const Color& rColor ) 542cdf0e10cSrcweir { 543cdf0e10cSrcweir SfxStyleSheetBase* pSheet = &(pSSPool->Make(rName, SD_STYLE_FAMILY_CELL, SFXSTYLEBIT_AUTO)); 544cdf0e10cSrcweir pSheet->SetParent(rParent); 545cdf0e10cSrcweir SfxItemSet* pISet = &pSheet->GetItemSet(); 546cdf0e10cSrcweir pISet->Put(XFillStyleItem(XFILL_SOLID)); 547cdf0e10cSrcweir pISet->Put(XFillColorItem(String(), rColor)); 548cdf0e10cSrcweir 549cdf0e10cSrcweir return Any( Reference< XStyle >( static_cast< XWeak* >( pSheet ), UNO_QUERY ) ); 550cdf0e10cSrcweir } 551cdf0e10cSrcweir 552cdf0e10cSrcweir static void implCreateTableTemplate( const Reference< XNameContainer >& xTableFamily, const OUString& rName, const Any& rBody, const Any& rHeading, const Any& rBanding ) 553cdf0e10cSrcweir { 554cdf0e10cSrcweir if( xTableFamily.is() ) try 555cdf0e10cSrcweir { 556cdf0e10cSrcweir if( !xTableFamily->hasByName( OUString( rName ) ) ) 557cdf0e10cSrcweir { 558cdf0e10cSrcweir Reference< XSingleServiceFactory > xFactory( xTableFamily, UNO_QUERY_THROW ); 559cdf0e10cSrcweir Reference< XNameReplace > xDefaultTableStyle( xFactory->createInstance(), UNO_QUERY_THROW ); 560cdf0e10cSrcweir xTableFamily->insertByName( OUString( rName ), Any( xDefaultTableStyle ) ); 561cdf0e10cSrcweir 562cdf0e10cSrcweir xDefaultTableStyle->replaceByName( OUString( RTL_CONSTASCII_USTRINGPARAM("body") ), rBody ); 563cdf0e10cSrcweir xDefaultTableStyle->replaceByName( OUString( RTL_CONSTASCII_USTRINGPARAM("odd-rows") ), rBanding ); 564cdf0e10cSrcweir xDefaultTableStyle->replaceByName( OUString( RTL_CONSTASCII_USTRINGPARAM("odd-columns") ), rBanding ); 565cdf0e10cSrcweir xDefaultTableStyle->replaceByName( OUString( RTL_CONSTASCII_USTRINGPARAM("first-row") ), rHeading ); 566cdf0e10cSrcweir xDefaultTableStyle->replaceByName( OUString( RTL_CONSTASCII_USTRINGPARAM("first-column") ), rHeading ); 567cdf0e10cSrcweir xDefaultTableStyle->replaceByName( OUString( RTL_CONSTASCII_USTRINGPARAM("last-row") ), rHeading ); 568cdf0e10cSrcweir xDefaultTableStyle->replaceByName( OUString( RTL_CONSTASCII_USTRINGPARAM("last-column") ), rHeading ); 569cdf0e10cSrcweir } 570cdf0e10cSrcweir } 571cdf0e10cSrcweir catch( Exception& ) 572cdf0e10cSrcweir { 573cdf0e10cSrcweir DBG_ERROR("sd::implCreateTableTemplate(), exception caught!"); 574cdf0e10cSrcweir } 575cdf0e10cSrcweir } 576cdf0e10cSrcweir 577cdf0e10cSrcweir void SdDrawDocument::CreateDefaultCellStyles() 578cdf0e10cSrcweir { 579cdf0e10cSrcweir SdStyleSheetPool* pSSPool = static_cast< SdStyleSheetPool* >(GetStyleSheetPool()); 580cdf0e10cSrcweir SfxStyleSheetBase* pSheet = NULL; 581cdf0e10cSrcweir String aHelpFile; 582cdf0e10cSrcweir 583cdf0e10cSrcweir const OUString sFamilyName( RTL_CONSTASCII_USTRINGPARAM( "table" ) ); 584cdf0e10cSrcweir Reference< XNameContainer > xTableFamily( pSSPool->getByName( sFamilyName ), UNO_QUERY ); 585cdf0e10cSrcweir 586cdf0e10cSrcweir // ---- Default ----------------------------------------------- 587cdf0e10cSrcweir 588cdf0e10cSrcweir sal_uInt16 nMask = SFXSTYLEBIT_AUTO; 589cdf0e10cSrcweir 590cdf0e10cSrcweir OUString aDefaultCellStyleName( RTL_CONSTASCII_USTRINGPARAM("default") ); 591cdf0e10cSrcweir 592cdf0e10cSrcweir pSheet = &(pSSPool->Make(aDefaultCellStyleName, SD_STYLE_FAMILY_CELL, nMask)); 593cdf0e10cSrcweir pSheet->SetHelpId( aHelpFile, HID_SD_CELL_STYLE_DEFAULT ); 594cdf0e10cSrcweir SfxItemSet& rISet = pSheet->GetItemSet(); 595cdf0e10cSrcweir // SfxItemPool* pPool = rISet.GetPool(); 596cdf0e10cSrcweir 597cdf0e10cSrcweir String aNullStr; 598cdf0e10cSrcweir 599cdf0e10cSrcweir Color aNullCol(RGB_Color(COL_BLACK)); 600cdf0e10cSrcweir 601cdf0e10cSrcweir XDash aNullDash; 602cdf0e10cSrcweir XGradient aNullGrad(aNullCol,RGB_Color(COL_WHITE)); 603cdf0e10cSrcweir aNullGrad.SetStartIntens( 100 ); 604cdf0e10cSrcweir aNullGrad.SetEndIntens( 100 ); 605cdf0e10cSrcweir XHatch aNullHatch(aNullCol); 606cdf0e10cSrcweir 607cdf0e10cSrcweir rISet.Put(XFillStyleItem(XFILL_SOLID)); 608cdf0e10cSrcweir rISet.Put(XFillColorItem(String(), RGB_Color(0x00ccccff))); 609cdf0e10cSrcweir 610cdf0e10cSrcweir Font aLatinFont, aCJKFont, aCTLFont; 611cdf0e10cSrcweir 612cdf0e10cSrcweir getDefaultFonts( aLatinFont, aCJKFont, aCTLFont ); 613cdf0e10cSrcweir 614cdf0e10cSrcweir SvxFontItem aSvxFontItem( aLatinFont.GetFamily(), aLatinFont.GetName(), aLatinFont.GetStyleName(), aLatinFont.GetPitch(), 615cdf0e10cSrcweir aLatinFont.GetCharSet(), EE_CHAR_FONTINFO ); 616cdf0e10cSrcweir 617cdf0e10cSrcweir SvxFontItem aSvxFontItemCJK( aCJKFont.GetFamily(), aCJKFont.GetName(), aCJKFont.GetStyleName(), aCJKFont.GetPitch(), 618cdf0e10cSrcweir aCJKFont.GetCharSet(), EE_CHAR_FONTINFO_CJK ); 619cdf0e10cSrcweir 620cdf0e10cSrcweir SvxFontItem aSvxFontItemCTL( aCTLFont.GetFamily(), aCTLFont.GetName(), aCTLFont.GetStyleName(), aCTLFont.GetPitch(), 621cdf0e10cSrcweir aCTLFont.GetCharSet(), EE_CHAR_FONTINFO_CTL ); 622cdf0e10cSrcweir 623cdf0e10cSrcweir rISet.Put( aSvxFontItem ); 624cdf0e10cSrcweir rISet.Put( aSvxFontItemCJK ); 625cdf0e10cSrcweir rISet.Put( aSvxFontItemCTL ); 626cdf0e10cSrcweir 627cdf0e10cSrcweir rISet.Put( SvxFontHeightItem( 635, 100, EE_CHAR_FONTHEIGHT ) ); // sj: (i33745) changed default from 24 to 18 pt 628cdf0e10cSrcweir rISet.Put( SvxFontHeightItem( 635, 100, EE_CHAR_FONTHEIGHT_CJK ) ); // 18 pt 629cdf0e10cSrcweir rISet.Put( SvxFontHeightItem( convertFontHeightToCTL( 635 ), 100, EE_CHAR_FONTHEIGHT_CTL ) ); // 18 pt 630cdf0e10cSrcweir 631cdf0e10cSrcweir // rISet.Put( SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT ) ); 632cdf0e10cSrcweir // rISet.Put( SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CJK ) ); 633cdf0e10cSrcweir // rISet.Put( SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CTL ) ); 634cdf0e10cSrcweir 635cdf0e10cSrcweir // rISet.Put( SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC ) ); 636cdf0e10cSrcweir // rISet.Put( SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CJK ) ); 637cdf0e10cSrcweir // rISet.Put( SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CTL ) ); 638cdf0e10cSrcweir 639cdf0e10cSrcweir // rISet.Put(SvxContourItem(sal_False, EE_CHAR_OUTLINE )); 640cdf0e10cSrcweir // rISet.Put(SvxShadowedItem(sal_False, EE_CHAR_SHADOW )); 641cdf0e10cSrcweir // rISet.Put(SvxUnderlineItem(UNDERLINE_NONE, EE_CHAR_UNDERLINE)); 642cdf0e10cSrcweir // rISet.Put(SvxOverlineItem(UNDERLINE_NONE, EE_CHAR_OVERLINE)); 643cdf0e10cSrcweir // rISet.Put(SvxCrossedOutItem(STRIKEOUT_NONE, EE_CHAR_STRIKEOUT )); 644cdf0e10cSrcweir // rISet.Put(SvxEmphasisMarkItem(EMPHASISMARK_NONE, EE_CHAR_EMPHASISMARK)); 645cdf0e10cSrcweir // rISet.Put(SvxCharReliefItem(RELIEF_NONE, EE_CHAR_RELIEF)); 646cdf0e10cSrcweir rISet.Put(SvxColorItem(Color(COL_AUTO), EE_CHAR_COLOR )); 647cdf0e10cSrcweir 648cdf0e10cSrcweir // Absatzattribute (Edit Engine) 649cdf0e10cSrcweir rISet.Put(SvxLRSpaceItem(EE_PARA_LRSPACE)); 650cdf0e10cSrcweir rISet.Put(SvxULSpaceItem(EE_PARA_ULSPACE)); 651cdf0e10cSrcweir 652cdf0e10cSrcweir rISet.Put( SdrTextLeftDistItem( 250 ) ); 653cdf0e10cSrcweir rISet.Put( SdrTextRightDistItem( 250 ) ); 654cdf0e10cSrcweir rISet.Put( SdrTextUpperDistItem( 130 ) ); 655cdf0e10cSrcweir rISet.Put( SdrTextLowerDistItem( 130 ) ); 656cdf0e10cSrcweir 657cdf0e10cSrcweir rISet.Put( SvxLineSpacingItem( LINE_SPACE_DEFAULT_HEIGHT, EE_PARA_SBL ) ); 658cdf0e10cSrcweir rISet.Put( SvxAutoKernItem( sal_True, EE_CHAR_PAIRKERNING ) ); 659cdf0e10cSrcweir rISet.Put( SdrTextVertAdjustItem(SDRTEXTVERTADJUST_TOP) ); 660cdf0e10cSrcweir rISet.Put( SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_LEFT) ); 661cdf0e10cSrcweir 662cdf0e10cSrcweir Color aWhite( COL_WHITE ); 663cdf0e10cSrcweir SvxBorderLine aBorderLine( &aWhite, 1, 0, 0 ); 664cdf0e10cSrcweir 665cdf0e10cSrcweir SvxBoxItem aBoxItem( SDRATTR_TABLE_BORDER ); 666cdf0e10cSrcweir aBoxItem.SetLine( &aBorderLine, BOX_LINE_TOP ); 667cdf0e10cSrcweir aBoxItem.SetLine( &aBorderLine, BOX_LINE_BOTTOM ); 668cdf0e10cSrcweir aBoxItem.SetLine( &aBorderLine, BOX_LINE_LEFT ); 669cdf0e10cSrcweir aBoxItem.SetLine( &aBorderLine, BOX_LINE_RIGHT ); 670cdf0e10cSrcweir 671cdf0e10cSrcweir rISet.Put( aBoxItem ); 672cdf0e10cSrcweir 673cdf0e10cSrcweir Any aDefaultCellStyle( Reference< XStyle >( static_cast< XWeak* >( pSheet ), UNO_QUERY ) ); 674cdf0e10cSrcweir 675cdf0e10cSrcweir // ---- default -------------------------------------------------- 676cdf0e10cSrcweir 677cdf0e10cSrcweir Any aBlue1( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("blue1") ), aDefaultCellStyleName, RGB_COLORDATA(153,204,255))); 678cdf0e10cSrcweir Any aBlue2( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("blue2") ), aDefaultCellStyleName, RGB_COLORDATA(0,153,255))); 679cdf0e10cSrcweir Any aBlue3( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("blue3") ), aDefaultCellStyleName, RGB_COLORDATA(0,102,204))); 680cdf0e10cSrcweir 681cdf0e10cSrcweir implCreateTableTemplate( xTableFamily, OUString(RTL_CONSTASCII_USTRINGPARAM("default")), aBlue1, aBlue3, aBlue2 ); 682cdf0e10cSrcweir 683cdf0e10cSrcweir // ---- BW ------------------------------------------------ 684cdf0e10cSrcweir 685cdf0e10cSrcweir Any aBW1( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("bw1") ), aDefaultCellStyleName, RGB_COLORDATA(255,255,255))); 686cdf0e10cSrcweir Any aBW2( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("bw2") ), aDefaultCellStyleName, RGB_COLORDATA(230,230,230))); 687cdf0e10cSrcweir Any aBW3( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("bw3") ), aDefaultCellStyleName, RGB_COLORDATA(0,0,0))); 688cdf0e10cSrcweir 689cdf0e10cSrcweir implCreateTableTemplate( xTableFamily, OUString(RTL_CONSTASCII_USTRINGPARAM("bw") ), aBW1, aBW3, aBW2 ); 690cdf0e10cSrcweir 691cdf0e10cSrcweir // ---- Orange -------------------------------------------------- 692cdf0e10cSrcweir 693cdf0e10cSrcweir Any aOrange1( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("orange1") ), aDefaultCellStyleName, RGB_COLORDATA(255,204,153))); 694cdf0e10cSrcweir Any aOrange2( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("orange2") ), aDefaultCellStyleName, RGB_COLORDATA(255,153,102))); 695cdf0e10cSrcweir Any aOrange3( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("orange3") ), aDefaultCellStyleName, RGB_COLORDATA(255,102,51))); 696cdf0e10cSrcweir 697cdf0e10cSrcweir implCreateTableTemplate( xTableFamily, OUString(RTL_CONSTASCII_USTRINGPARAM("orange") ), aOrange1, aOrange3, aOrange2 ); 698cdf0e10cSrcweir 699cdf0e10cSrcweir // ---- Turquise -------------------------------------------------- 700cdf0e10cSrcweir 701cdf0e10cSrcweir Any aTurquise1( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("turquise1") ), aDefaultCellStyleName, RGB_COLORDATA(71,184,184))); 702cdf0e10cSrcweir Any aTurquise2( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("turquise2") ), aDefaultCellStyleName, RGB_COLORDATA(51,163,163))); 703cdf0e10cSrcweir Any aTurquise3( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("turquise3") ), aDefaultCellStyleName, RGB_COLORDATA(25,138,138))); 704cdf0e10cSrcweir 705cdf0e10cSrcweir implCreateTableTemplate( xTableFamily, OUString(RTL_CONSTASCII_USTRINGPARAM("turquise") ), aTurquise1, aTurquise3, aTurquise2 ); 706cdf0e10cSrcweir 707cdf0e10cSrcweir // ---- Gray ------------------------------------------------ 708cdf0e10cSrcweir 709cdf0e10cSrcweir Any aGray1( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("gray1") ), aDefaultCellStyleName, RGB_COLORDATA(230,230,230))); 710cdf0e10cSrcweir Any aGray2( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("gray2") ), aDefaultCellStyleName, RGB_COLORDATA(204,204,204))); 711cdf0e10cSrcweir Any aGray3( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("gray3") ), aDefaultCellStyleName, RGB_COLORDATA(179,179,179))); 712cdf0e10cSrcweir 713cdf0e10cSrcweir implCreateTableTemplate( xTableFamily, OUString(RTL_CONSTASCII_USTRINGPARAM("gray") ), aGray1, aGray3, aGray2 ); 714cdf0e10cSrcweir 715cdf0e10cSrcweir // ---- Sun ------------------------------------------------ 716cdf0e10cSrcweir 717cdf0e10cSrcweir Any aSun1( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("sun1") ), aDefaultCellStyleName, RGB_COLORDATA(230,230,255))); 718cdf0e10cSrcweir Any aSun2( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("sun2") ), aDefaultCellStyleName, RGB_COLORDATA(204,204,255))); 719cdf0e10cSrcweir Any aSun3( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("sun3") ), aDefaultCellStyleName, RGB_COLORDATA(153,153,255))); 720cdf0e10cSrcweir 721cdf0e10cSrcweir implCreateTableTemplate( xTableFamily, OUString(RTL_CONSTASCII_USTRINGPARAM("sun") ), aSun1, aSun3, aSun2 ); 722cdf0e10cSrcweir 723cdf0e10cSrcweir // ---- Earth ---------------------------------------------- 724cdf0e10cSrcweir 725cdf0e10cSrcweir Any aEarth1( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("earth1") ), aDefaultCellStyleName, RGB_COLORDATA(255,255,204))); 726cdf0e10cSrcweir Any aEarth2( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("earth2") ), aDefaultCellStyleName, RGB_COLORDATA(255,204,153))); 727cdf0e10cSrcweir Any aEarth3( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("earth3") ), aDefaultCellStyleName, RGB_COLORDATA(204,102,51))); 728cdf0e10cSrcweir 729cdf0e10cSrcweir implCreateTableTemplate( xTableFamily, OUString(RTL_CONSTASCII_USTRINGPARAM("earth") ), aEarth1, aEarth3, aEarth2 ); 730cdf0e10cSrcweir 731cdf0e10cSrcweir // ---- Green ---------------------------------------------- 732cdf0e10cSrcweir 733cdf0e10cSrcweir Any aGreen1( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("green1") ), aDefaultCellStyleName, RGB_COLORDATA(255,255,204))); 734cdf0e10cSrcweir Any aGreen2( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("green2") ), aDefaultCellStyleName, RGB_COLORDATA(148,189,94))); 735cdf0e10cSrcweir Any aGreen3( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("green3") ), aDefaultCellStyleName, RGB_COLORDATA(92,133,38))); 736cdf0e10cSrcweir 737cdf0e10cSrcweir implCreateTableTemplate( xTableFamily, OUString(RTL_CONSTASCII_USTRINGPARAM("green") ), aGreen1, aGreen3, aGreen2 ); 738cdf0e10cSrcweir 739cdf0e10cSrcweir // ---- Seetang ---------------------------------------------- 740cdf0e10cSrcweir 741cdf0e10cSrcweir Any aSeetang1( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("seetang1") ), aDefaultCellStyleName, RGB_COLORDATA(204,255,255))); 742cdf0e10cSrcweir Any aSeetang2( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("seetang2") ), aDefaultCellStyleName, RGB_COLORDATA(71,184,184))); 743cdf0e10cSrcweir Any aSeetang3( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("seetang3") ), aDefaultCellStyleName, RGB_COLORDATA(51,163,163))); 744cdf0e10cSrcweir 745cdf0e10cSrcweir implCreateTableTemplate( xTableFamily, OUString(RTL_CONSTASCII_USTRINGPARAM("seetang") ), aSeetang1, aSeetang3, aSeetang2 ); 746cdf0e10cSrcweir 747cdf0e10cSrcweir // ---- LightBlue ---------------------------------------------- 748cdf0e10cSrcweir 749cdf0e10cSrcweir Any aLightBlue1( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("lightblue1") ), aDefaultCellStyleName, RGB_COLORDATA(255,255,255))); 750cdf0e10cSrcweir Any aLightBlue2( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("lightblue2") ), aDefaultCellStyleName, RGB_COLORDATA(230,230,255))); 751cdf0e10cSrcweir Any aLightBlue3( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("lightblue3") ), aDefaultCellStyleName, RGB_COLORDATA(153,153,204))); 752cdf0e10cSrcweir 753cdf0e10cSrcweir implCreateTableTemplate( xTableFamily, OUString(RTL_CONSTASCII_USTRINGPARAM("lightblue") ), aLightBlue1, aLightBlue3, aLightBlue2 ); 754cdf0e10cSrcweir 755cdf0e10cSrcweir // ---- Yellow ---------------------------------------------- 756cdf0e10cSrcweir 757cdf0e10cSrcweir Any aYellow1( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("yellow1") ), aDefaultCellStyleName, RGB_COLORDATA(255,255,204))); 758cdf0e10cSrcweir Any aYellow2( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("yellow2") ), aDefaultCellStyleName, RGB_COLORDATA(255,255,153))); 759cdf0e10cSrcweir Any aYellow3( implMakeSolidCellStyle( pSSPool, OUString( RTL_CONSTASCII_USTRINGPARAM("yellow3") ), aDefaultCellStyleName, RGB_COLORDATA(255,204,153))); 760cdf0e10cSrcweir 761cdf0e10cSrcweir implCreateTableTemplate( xTableFamily, OUString(RTL_CONSTASCII_USTRINGPARAM("yellow") ), aYellow1, aYellow3, aYellow2 ); 762cdf0e10cSrcweir } 763cdf0e10cSrcweir 764cdf0e10cSrcweir /************************************************************************* 765cdf0e10cSrcweir |* 766cdf0e10cSrcweir |* Anzahl der Seiten, die eine masterPage referenzieren 767cdf0e10cSrcweir |* 768cdf0e10cSrcweir \************************************************************************/ 769cdf0e10cSrcweir 770cdf0e10cSrcweir sal_uInt16 SdDrawDocument::GetMasterPageUserCount(SdrPage* pMaster) const 771cdf0e10cSrcweir { 772cdf0e10cSrcweir sal_uInt16 nResult = 0; 773cdf0e10cSrcweir sal_uInt16 nPage; 774cdf0e10cSrcweir sal_uInt16 nPageCount = GetPageCount(); 775cdf0e10cSrcweir 776cdf0e10cSrcweir for (nPage = 0; nPage < nPageCount; nPage++) 777cdf0e10cSrcweir { 778cdf0e10cSrcweir const SdrPage* pPage = GetPage(nPage); 779cdf0e10cSrcweir 780cdf0e10cSrcweir if(pPage->TRG_HasMasterPage()) 781cdf0e10cSrcweir { 782cdf0e10cSrcweir if(&(pPage->TRG_GetMasterPage()) == pMaster) 783cdf0e10cSrcweir { 784cdf0e10cSrcweir nResult++; 785cdf0e10cSrcweir } 786cdf0e10cSrcweir } 787cdf0e10cSrcweir } 788cdf0e10cSrcweir return nResult; 789cdf0e10cSrcweir } 790cdf0e10cSrcweir 791cdf0e10cSrcweir 792cdf0e10cSrcweir /************************************************************************* 793cdf0e10cSrcweir |* 794cdf0e10cSrcweir |* OnlineSpelling im Hintergrund beenden 795cdf0e10cSrcweir |* 796cdf0e10cSrcweir \************************************************************************/ 797cdf0e10cSrcweir 798cdf0e10cSrcweir void SdDrawDocument::StopOnlineSpelling() 799cdf0e10cSrcweir { 800cdf0e10cSrcweir if (mpOnlineSpellingTimer && mpOnlineSpellingTimer->IsActive()) 801cdf0e10cSrcweir { 802cdf0e10cSrcweir mpOnlineSpellingTimer->Stop(); 803cdf0e10cSrcweir } 804cdf0e10cSrcweir 805cdf0e10cSrcweir delete mpOnlineSpellingTimer; 806cdf0e10cSrcweir mpOnlineSpellingTimer = NULL; 807cdf0e10cSrcweir 808cdf0e10cSrcweir delete mpOnlineSpellingList; 809cdf0e10cSrcweir mpOnlineSpellingList = NULL; 810cdf0e10cSrcweir } 811cdf0e10cSrcweir 812cdf0e10cSrcweir /************************************************************************* 813cdf0e10cSrcweir |* 814cdf0e10cSrcweir |* OnlineSpelling im Hintergrund starten 815cdf0e10cSrcweir |* 816cdf0e10cSrcweir \************************************************************************/ 817cdf0e10cSrcweir 818cdf0e10cSrcweir void SdDrawDocument::StartOnlineSpelling(sal_Bool bForceSpelling) 819cdf0e10cSrcweir { 820cdf0e10cSrcweir if (mbOnlineSpell && (bForceSpelling || mbInitialOnlineSpellingEnabled) && 821cdf0e10cSrcweir mpDocSh && !mpDocSh->IsReadOnly() ) 822cdf0e10cSrcweir { 823cdf0e10cSrcweir StopOnlineSpelling(); 824cdf0e10cSrcweir 825cdf0e10cSrcweir ::sd::Outliner* pOutl = GetInternalOutliner(sal_True); 826cdf0e10cSrcweir 827cdf0e10cSrcweir Reference< XSpellChecker1 > xSpellChecker( LinguMgr::GetSpellChecker() ); 828cdf0e10cSrcweir if ( xSpellChecker.is() ) 829cdf0e10cSrcweir pOutl->SetSpeller( xSpellChecker ); 830cdf0e10cSrcweir 831cdf0e10cSrcweir Reference< XHyphenator > xHyphenator( LinguMgr::GetHyphenator() ); 832cdf0e10cSrcweir if( xHyphenator.is() ) 833cdf0e10cSrcweir pOutl->SetHyphenator( xHyphenator ); 834cdf0e10cSrcweir 835cdf0e10cSrcweir pOutl->SetDefaultLanguage( meLanguage ); 836cdf0e10cSrcweir 837cdf0e10cSrcweir mpOnlineSpellingList = new ShapeList; 838cdf0e10cSrcweir sal_uInt16 nPage; 839cdf0e10cSrcweir 840cdf0e10cSrcweir for ( nPage = 0; nPage < GetPageCount(); nPage++ ) 841cdf0e10cSrcweir { 842cdf0e10cSrcweir // Alle Pages durchsuchen 843cdf0e10cSrcweir FillOnlineSpellingList((SdPage*) GetPage(nPage)); 844cdf0e10cSrcweir } 845cdf0e10cSrcweir 846cdf0e10cSrcweir for (nPage = 0; nPage < GetMasterPageCount(); nPage++) 847cdf0e10cSrcweir { 848cdf0e10cSrcweir // Alle MasterPages durchsuchen 849cdf0e10cSrcweir FillOnlineSpellingList((SdPage*) GetMasterPage(nPage)); 850cdf0e10cSrcweir } 851cdf0e10cSrcweir 852cdf0e10cSrcweir mpOnlineSpellingList->seekShape(0); 853cdf0e10cSrcweir mpOnlineSpellingTimer = new Timer(); 854cdf0e10cSrcweir mpOnlineSpellingTimer->SetTimeoutHdl( LINK(this, SdDrawDocument, OnlineSpellingHdl) ); 855cdf0e10cSrcweir mpOnlineSpellingTimer->SetTimeout(250); 856cdf0e10cSrcweir mpOnlineSpellingTimer->Start(); 857cdf0e10cSrcweir } 858cdf0e10cSrcweir } 859cdf0e10cSrcweir 860cdf0e10cSrcweir /************************************************************************* 861cdf0e10cSrcweir |* 862cdf0e10cSrcweir |* OnlineSpelling-Liste fuellen 863cdf0e10cSrcweir |* 864cdf0e10cSrcweir \************************************************************************/ 865cdf0e10cSrcweir 866cdf0e10cSrcweir void SdDrawDocument::FillOnlineSpellingList(SdPage* pPage) 867cdf0e10cSrcweir { 868cdf0e10cSrcweir SdrObject* pObj = NULL; 869cdf0e10cSrcweir SdrObjListIter aIter(*pPage, IM_FLAT); 870cdf0e10cSrcweir 871cdf0e10cSrcweir while (aIter.IsMore()) 872cdf0e10cSrcweir { 873cdf0e10cSrcweir pObj = aIter.Next(); 874cdf0e10cSrcweir 875cdf0e10cSrcweir if( !pObj ) 876cdf0e10cSrcweir continue; 877cdf0e10cSrcweir 878cdf0e10cSrcweir if (pObj->GetOutlinerParaObject()) 879cdf0e10cSrcweir { 880cdf0e10cSrcweir // Textobjekt gefunden 881cdf0e10cSrcweir mpOnlineSpellingList->addShape(*pObj); 882cdf0e10cSrcweir } 883cdf0e10cSrcweir else if (pObj->GetObjIdentifier() == OBJ_GRUP) 884cdf0e10cSrcweir { 885cdf0e10cSrcweir // Gruppenobjekt gefunden 886cdf0e10cSrcweir SdrObjListIter aGroupIter(*((SdrObjGroup*)pObj)->GetSubList(), 887cdf0e10cSrcweir IM_DEEPNOGROUPS); 888cdf0e10cSrcweir 889cdf0e10cSrcweir sal_Bool bSubTextObjFound = sal_False; 890cdf0e10cSrcweir 891cdf0e10cSrcweir while (aGroupIter.IsMore() && !bSubTextObjFound) 892cdf0e10cSrcweir { 893cdf0e10cSrcweir if (aGroupIter.Next()->GetOutlinerParaObject()) 894cdf0e10cSrcweir { 895cdf0e10cSrcweir // Textobjekt im Gruppenobjekt gefunden 896cdf0e10cSrcweir bSubTextObjFound = sal_True; 897cdf0e10cSrcweir } 898cdf0e10cSrcweir } 899cdf0e10cSrcweir 900cdf0e10cSrcweir if (bSubTextObjFound) 901cdf0e10cSrcweir { 902cdf0e10cSrcweir mpOnlineSpellingList->addShape(*pObj); 903cdf0e10cSrcweir } 904cdf0e10cSrcweir } 905cdf0e10cSrcweir } 906cdf0e10cSrcweir } 907cdf0e10cSrcweir 908cdf0e10cSrcweir /************************************************************************* 909cdf0e10cSrcweir |* 910cdf0e10cSrcweir |* OnlineSpelling im Hintergrund 911cdf0e10cSrcweir |* 912cdf0e10cSrcweir \************************************************************************/ 913cdf0e10cSrcweir 914cdf0e10cSrcweir IMPL_LINK(SdDrawDocument, OnlineSpellingHdl, Timer*, EMPTYARG ) 915cdf0e10cSrcweir { 916cdf0e10cSrcweir if (mpOnlineSpellingList!=NULL 917cdf0e10cSrcweir && ( !mbOnlineSpell || mpOnlineSpellingList->hasMore())) 918cdf0e10cSrcweir { 919cdf0e10cSrcweir /********************************************************************** 920cdf0e10cSrcweir * Naechstes Objekt spellen 921cdf0e10cSrcweir **********************************************************************/ 922cdf0e10cSrcweir SdrObject* pObj = mpOnlineSpellingList->getNextShape(); 923cdf0e10cSrcweir 924cdf0e10cSrcweir if (pObj) 925cdf0e10cSrcweir { 926cdf0e10cSrcweir if (pObj->GetOutlinerParaObject() && pObj->ISA(SdrTextObj)) 927cdf0e10cSrcweir { 928cdf0e10cSrcweir // Textobjekt spellen 929cdf0e10cSrcweir SpellObject((SdrTextObj*) pObj); 930cdf0e10cSrcweir } 931cdf0e10cSrcweir else if (pObj->GetObjIdentifier() == OBJ_GRUP) 932cdf0e10cSrcweir { 933cdf0e10cSrcweir // Gruppenobjekt gefunden 934cdf0e10cSrcweir SdrObjListIter aGroupIter(*((SdrObjGroup*)pObj)->GetSubList(), 935cdf0e10cSrcweir IM_DEEPNOGROUPS); 936cdf0e10cSrcweir 937cdf0e10cSrcweir SdrObject* pSubObj = NULL; 938cdf0e10cSrcweir 939cdf0e10cSrcweir while (aGroupIter.IsMore()) 940cdf0e10cSrcweir { 941cdf0e10cSrcweir pSubObj = aGroupIter.Next(); 942cdf0e10cSrcweir 943cdf0e10cSrcweir if (pSubObj->GetOutlinerParaObject() && pSubObj->ISA(SdrTextObj)) 944cdf0e10cSrcweir { 945cdf0e10cSrcweir // Textobjekt im Gruppenobjekt gefunden 946cdf0e10cSrcweir SpellObject((SdrTextObj*) pSubObj); 947cdf0e10cSrcweir } 948cdf0e10cSrcweir } 949cdf0e10cSrcweir } 950cdf0e10cSrcweir } 951cdf0e10cSrcweir 952cdf0e10cSrcweir // Weitersuchen 953cdf0e10cSrcweir mpOnlineSpellingTimer->Start(); 954cdf0e10cSrcweir } 955cdf0e10cSrcweir else 956cdf0e10cSrcweir { 957cdf0e10cSrcweir // Spelling wurde initial durchgefuehrt 958cdf0e10cSrcweir mbInitialOnlineSpellingEnabled = sal_False; 959cdf0e10cSrcweir 960cdf0e10cSrcweir // Suche beenden 961cdf0e10cSrcweir StopOnlineSpelling(); 962cdf0e10cSrcweir 963cdf0e10cSrcweir delete mpOnlineSearchItem; 964cdf0e10cSrcweir mpOnlineSearchItem = NULL; 965cdf0e10cSrcweir } 966cdf0e10cSrcweir 967cdf0e10cSrcweir return(0); 968cdf0e10cSrcweir } 969cdf0e10cSrcweir 970cdf0e10cSrcweir /************************************************************************* 971cdf0e10cSrcweir |* 972cdf0e10cSrcweir |* Objekt spellen (fuer OnlineSpelling) 973cdf0e10cSrcweir |* 974cdf0e10cSrcweir \************************************************************************/ 975cdf0e10cSrcweir 976cdf0e10cSrcweir void SdDrawDocument::SpellObject(SdrTextObj* pObj) 977cdf0e10cSrcweir { 978cdf0e10cSrcweir if (pObj && pObj->GetOutlinerParaObject() /* && pObj != pView->GetTextEditObject() */) 979cdf0e10cSrcweir { 980cdf0e10cSrcweir mbHasOnlineSpellErrors = sal_False; 981cdf0e10cSrcweir ::sd::Outliner* pOutl = GetInternalOutliner(sal_True); 982cdf0e10cSrcweir pOutl->SetUpdateMode(sal_True); 983cdf0e10cSrcweir Link aEvtHdl = pOutl->GetStatusEventHdl(); 984cdf0e10cSrcweir pOutl->SetStatusEventHdl(LINK(this, SdDrawDocument, OnlineSpellEventHdl)); 985cdf0e10cSrcweir 986cdf0e10cSrcweir sal_uInt16 nOldOutlMode = pOutl->GetMode(); 987cdf0e10cSrcweir sal_uInt16 nOutlMode = OUTLINERMODE_TEXTOBJECT; 988cdf0e10cSrcweir if (((SdrTextObj*) pObj)->GetObjInventor() == SdrInventor && 989cdf0e10cSrcweir ((SdrTextObj*) pObj)->GetObjIdentifier() == OBJ_OUTLINETEXT) 990cdf0e10cSrcweir { 991cdf0e10cSrcweir nOutlMode = OUTLINERMODE_OUTLINEOBJECT; 992cdf0e10cSrcweir } 993cdf0e10cSrcweir pOutl->Init( nOutlMode ); 994cdf0e10cSrcweir 995cdf0e10cSrcweir // Text in den Outliner setzen 996cdf0e10cSrcweir pOutl->SetText(*((SdrTextObj*) pObj)->GetOutlinerParaObject()); 997cdf0e10cSrcweir 998cdf0e10cSrcweir if (!mpOnlineSearchItem || pOutl->HasText(*mpOnlineSearchItem)) 999cdf0e10cSrcweir { 1000cdf0e10cSrcweir // Spelling 1001cdf0e10cSrcweir pOutl->CompleteOnlineSpelling(); 1002cdf0e10cSrcweir 1003cdf0e10cSrcweir if (mbHasOnlineSpellErrors) 1004cdf0e10cSrcweir { 1005cdf0e10cSrcweir sd::ModifyGuard aGuard( this ); 1006cdf0e10cSrcweir SdrModel* pModel = pObj->GetModel(); 1007cdf0e10cSrcweir sal_Bool bLock = sal_False; 1008cdf0e10cSrcweir if ( pModel ) 1009cdf0e10cSrcweir { 1010cdf0e10cSrcweir bLock = pModel->isLocked(); 1011cdf0e10cSrcweir pModel->setLock( sal_True ); 1012cdf0e10cSrcweir } 1013cdf0e10cSrcweir // taking text from the outliner 1014cdf0e10cSrcweir ((SdrTextObj*) pObj)->SetOutlinerParaObject( pOutl->CreateParaObject() ); 1015cdf0e10cSrcweir 1016cdf0e10cSrcweir pObj->BroadcastObjectChange(); 1017cdf0e10cSrcweir if ( pModel ) 1018cdf0e10cSrcweir pModel->setLock( bLock ); 1019cdf0e10cSrcweir } 1020cdf0e10cSrcweir } 1021cdf0e10cSrcweir 1022cdf0e10cSrcweir pOutl->SetStatusEventHdl(aEvtHdl); 1023cdf0e10cSrcweir pOutl->SetUpdateMode(sal_False); 1024cdf0e10cSrcweir pOutl->Init( nOldOutlMode ); 1025cdf0e10cSrcweir mbHasOnlineSpellErrors = sal_False; 1026cdf0e10cSrcweir } 1027cdf0e10cSrcweir } 1028cdf0e10cSrcweir 1029cdf0e10cSrcweir /************************************************************************* 1030cdf0e10cSrcweir |* 1031cdf0e10cSrcweir |* Objekt wurde ins Model eingefuegt 1032cdf0e10cSrcweir |* 1033cdf0e10cSrcweir \************************************************************************/ 1034cdf0e10cSrcweir void SdDrawDocument::InsertObject(SdrObject* pObj, SdPage* /*pPage*/) 1035cdf0e10cSrcweir { 1036cdf0e10cSrcweir if(mpOnlineSpellingList && pObj) 1037cdf0e10cSrcweir { 1038cdf0e10cSrcweir if (pObj->GetOutlinerParaObject() || (pObj->GetObjIdentifier() == OBJ_GRUP)) 1039cdf0e10cSrcweir { 1040cdf0e10cSrcweir // Objekt in OnlineSpelling-Liste aufnehmen 1041cdf0e10cSrcweir mpOnlineSpellingList->addShape(*pObj); 1042cdf0e10cSrcweir } 1043cdf0e10cSrcweir } 1044cdf0e10cSrcweir } 1045cdf0e10cSrcweir 1046cdf0e10cSrcweir /************************************************************************* 1047cdf0e10cSrcweir |* 1048cdf0e10cSrcweir |* Objekt wurde aus dem Model entfernt 1049cdf0e10cSrcweir |* 1050cdf0e10cSrcweir \************************************************************************/ 1051cdf0e10cSrcweir void SdDrawDocument::RemoveObject(SdrObject* pObj, SdPage* /*pPage*/) 1052cdf0e10cSrcweir { 1053cdf0e10cSrcweir if(mpOnlineSpellingList && pObj) 1054cdf0e10cSrcweir { 1055cdf0e10cSrcweir if (pObj->GetOutlinerParaObject() || (pObj->GetObjIdentifier() == OBJ_GRUP)) 1056cdf0e10cSrcweir { 1057cdf0e10cSrcweir // Objekt in OnlineSpelling-Liste durch NULL-Pointer ersetzt 1058cdf0e10cSrcweir mpOnlineSpellingList->removeShape(*pObj); 1059cdf0e10cSrcweir } 1060cdf0e10cSrcweir } 1061cdf0e10cSrcweir } 1062cdf0e10cSrcweir 1063cdf0e10cSrcweir /************************************************************************* 1064cdf0e10cSrcweir |* 1065cdf0e10cSrcweir |* Callback fuer ExecuteSpellPopup() 1066cdf0e10cSrcweir |* 1067cdf0e10cSrcweir \************************************************************************/ 1068cdf0e10cSrcweir IMPL_LINK(SdDrawDocument, OnlineSpellEventHdl, EditStatus*, pEditStat) 1069cdf0e10cSrcweir { 1070cdf0e10cSrcweir sal_uLong nStat = pEditStat->GetStatusWord(); 1071cdf0e10cSrcweir mbHasOnlineSpellErrors = (nStat & EE_STAT_WRONGWORDCHANGED) != 0; 1072cdf0e10cSrcweir 1073cdf0e10cSrcweir return(0); 1074cdf0e10cSrcweir } 1075cdf0e10cSrcweir 1076cdf0e10cSrcweir /************************************************************************* 1077cdf0e10cSrcweir |* 1078cdf0e10cSrcweir |* Callback fuer ExecuteSpellPopup() 1079cdf0e10cSrcweir |* 1080cdf0e10cSrcweir \************************************************************************/ 1081cdf0e10cSrcweir 1082cdf0e10cSrcweir // #91457# removed link and replaced with Imp method 1083cdf0e10cSrcweir void SdDrawDocument::ImpOnlineSpellCallback(SpellCallbackInfo* pInfo, SdrObject* pObj, SdrOutliner* pOutl) 1084cdf0e10cSrcweir { 1085cdf0e10cSrcweir delete mpOnlineSearchItem; 1086cdf0e10cSrcweir mpOnlineSearchItem = NULL; 1087cdf0e10cSrcweir 1088cdf0e10cSrcweir sal_uInt16 nCommand = pInfo->nCommand; 1089cdf0e10cSrcweir 1090cdf0e10cSrcweir if (nCommand == SPELLCMD_IGNOREWORD 1091cdf0e10cSrcweir // #91457# restart when add to dictionary takes place, too. 1092cdf0e10cSrcweir || nCommand == SPELLCMD_ADDTODICTIONARY) 1093cdf0e10cSrcweir { 1094cdf0e10cSrcweir if(pObj && pOutl && pObj->ISA(SdrTextObj)) 1095cdf0e10cSrcweir { 1096cdf0e10cSrcweir sal_Bool bModified(IsChanged()); 1097cdf0e10cSrcweir ((SdrTextObj*)pObj)->SetOutlinerParaObject(pOutl->CreateParaObject()); 1098cdf0e10cSrcweir SetChanged(bModified); 1099cdf0e10cSrcweir pObj->BroadcastObjectChange(); 1100cdf0e10cSrcweir } 1101cdf0e10cSrcweir 1102cdf0e10cSrcweir mpOnlineSearchItem = new SvxSearchItem( SID_SEARCH_ITEM ); 1103cdf0e10cSrcweir mpOnlineSearchItem->SetSearchString(pInfo->aWord); 1104cdf0e10cSrcweir StartOnlineSpelling(); 1105cdf0e10cSrcweir } 1106cdf0e10cSrcweir else if (nCommand == SPELLCMD_STARTSPELLDLG) 1107cdf0e10cSrcweir { 1108cdf0e10cSrcweir SfxViewFrame::Current()->GetDispatcher()->Execute( SID_SPELL_DIALOG, 1109cdf0e10cSrcweir SFX_CALLMODE_ASYNCHRON ); 1110cdf0e10cSrcweir } 1111cdf0e10cSrcweir } 1112cdf0e10cSrcweir 1113cdf0e10cSrcweir /************************************************************************* 1114cdf0e10cSrcweir |* 1115cdf0e10cSrcweir |* Eindeutige Namen der StandardLayer durch sprachabhaengige Namen ersetzen 1116cdf0e10cSrcweir |* 1117cdf0e10cSrcweir \************************************************************************/ 1118cdf0e10cSrcweir void SdDrawDocument::RestoreLayerNames() 1119cdf0e10cSrcweir { 1120cdf0e10cSrcweir SdrLayerAdmin& rLayerAdmin = GetLayerAdmin(); 1121cdf0e10cSrcweir sal_uInt16 nLayerCount = rLayerAdmin.GetLayerCount(); 1122cdf0e10cSrcweir 1123cdf0e10cSrcweir for (sal_uInt16 nLayer = 0; nLayer < nLayerCount; nLayer++) 1124cdf0e10cSrcweir { 1125cdf0e10cSrcweir SdrLayer* pLayer = rLayerAdmin.GetLayer(nLayer); 1126cdf0e10cSrcweir 1127cdf0e10cSrcweir if (pLayer) 1128cdf0e10cSrcweir { 1129cdf0e10cSrcweir String aLayerName(pLayer->GetName()); 1130cdf0e10cSrcweir 1131cdf0e10cSrcweir if (aLayerName.EqualsAscii( "LAYER_LAYOUT" )) 1132cdf0e10cSrcweir { 1133cdf0e10cSrcweir pLayer->SetName(String(SdResId(STR_LAYER_LAYOUT))); 1134cdf0e10cSrcweir } 1135cdf0e10cSrcweir else if (aLayerName.EqualsAscii( "LAYER_BCKGRND" )) 1136cdf0e10cSrcweir { 1137cdf0e10cSrcweir pLayer->SetName(String(SdResId(STR_LAYER_BCKGRND))); 1138cdf0e10cSrcweir } 1139cdf0e10cSrcweir else if (aLayerName.EqualsAscii( "LAYER_BACKGRNDOBJ" )) 1140cdf0e10cSrcweir { 1141cdf0e10cSrcweir pLayer->SetName(String(SdResId(STR_LAYER_BCKGRNDOBJ))); 1142cdf0e10cSrcweir } 1143cdf0e10cSrcweir else if (aLayerName.EqualsAscii( "LAYER_CONTROLS" )) 1144cdf0e10cSrcweir { 1145cdf0e10cSrcweir pLayer->SetName(String(SdResId(STR_LAYER_CONTROLS))); 1146cdf0e10cSrcweir } 1147cdf0e10cSrcweir else if (aLayerName.EqualsAscii( "LAYER_MEASURELINES" )) 1148cdf0e10cSrcweir { 1149cdf0e10cSrcweir pLayer->SetName(String(SdResId(STR_LAYER_MEASURELINES))); 1150cdf0e10cSrcweir } 1151cdf0e10cSrcweir } 1152cdf0e10cSrcweir } 1153cdf0e10cSrcweir } 1154cdf0e10cSrcweir 1155cdf0e10cSrcweir /************************************************************************* 1156cdf0e10cSrcweir |* 1157cdf0e10cSrcweir |* Formatierte Seitennummer zurueckgeben (1, I, i, a, usw.) 1158cdf0e10cSrcweir |* 1159cdf0e10cSrcweir \************************************************************************/ 1160cdf0e10cSrcweir 1161cdf0e10cSrcweir String SdDrawDocument::CreatePageNumValue(sal_uInt16 nNum) const 1162cdf0e10cSrcweir { 1163cdf0e10cSrcweir String aPageNumValue; 1164cdf0e10cSrcweir sal_Bool bUpper = sal_False; 1165cdf0e10cSrcweir 1166cdf0e10cSrcweir switch (mePageNumType) 1167cdf0e10cSrcweir { 1168cdf0e10cSrcweir case SVX_CHARS_UPPER_LETTER: 1169cdf0e10cSrcweir aPageNumValue += (sal_Unicode)(char)((nNum - 1) % 26 + 'A'); 1170cdf0e10cSrcweir break; 1171cdf0e10cSrcweir case SVX_CHARS_LOWER_LETTER: 1172cdf0e10cSrcweir aPageNumValue += (sal_Unicode)(char)((nNum - 1) % 26 + 'a'); 1173cdf0e10cSrcweir break; 1174cdf0e10cSrcweir case SVX_ROMAN_UPPER: 1175cdf0e10cSrcweir bUpper = sal_True; 1176cdf0e10cSrcweir case SVX_ROMAN_LOWER: 1177cdf0e10cSrcweir aPageNumValue += SvxNumberFormat::CreateRomanString(nNum, bUpper); 1178cdf0e10cSrcweir break; 1179cdf0e10cSrcweir case SVX_NUMBER_NONE: 1180cdf0e10cSrcweir aPageNumValue.Erase(); 1181cdf0e10cSrcweir aPageNumValue += sal_Unicode(' '); 1182cdf0e10cSrcweir break; 1183cdf0e10cSrcweir default: 1184cdf0e10cSrcweir aPageNumValue += String::CreateFromInt32( (sal_Int32)nNum ); 1185cdf0e10cSrcweir } 1186cdf0e10cSrcweir 1187cdf0e10cSrcweir return(aPageNumValue); 1188cdf0e10cSrcweir } 1189cdf0e10cSrcweir 1190cdf0e10cSrcweir 1191cdf0e10cSrcweir 1192cdf0e10cSrcweir /************************************************************************* 1193cdf0e10cSrcweir |* 1194cdf0e10cSrcweir |* Layout-Template umbenennen 1195cdf0e10cSrcweir |* Zu beachten ist, das rOldLayoutName im Gegensatz zu rNewName den 1196cdf0e10cSrcweir |* kompletten Layout(!)-Namen enthaelt (inkl. ~LT~)! 1197cdf0e10cSrcweir |* 1198cdf0e10cSrcweir \************************************************************************/ 1199cdf0e10cSrcweir 1200cdf0e10cSrcweir void SdDrawDocument::RenameLayoutTemplate(const String& rOldLayoutName, const String& rNewName) 1201cdf0e10cSrcweir { 1202cdf0e10cSrcweir String aOldName(rOldLayoutName); 1203cdf0e10cSrcweir sal_uInt16 nPos = aOldName.SearchAscii( SD_LT_SEPARATOR ); 1204cdf0e10cSrcweir 1205cdf0e10cSrcweir // erase everything after '~LT~' 1206cdf0e10cSrcweir aOldName.Erase(nPos + sizeof(SD_LT_SEPARATOR) - 1 ); 1207cdf0e10cSrcweir sal_uInt16 nLen = aOldName.Len(); 1208cdf0e10cSrcweir 1209cdf0e10cSrcweir List aReplList; 1210cdf0e10cSrcweir SfxStyleSheetIterator aIter(mxStyleSheetPool.get(), SD_STYLE_FAMILY_MASTERPAGE); 1211cdf0e10cSrcweir SfxStyleSheetBase* pSheet = aIter.First(); 1212cdf0e10cSrcweir 1213cdf0e10cSrcweir while (pSheet) 1214cdf0e10cSrcweir { 1215cdf0e10cSrcweir String aSheetName = pSheet->GetName(); 1216cdf0e10cSrcweir 1217cdf0e10cSrcweir // if the sheetname starts with aOldName + "~LT~" 1218cdf0e10cSrcweir if (aSheetName.Match(aOldName) == nLen) 1219cdf0e10cSrcweir { 1220cdf0e10cSrcweir aSheetName.Erase(0, nLen - sizeof(SD_LT_SEPARATOR) + 1 ); 1221cdf0e10cSrcweir aSheetName.Insert(rNewName, 0); 1222cdf0e10cSrcweir 1223cdf0e10cSrcweir StyleReplaceData* pReplData = new StyleReplaceData; 1224cdf0e10cSrcweir pReplData->nFamily = pSheet->GetFamily(); 1225cdf0e10cSrcweir pReplData->nNewFamily = pSheet->GetFamily(); 1226cdf0e10cSrcweir pReplData->aName = pSheet->GetName(); 1227cdf0e10cSrcweir pReplData->aNewName = aSheetName; 1228cdf0e10cSrcweir aReplList.Insert(pReplData, LIST_APPEND); 1229cdf0e10cSrcweir 1230cdf0e10cSrcweir pSheet->SetName(aSheetName); 1231cdf0e10cSrcweir } 1232cdf0e10cSrcweir 1233cdf0e10cSrcweir pSheet = aIter.Next(); 1234cdf0e10cSrcweir } 1235cdf0e10cSrcweir 1236cdf0e10cSrcweir // jetzt noch den Layoutnamen der Zeichen- und der Notizseite 1237cdf0e10cSrcweir // sowie ihrer Masterpages setzen 1238cdf0e10cSrcweir String aPageLayoutName(rNewName); 1239cdf0e10cSrcweir aPageLayoutName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR )); 1240cdf0e10cSrcweir aPageLayoutName += String(SdResId(STR_LAYOUT_OUTLINE)); 1241cdf0e10cSrcweir 1242cdf0e10cSrcweir // an allen Seiten, die das jetzt umbeannte Layout benutzen, die 1243cdf0e10cSrcweir // Textobjekte von der Aenderung unterrichten und Layoutnamen setzen 1244cdf0e10cSrcweir sal_uInt16 nPage; 1245cdf0e10cSrcweir for (nPage = 0; nPage < GetPageCount(); nPage++) 1246cdf0e10cSrcweir { 1247cdf0e10cSrcweir SdPage* pPage = (SdPage*) GetPage(nPage); 1248cdf0e10cSrcweir String aTemp(pPage->GetLayoutName()); 1249cdf0e10cSrcweir 1250cdf0e10cSrcweir if (aTemp == rOldLayoutName) 1251cdf0e10cSrcweir { 1252cdf0e10cSrcweir pPage->SetLayoutName(aPageLayoutName); 1253cdf0e10cSrcweir 1254cdf0e10cSrcweir for (sal_uLong nObj = 0; nObj < pPage->GetObjCount(); nObj++) 1255cdf0e10cSrcweir { 1256cdf0e10cSrcweir SdrObject* pObj = pPage->GetObj(nObj); 1257cdf0e10cSrcweir 1258cdf0e10cSrcweir if (pObj->GetObjInventor() == SdrInventor) 1259cdf0e10cSrcweir { 1260cdf0e10cSrcweir switch( pObj->GetObjIdentifier() ) 1261cdf0e10cSrcweir { 1262cdf0e10cSrcweir case OBJ_TEXT: 1263cdf0e10cSrcweir case OBJ_OUTLINETEXT: 1264cdf0e10cSrcweir case OBJ_TITLETEXT: 1265cdf0e10cSrcweir { 1266cdf0e10cSrcweir OutlinerParaObject* pOPO = ((SdrTextObj*) pObj)->GetOutlinerParaObject(); 1267cdf0e10cSrcweir 1268cdf0e10cSrcweir if (pOPO) 1269cdf0e10cSrcweir { 1270cdf0e10cSrcweir StyleReplaceData* pReplData = (StyleReplaceData*) aReplList.First(); 1271cdf0e10cSrcweir 1272cdf0e10cSrcweir while( pReplData ) 1273cdf0e10cSrcweir { 1274cdf0e10cSrcweir pOPO->ChangeStyleSheets( pReplData->aName, pReplData->nFamily, pReplData->aNewName, pReplData->nNewFamily ); 1275cdf0e10cSrcweir pReplData = (StyleReplaceData*) aReplList.Next(); 1276cdf0e10cSrcweir } 1277cdf0e10cSrcweir } 1278cdf0e10cSrcweir } 1279cdf0e10cSrcweir break; 1280cdf0e10cSrcweir 1281cdf0e10cSrcweir default: 1282cdf0e10cSrcweir break; 1283cdf0e10cSrcweir } 1284cdf0e10cSrcweir } 1285cdf0e10cSrcweir } 1286cdf0e10cSrcweir } 1287cdf0e10cSrcweir } 1288cdf0e10cSrcweir 1289cdf0e10cSrcweir // und nochmal fuer die Masterpages 1290cdf0e10cSrcweir // die betroffenen Masterpages erhalten als Seitennamen den Namen 1291cdf0e10cSrcweir // des Layouts 1292cdf0e10cSrcweir for (nPage = 0; nPage < GetMasterPageCount(); nPage++) 1293cdf0e10cSrcweir { 1294cdf0e10cSrcweir SdPage* pPage = (SdPage*) GetMasterPage(nPage); 1295cdf0e10cSrcweir String aTemp(pPage->GetLayoutName()); 1296cdf0e10cSrcweir 1297cdf0e10cSrcweir if (aTemp == rOldLayoutName) 1298cdf0e10cSrcweir { 1299cdf0e10cSrcweir pPage->SetLayoutName(aPageLayoutName); 1300cdf0e10cSrcweir pPage->SetName(rNewName); 1301cdf0e10cSrcweir 1302cdf0e10cSrcweir for (sal_uLong nObj = 0; nObj < pPage->GetObjCount(); nObj++) 1303cdf0e10cSrcweir { 1304cdf0e10cSrcweir SdrObject* pObj = pPage->GetObj(nObj); 1305cdf0e10cSrcweir 1306cdf0e10cSrcweir if (pObj->GetObjInventor() == SdrInventor) 1307cdf0e10cSrcweir { 1308cdf0e10cSrcweir switch(pObj->GetObjIdentifier()) 1309cdf0e10cSrcweir { 1310cdf0e10cSrcweir case OBJ_TEXT: 1311cdf0e10cSrcweir case OBJ_OUTLINETEXT: 1312cdf0e10cSrcweir case OBJ_TITLETEXT: 1313cdf0e10cSrcweir { 1314cdf0e10cSrcweir OutlinerParaObject* pOPO = ((SdrTextObj*)pObj)->GetOutlinerParaObject(); 1315cdf0e10cSrcweir 1316cdf0e10cSrcweir if (pOPO) 1317cdf0e10cSrcweir { 1318cdf0e10cSrcweir StyleReplaceData* pReplData = (StyleReplaceData*) aReplList.First(); 1319cdf0e10cSrcweir 1320cdf0e10cSrcweir while( pReplData ) 1321cdf0e10cSrcweir { 1322cdf0e10cSrcweir pOPO->ChangeStyleSheets( pReplData->aName, pReplData->nFamily, pReplData->aNewName, pReplData->nNewFamily ); 1323cdf0e10cSrcweir pReplData = (StyleReplaceData*) aReplList.Next(); 1324cdf0e10cSrcweir } 1325cdf0e10cSrcweir } 1326cdf0e10cSrcweir } 1327cdf0e10cSrcweir break; 1328cdf0e10cSrcweir 1329cdf0e10cSrcweir default: 1330cdf0e10cSrcweir break; 1331cdf0e10cSrcweir } 1332cdf0e10cSrcweir } 1333cdf0e10cSrcweir } 1334cdf0e10cSrcweir } 1335cdf0e10cSrcweir } 1336cdf0e10cSrcweir } 1337cdf0e10cSrcweir 1338cdf0e10cSrcweir /************************************************************************* 1339cdf0e10cSrcweir |* 1340cdf0e10cSrcweir |* Outliner-Defaults setzen (Pool-Defaults) 1341cdf0e10cSrcweir |* 1342cdf0e10cSrcweir \************************************************************************/ 1343cdf0e10cSrcweir void SdDrawDocument::SetTextDefaults() const 1344cdf0e10cSrcweir { 1345cdf0e10cSrcweir // BulletItem und BulletFont fuer Titel und Gliederung 1346cdf0e10cSrcweir SvxBulletItem aBulletItem(EE_PARA_BULLET); 1347cdf0e10cSrcweir Font aBulletFont( static_cast<SdStyleSheetPool*>( mxStyleSheetPool.get())->GetBulletFont() ); 1348cdf0e10cSrcweir aBulletFont.SetSize(Size(0,846)); // 24 pt 1349cdf0e10cSrcweir aBulletItem.SetFont(aBulletFont); 1350cdf0e10cSrcweir aBulletItem.SetStyle(BS_BULLET); 1351cdf0e10cSrcweir aBulletItem.SetStart(1); 1352cdf0e10cSrcweir aBulletItem.SetScale(45); // in Prozent 1353cdf0e10cSrcweir aBulletItem.SetSymbol( 0x25CF ); // Punkt 1354cdf0e10cSrcweir pItemPool->SetPoolDefaultItem( aBulletItem ); 1355cdf0e10cSrcweir 1356cdf0e10cSrcweir // Bullets nicht sichtbar 1357cdf0e10cSrcweir // SfxUInt16Item aBulletStateItem(EE_PARA_BULLETSTATE, 0); 1358cdf0e10cSrcweir // pItemPool->SetPoolDefaultItem( aBulletStateItem ); 1359cdf0e10cSrcweir 1360cdf0e10cSrcweir // Neues BulletItem 1361cdf0e10cSrcweir SvxNumberFormat aNumberFormat(SVX_NUM_CHAR_SPECIAL); 1362cdf0e10cSrcweir aNumberFormat.SetBulletFont(&aBulletFont); 1363cdf0e10cSrcweir aNumberFormat.SetBulletChar( 0x25CF ); // StarBats: 0xF000 + 34 1364cdf0e10cSrcweir aNumberFormat.SetBulletRelSize(45); 1365cdf0e10cSrcweir aNumberFormat.SetBulletColor(Color(COL_AUTO)); 1366cdf0e10cSrcweir aNumberFormat.SetStart(1); 1367cdf0e10cSrcweir aNumberFormat.SetNumAdjust(SVX_ADJUST_LEFT); 1368cdf0e10cSrcweir 1369cdf0e10cSrcweir SvxNumRule aNumRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, 10, sal_False); 1370cdf0e10cSrcweir 1371cdf0e10cSrcweir aNumberFormat.SetLSpace( 0 ); 1372cdf0e10cSrcweir aNumberFormat.SetAbsLSpace( 0 ); 1373cdf0e10cSrcweir aNumberFormat.SetFirstLineOffset( 0 ); 1374cdf0e10cSrcweir aNumRule.SetLevel( 0, aNumberFormat ); 1375cdf0e10cSrcweir 1376cdf0e10cSrcweir for( sal_uInt16 i = 1; i < aNumRule.GetLevelCount(); i++ ) 1377cdf0e10cSrcweir { 1378cdf0e10cSrcweir const short nLSpace = (i + 1) * 600; 1379cdf0e10cSrcweir aNumberFormat.SetLSpace(nLSpace); 1380cdf0e10cSrcweir aNumberFormat.SetAbsLSpace(nLSpace); 1381cdf0e10cSrcweir aNumberFormat.SetFirstLineOffset(-600); 1382cdf0e10cSrcweir aNumRule.SetLevel( i, aNumberFormat ); 1383cdf0e10cSrcweir } 1384cdf0e10cSrcweir 1385cdf0e10cSrcweir SvxNumBulletItem aNumBulletItem( aNumRule, EE_PARA_NUMBULLET ); 1386cdf0e10cSrcweir pItemPool->SetPoolDefaultItem( aNumBulletItem ); 1387cdf0e10cSrcweir } 1388cdf0e10cSrcweir 1389cdf0e10cSrcweir /************************************************************************* 1390cdf0e10cSrcweir |* 1391cdf0e10cSrcweir |* 1392cdf0e10cSrcweir |* 1393cdf0e10cSrcweir \************************************************************************/ 1394cdf0e10cSrcweir 1395cdf0e10cSrcweir ::com::sun::star::text::WritingMode SdDrawDocument::GetDefaultWritingMode() const 1396cdf0e10cSrcweir { 1397cdf0e10cSrcweir const SfxPoolItem* pItem = ( pItemPool ? pItemPool->GetPoolDefaultItem( EE_PARA_WRITINGDIR ) : NULL ); 1398cdf0e10cSrcweir ::com::sun::star::text::WritingMode eRet = ::com::sun::star::text::WritingMode_LR_TB; 1399cdf0e10cSrcweir 1400cdf0e10cSrcweir if( pItem ) 1401cdf0e10cSrcweir { 1402cdf0e10cSrcweir switch( ( (SvxFrameDirectionItem&)( *pItem ) ).GetValue() ) 1403cdf0e10cSrcweir { 1404cdf0e10cSrcweir case( FRMDIR_HORI_LEFT_TOP ): eRet = ::com::sun::star::text::WritingMode_LR_TB; break; 1405cdf0e10cSrcweir case( FRMDIR_HORI_RIGHT_TOP ): eRet = ::com::sun::star::text::WritingMode_RL_TB; break; 1406cdf0e10cSrcweir case( FRMDIR_VERT_TOP_RIGHT ): eRet = ::com::sun::star::text::WritingMode_TB_RL; break; 1407cdf0e10cSrcweir 1408cdf0e10cSrcweir default: 1409cdf0e10cSrcweir DBG_ERROR( "Frame direction not supported yet" ); 1410cdf0e10cSrcweir break; 1411cdf0e10cSrcweir } 1412cdf0e10cSrcweir } 1413cdf0e10cSrcweir 1414cdf0e10cSrcweir return eRet; 1415cdf0e10cSrcweir } 1416cdf0e10cSrcweir 1417cdf0e10cSrcweir void SdDrawDocument::SetDefaultWritingMode(::com::sun::star::text::WritingMode eMode ) 1418cdf0e10cSrcweir { 1419cdf0e10cSrcweir if( pItemPool ) 1420cdf0e10cSrcweir { 1421cdf0e10cSrcweir SvxFrameDirection nVal; 1422cdf0e10cSrcweir switch( eMode ) 1423cdf0e10cSrcweir { 1424cdf0e10cSrcweir case ::com::sun::star::text::WritingMode_LR_TB: nVal = FRMDIR_HORI_LEFT_TOP; break; 1425cdf0e10cSrcweir case ::com::sun::star::text::WritingMode_RL_TB: nVal = FRMDIR_HORI_RIGHT_TOP; break; 1426cdf0e10cSrcweir case ::com::sun::star::text::WritingMode_TB_RL: nVal = FRMDIR_VERT_TOP_RIGHT; break; 1427cdf0e10cSrcweir default: 1428cdf0e10cSrcweir DBG_ERROR( "Frame direction not supported yet" ); 1429cdf0e10cSrcweir return; 1430cdf0e10cSrcweir } 1431cdf0e10cSrcweir 1432cdf0e10cSrcweir SvxFrameDirectionItem aModeItem( nVal, EE_PARA_WRITINGDIR ); 1433cdf0e10cSrcweir pItemPool->SetPoolDefaultItem( aModeItem ); 1434cdf0e10cSrcweir 1435cdf0e10cSrcweir SvxAdjustItem aAdjust( SVX_ADJUST_LEFT, EE_PARA_JUST ); 1436cdf0e10cSrcweir 1437cdf0e10cSrcweir if( eMode == ::com::sun::star::text::WritingMode_RL_TB ) 1438cdf0e10cSrcweir aAdjust.SetEnumValue( SVX_ADJUST_RIGHT ); 1439cdf0e10cSrcweir 1440cdf0e10cSrcweir pItemPool->SetPoolDefaultItem( aAdjust ); 1441cdf0e10cSrcweir 1442cdf0e10cSrcweir 1443cdf0e10cSrcweir } 1444cdf0e10cSrcweir } 1445cdf0e10cSrcweir 1446cdf0e10cSrcweir void SdDrawDocument::getDefaultFonts( Font& rLatinFont, Font& rCJKFont, Font& rCTLFont ) 1447cdf0e10cSrcweir { 1448cdf0e10cSrcweir LanguageType eLatin = GetLanguage( EE_CHAR_LANGUAGE ); 1449cdf0e10cSrcweir 1450cdf0e10cSrcweir // #108374# / #107782#: If the UI language is Korean, the default Latin font has to 1451cdf0e10cSrcweir // be queried for Korean, too (the Latin language from the document can't be Korean). 1452cdf0e10cSrcweir // This is the same logic as in SwDocShell::InitNew. 1453cdf0e10cSrcweir LanguageType eUiLanguage = Application::GetSettings().GetUILanguage(); 1454cdf0e10cSrcweir switch( eUiLanguage ) 1455cdf0e10cSrcweir { 1456cdf0e10cSrcweir case LANGUAGE_KOREAN: 1457cdf0e10cSrcweir case LANGUAGE_KOREAN_JOHAB: 1458cdf0e10cSrcweir eLatin = eUiLanguage; 1459cdf0e10cSrcweir break; 1460cdf0e10cSrcweir } 1461cdf0e10cSrcweir 1462cdf0e10cSrcweir rLatinFont = OutputDevice::GetDefaultFont( DEFAULTFONT_LATIN_PRESENTATION, eLatin, DEFAULTFONT_FLAGS_ONLYONE ); 1463cdf0e10cSrcweir rCJKFont = OutputDevice::GetDefaultFont( DEFAULTFONT_CJK_PRESENTATION, GetLanguage( EE_CHAR_LANGUAGE_CJK ), DEFAULTFONT_FLAGS_ONLYONE ); 1464cdf0e10cSrcweir rCTLFont = OutputDevice::GetDefaultFont( DEFAULTFONT_CTL_PRESENTATION, GetLanguage( EE_CHAR_LANGUAGE_CTL ), DEFAULTFONT_FLAGS_ONLYONE ) ; 1465cdf0e10cSrcweir } 1466cdf0e10cSrcweir 1467cdf0e10cSrcweir /* converts the given western font height to a corresponding ctl font height, deppending on the system language */ 1468cdf0e10cSrcweir sal_uInt32 SdDrawDocument::convertFontHeightToCTL( sal_uInt32 nWesternFontHeight ) 1469cdf0e10cSrcweir { 1470cdf0e10cSrcweir LanguageType eRealCTLLanguage = Application::GetSettings().GetLanguage(); 1471cdf0e10cSrcweir if( LANGUAGE_THAI == eRealCTLLanguage ) 1472cdf0e10cSrcweir { 1473cdf0e10cSrcweir // http://specs.openoffice.org/g11n/font_sizes/42775_42725_Individual_configurable_font_size_for_default_fonts.odt 1474cdf0e10cSrcweir double fTemp = double(nWesternFontHeight) * 1.333; 1475cdf0e10cSrcweir nWesternFontHeight = (sal_uInt32)fTemp; 1476cdf0e10cSrcweir // make some nice values for UI that displays PT instead of 1/100th mm 1477cdf0e10cSrcweir nWesternFontHeight = ((nWesternFontHeight * 72) + 1270) / 2540L; 1478cdf0e10cSrcweir nWesternFontHeight = ((nWesternFontHeight * 2540L) + 36) / 72; 1479cdf0e10cSrcweir } 1480cdf0e10cSrcweir return nWesternFontHeight; 1481cdf0e10cSrcweir } 1482cdf0e10cSrcweir 1483cdf0e10cSrcweir SdStyleSheetPool* SdDrawDocument::GetSdStyleSheetPool() const 1484cdf0e10cSrcweir { 1485cdf0e10cSrcweir return dynamic_cast< SdStyleSheetPool* >( GetStyleSheetPool() ); 1486cdf0e10cSrcweir } 1487cdf0e10cSrcweir 1488cdf0e10cSrcweir ModifyGuard::ModifyGuard( SdDrawDocument* pDoc ) 1489cdf0e10cSrcweir : mpDocShell( 0 ), mpDoc( pDoc ) 1490cdf0e10cSrcweir { 1491cdf0e10cSrcweir init(); 1492cdf0e10cSrcweir } 1493cdf0e10cSrcweir 1494cdf0e10cSrcweir void ModifyGuard::init() 1495cdf0e10cSrcweir { 1496cdf0e10cSrcweir if( mpDocShell ) 1497cdf0e10cSrcweir { 1498cdf0e10cSrcweir mpDoc = mpDocShell->GetDoc(); 1499cdf0e10cSrcweir } 1500cdf0e10cSrcweir else if( mpDoc ) 1501cdf0e10cSrcweir { 1502cdf0e10cSrcweir mpDocShell = mpDoc->GetDocSh(); 1503cdf0e10cSrcweir } 1504cdf0e10cSrcweir 1505cdf0e10cSrcweir mbIsEnableSetModified = mpDocShell ? mpDocShell->IsEnableSetModified() : sal_False; 1506cdf0e10cSrcweir mbIsDocumentChanged = mpDoc ? mpDoc->IsChanged() : sal_False; 1507cdf0e10cSrcweir 1508cdf0e10cSrcweir if( mbIsEnableSetModified ) 1509cdf0e10cSrcweir mpDocShell->EnableSetModified( sal_False ); 1510cdf0e10cSrcweir } 1511cdf0e10cSrcweir 1512cdf0e10cSrcweir ModifyGuard::~ModifyGuard() 1513cdf0e10cSrcweir { 1514cdf0e10cSrcweir if( mbIsEnableSetModified ) 1515cdf0e10cSrcweir mpDocShell->EnableSetModified( sal_True ); 1516cdf0e10cSrcweir 1517cdf0e10cSrcweir if( mpDoc && (mpDoc->IsChanged() != mbIsDocumentChanged) ) 1518cdf0e10cSrcweir mpDoc->SetChanged(mbIsDocumentChanged); 1519cdf0e10cSrcweir } 1520