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