1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_sd.hxx"
31 #include <com/sun/star/style/XStyle.hpp>
32 #include <com/sun/star/container/XNameAccess.hpp>
34 #include <tools/urlobj.hxx>
35 #include <sfx2/docfile.hxx>
36 #include <sfx2/dispatch.hxx>
37 #include "Outliner.hxx"
38 #include <comphelper/processfactory.hxx>
39 #include <editeng/outliner.hxx>
41 #include "../ui/inc/DrawDocShell.hxx"
42 #include <editeng/eeitem.hxx>
43 #include <vcl/svapp.hxx>
46 #include <editeng/akrnitem.hxx>
48 #include <svx/svxids.hrc>
49 #include <svl/srchitem.hxx>
50 #include <editeng/lrspitem.hxx>
51 #include <editeng/ulspitem.hxx>
52 #include <editeng/lspcitem.hxx>
53 #include <editeng/adjitem.hxx>
54 #include <svx/dialogs.hrc>
55 #include <svx/dialmgr.hxx> // SVX_RESSTR
56 #include <editeng/bulitem.hxx>
57 #include <svx/xtable.hxx>
58 #include <svx/sxmsuitm.hxx>
59 #include <editeng/borderline.hxx>
60 #include <editeng/boxitem.hxx>
61 #include <svx/xit.hxx>
62 #include <svx/xlineit0.hxx>
63 #include <svx/sdshitm.hxx>
64 #include <svx/svdotext.hxx>
65 #include <svx/xfillit0.hxx>
66 #include <svx/sdshcitm.hxx>
67 #include <editeng/editstat.hxx>
68 #include <editeng/colritem.hxx>
69 #include <editeng/fhgtitem.hxx>
70 #include <editeng/wghtitem.hxx>
71 #include <editeng/postitem.hxx>
72 #include <editeng/crsditem.hxx>
73 #include <editeng/udlnitem.hxx>
74 #include <editeng/cntritem.hxx>
75 #ifndef _SVX_EMPHITEM_HXX
76 #include <editeng/emphitem.hxx>
78 #include <editeng/fontitem.hxx>
79 #include <editeng/shdditem.hxx>
80 #include <svx/xbtmpit.hxx>
81 #include <svx/xflhtit.hxx>
82 #include <svx/xflgrit.hxx>
83 #include <svx/xflclit.hxx>
84 #include <svx/xlnedcit.hxx>
85 #include <svx/xlnstcit.hxx>
86 #include <svx/xlnedwit.hxx>
87 #include <svx/xlnstwit.hxx>
88 #include <svx/xlnedit.hxx>
89 #include <editeng/charreliefitem.hxx>
90 #include <svx/xlnstit.hxx>
91 #include <svx/xlndsit.hxx>
92 #include <svx/xlnwtit.hxx>
93 #include <svx/xlnclit.hxx>
94 #include <svx/svditer.hxx>
95 #include <svx/svdogrp.hxx>
96 #include <tools/shl.hxx>
97 #include <editeng/numitem.hxx>
98 #include <editeng/editeng.hxx>
99 #include <editeng/unolingu.hxx>
100 #include <com/sun/star/linguistic2/XHyphenator.hpp>
101 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
102 #include <svl/itempool.hxx>
103 #include <editeng/outlobj.hxx>
104 #include <sfx2/viewfrm.hxx>
105 #include <editeng/langitem.hxx>
106 #include <editeng/frmdiritem.hxx>
108 #include "sdresid.hxx"
109 #include "drawdoc.hxx"
110 #include "sdpage.hxx"
113 #include "stlpool.hxx"
115 #include "sdiocmpt.hxx"
116 #include "shapelist.hxx"
117 #include <basegfx/point/b2dpoint.hxx>
118 #include <basegfx/polygon/b2dpolygon.hxx>
119 #include <svl/itemset.hxx>
122 using ::rtl::OUString
;
123 using namespace ::com::sun::star
;
124 using namespace ::com::sun::star::uno
;
125 using namespace ::com::sun::star::lang
;
126 using namespace ::com::sun::star::style
;
127 using namespace ::com::sun::star::container
;
128 using namespace ::com::sun::star::linguistic2
;
129 using namespace ::sd
;
131 /*************************************************************************
133 |* CreateLayoutTemplates, Layoutvorlagen erzeugen
135 |* Z.Zt. (31.03.95) speichert der StyleSheetPool nur diejenigen Sheets, die
136 |* ein ItemSet haben. Damit alle Sheets gespeichert werden, wird die ItemSet-
137 |* Erzeugung mit einem GetItemSet-Aufruf erzwungen.
138 |* Dies kann entfallen, sobald der Pool auch Sheets ohne ItemSet speichert.
140 \************************************************************************/
142 void SdDrawDocument::CreateLayoutTemplates()
144 SdStyleSheetPool
* pSSPool
= (SdStyleSheetPool
*)GetStyleSheetPool();
145 SfxStyleSheetBase
* pSheet
= NULL
;
147 String aStdName
= String(SdResId(STR_STANDARD_STYLESHEET_NAME
));
149 // ---- Standardvorlage -----------------------------------------------
151 // nicht benutzt, nicht benutzerdefiniert
152 // SB hatte wahrscheinlich Probleme mit SFXSTYLEBIT_AUTO, da dann gar nichts
153 // mehr im Gestalter angezeigt wird. Dieses Problem ist zu 364 j behoben worden
154 // sal_uInt16 nMask = SFXSTYLEBIT_ALL & ~(SFXSTYLEBIT_USED | SFXSTYLEBIT_USERDEF);
155 sal_uInt16 nMask
= SFXSTYLEBIT_AUTO
;
157 String
aName(aStdName
);
158 pSheet
= &(pSSPool
->Make(aName
, SD_STYLE_FAMILY_GRAPHICS
, nMask
));
159 pSheet
->SetHelpId( aHelpFile
, HID_STANDARD_STYLESHEET_NAME
);
160 SfxItemSet
& rISet
= pSheet
->GetItemSet();
161 SfxItemPool
* pPool
= rISet
.GetPool();
165 ::basegfx::B2DPolyPolygon aNullPolyPolygon
;
166 Color
aNullCol(RGB_Color(COL_DEFAULT_SHAPE_STROKE
));
169 XGradient
aNullGrad(aNullCol
,RGB_Color(COL_WHITE
));
170 aNullGrad
.SetStartIntens( 100 );
171 aNullGrad
.SetEndIntens( 100 );
172 XHatch
aNullHatch(aNullCol
);
174 // Linienattribute (Extended OutputDevice)
175 rISet
.Put(XLineStyleItem(XLINE_SOLID
));
176 rISet
.Put(XLineColorItem(String(), RGB_Color(COL_DEFAULT_SHAPE_STROKE
)));
177 rISet
.Put(XLineWidthItem(0));
178 rISet
.Put(XLineDashItem(pPool
,aNullDash
));
179 rISet
.Put(XLineStartItem(pPool
,aNullPolyPolygon
));
180 rISet
.Put(XLineEndItem(pPool
,aNullPolyPolygon
));
181 rISet
.Put(XLineStartWidthItem(200));
182 rISet
.Put(XLineEndWidthItem(200));
183 rISet
.Put(XLineStartCenterItem());
184 rISet
.Put(XLineEndCenterItem());
185 rISet
.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_BLOCK
));
187 // Fuellattribute (Extended OutputDevice)
188 rISet
.Put(XFillStyleItem(XFILL_SOLID
));
189 rISet
.Put(XFillColorItem(String(), RGB_Color(COL_DEFAULT_SHAPE_FILLING
)));
191 rISet
.Put(XFillGradientItem(pPool
,aNullGrad
));
192 rISet
.Put(XFillHatchItem(pPool
,aNullHatch
));
193 Size
aNullSize( 32, 32 );
194 Color
aNullColor( COL_WHITE
);
195 Bitmap
aNullBmp( aNullSize
, 8 );
196 aNullBmp
.Erase( aNullColor
);
197 rISet
.Put(XFillBitmapItem(pPool
,aNullBmp
));
199 // Schattenattribute (Drawing Engine)
200 rISet
.Put(SdrShadowItem(sal_False
));
201 rISet
.Put(SdrShadowColorItem(aNullStr
, RGB_Color(COL_GRAY
)));
202 rISet
.Put(SdrShadowXDistItem(200)); // 3 mm Schattendistanz
203 rISet
.Put(SdrShadowYDistItem(200));
205 Font aLatinFont
, aCJKFont
, aCTLFont
;
207 getDefaultFonts( aLatinFont
, aCJKFont
, aCTLFont
);
209 SvxFontItem
aSvxFontItem( aLatinFont
.GetFamily(), aLatinFont
.GetName(), aLatinFont
.GetStyleName(), aLatinFont
.GetPitch(),
210 aLatinFont
.GetCharSet(), EE_CHAR_FONTINFO
);
212 SvxFontItem
aSvxFontItemCJK( aCJKFont
.GetFamily(), aCJKFont
.GetName(), aCJKFont
.GetStyleName(), aCJKFont
.GetPitch(),
213 aCJKFont
.GetCharSet(), EE_CHAR_FONTINFO_CJK
);
215 SvxFontItem
aSvxFontItemCTL( aCTLFont
.GetFamily(), aCTLFont
.GetName(), aCTLFont
.GetStyleName(), aCTLFont
.GetPitch(),
216 aCTLFont
.GetCharSet(), EE_CHAR_FONTINFO_CTL
);
218 rISet
.Put( aSvxFontItem
);
219 rISet
.Put( aSvxFontItemCJK
);
220 rISet
.Put( aSvxFontItemCTL
);
222 rISet
.Put( SvxFontHeightItem( 635, 100, EE_CHAR_FONTHEIGHT
) ); // sj: (i33745) changed default from 24 to 18 pt
223 rISet
.Put( SvxFontHeightItem( 635, 100, EE_CHAR_FONTHEIGHT_CJK
) ); // 18 pt
224 rISet
.Put( SvxFontHeightItem( convertFontHeightToCTL( 635 ), 100, EE_CHAR_FONTHEIGHT_CTL
) ); // 18 pt
226 rISet
.Put( SvxWeightItem( WEIGHT_NORMAL
, EE_CHAR_WEIGHT
) );
227 rISet
.Put( SvxWeightItem( WEIGHT_NORMAL
, EE_CHAR_WEIGHT_CJK
) );
228 rISet
.Put( SvxWeightItem( WEIGHT_NORMAL
, EE_CHAR_WEIGHT_CTL
) );
230 rISet
.Put( SvxPostureItem( ITALIC_NONE
, EE_CHAR_ITALIC
) );
231 rISet
.Put( SvxPostureItem( ITALIC_NONE
, EE_CHAR_ITALIC_CJK
) );
232 rISet
.Put( SvxPostureItem( ITALIC_NONE
, EE_CHAR_ITALIC_CTL
) );
234 rISet
.Put(SvxContourItem(sal_False
, EE_CHAR_OUTLINE
));
235 rISet
.Put(SvxShadowedItem(sal_False
, EE_CHAR_SHADOW
));
236 rISet
.Put(SvxUnderlineItem(UNDERLINE_NONE
, EE_CHAR_UNDERLINE
));
237 rISet
.Put(SvxOverlineItem(UNDERLINE_NONE
, EE_CHAR_OVERLINE
));
238 rISet
.Put(SvxCrossedOutItem(STRIKEOUT_NONE
, EE_CHAR_STRIKEOUT
));
239 rISet
.Put(SvxEmphasisMarkItem(EMPHASISMARK_NONE
, EE_CHAR_EMPHASISMARK
));
240 rISet
.Put(SvxCharReliefItem(RELIEF_NONE
, EE_CHAR_RELIEF
));
241 rISet
.Put(SvxColorItem(Color(COL_AUTO
), EE_CHAR_COLOR
));
243 // Absatzattribute (Edit Engine)
244 rISet
.Put(SvxLRSpaceItem(EE_PARA_LRSPACE
));
245 rISet
.Put(SvxULSpaceItem(EE_PARA_ULSPACE
));
247 rISet
.Put( SdrTextLeftDistItem( 250 ) ); // sj: (i33745) using text frame distances seems to be a better default
248 rISet
.Put( SdrTextRightDistItem( 250 ) );
249 rISet
.Put( SdrTextUpperDistItem( 125 ) );
250 rISet
.Put( SdrTextLowerDistItem( 125 ) );
252 rISet
.Put( SvxLineSpacingItem( LINE_SPACE_DEFAULT_HEIGHT
, EE_PARA_SBL
) );
254 // #i16874# enable kerning by default but only for new documents
255 rISet
.Put( SvxAutoKernItem( sal_True
, EE_CHAR_PAIRKERNING
) );
258 // BulletItem und BulletFont fuer Titel und Gliederung
259 SvxBulletItem
aBulletItem(EE_PARA_BULLET
);
260 // die sind in allen Ebenen identisch
261 aBulletItem
.SetStyle(BS_BULLET
);
262 aBulletItem
.SetStart(1);
263 aBulletItem
.SetScale(45); // in Prozent
265 Font
aBulletFont( pSSPool
->GetBulletFont() );
267 aBulletFont
.SetSize(Size(0,635)); // sj: (i33745) changed default from 24 to 18 pt
269 aBulletItem
.SetFont(aBulletFont
);
270 aBulletItem
.SetSymbol( 0x25CF ); // Punkt
271 rISet
.Put(aBulletItem
);
273 // SfxUInt16Item aBulletStateItem(EE_PARA_BULLETSTATE, 0); // Bullets nicht sichtbar
274 // rISet.Put(aBulletStateItem);
277 pSSPool
->PutNumBulletItem( pSheet
, aBulletFont
);
279 SfxItemSet
* pISet
= NULL
;
281 // ---- Objekt mit Pfeilspitze ----------------------------------------
283 aName
= String(SdResId(STR_POOLSHEET_OBJWITHARROW
));
284 pSheet
= &(pSSPool
->Make(aName
, SD_STYLE_FAMILY_GRAPHICS
, nMask
));
285 pSheet
->SetParent(aStdName
);
286 pSheet
->SetHelpId( aHelpFile
, HID_POOLSHEET_OBJWITHARROW
);
287 pISet
= &pSheet
->GetItemSet();
289 pISet
->Put(XLineStyleItem(XLINE_SOLID
));
290 pISet
->Put(XLineColorItem(String(), RGB_Color(COL_BLACK
)));
291 pISet
->Put(XLineWidthItem(150));
293 ::basegfx::B2DPolygon aArrow
;
294 aArrow
.append(::basegfx::B2DPoint(10.0, 0.0));
295 aArrow
.append(::basegfx::B2DPoint(0.0, 30.0));
296 aArrow
.append(::basegfx::B2DPoint(20.0, 30.0));
297 aArrow
.setClosed(true);
298 pISet
->Put(XLineStartItem(SVX_RESSTR(RID_SVXSTR_ARROW
),::basegfx::B2DPolyPolygon(aArrow
)));
300 pISet
->Put(XLineStartWidthItem(700));
301 pISet
->Put(XLineEndWidthItem(300));
302 pISet
->Put(XLineStartCenterItem(sal_True
));
304 // ---- Objekt mit Schatten -------------------------------------------
306 aName
= String(SdResId(STR_POOLSHEET_OBJWITHSHADOW
));
307 pSheet
= &(pSSPool
->Make(aName
, SD_STYLE_FAMILY_GRAPHICS
, nMask
));
308 pSheet
->SetParent(aStdName
);
309 pSheet
->SetHelpId( aHelpFile
, HID_POOLSHEET_OBJWITHSHADOW
);
310 pISet
= &pSheet
->GetItemSet();
312 pISet
->Put(SdrShadowItem(sal_True
));
313 pISet
->Put(SdrShadowColorItem(aNullStr
, RGB_Color(COL_GRAY
)));
314 pISet
->Put(SdrShadowXDistItem(200)); // 3 mm Schattendistanz
315 pISet
->Put(SdrShadowYDistItem(200));
317 // ---- Objekt ohne F�llung -------------------------------------------
319 aName
= String(SdResId(STR_POOLSHEET_OBJWITHOUTFILL
));
320 pSheet
= &(pSSPool
->Make(aName
, SD_STYLE_FAMILY_GRAPHICS
, nMask
));
321 pSheet
->SetParent(aStdName
);
322 pSheet
->SetHelpId( aHelpFile
, HID_POOLSHEET_OBJWITHOUTFILL
);
323 pISet
= &pSheet
->GetItemSet();
325 pISet
->Put(XFillStyleItem(XFILL_NONE
));
326 pISet
->Put(XLineColorItem(String(), RGB_Color(COL_BLACK
)));
328 // ---- Text ----------------------------------------------------------
330 aName
= String(SdResId(STR_POOLSHEET_TEXT
));
331 pSheet
= &(pSSPool
->Make(aName
, SD_STYLE_FAMILY_GRAPHICS
, nMask
));
332 pSheet
->SetParent(aStdName
);
333 pSheet
->SetHelpId( aHelpFile
, HID_POOLSHEET_TEXT
);
334 pISet
= &pSheet
->GetItemSet();
336 pISet
->Put(XLineStyleItem(XLINE_NONE
));
337 pISet
->Put(XFillStyleItem(XFILL_NONE
));
339 // ---- Textk”rper ----------------------------------------------------
341 aName
= String(SdResId(STR_POOLSHEET_TEXTBODY
));
342 pSheet
= &(pSSPool
->Make(aName
, SD_STYLE_FAMILY_GRAPHICS
, nMask
));
343 pSheet
->SetParent(aStdName
);
344 pSheet
->SetHelpId( aHelpFile
, HID_POOLSHEET_TEXTBODY
);
345 pISet
= &pSheet
->GetItemSet();
347 pISet
->Put(XLineStyleItem(XLINE_NONE
));
348 pISet
->Put(XFillStyleItem(XFILL_NONE
));
350 pISet
->Put(SvxFontHeightItem(564, 100, EE_CHAR_FONTHEIGHT
)); // 16 pt
352 // ---- Textk”rper mit Blocksatz --------------------------------------
354 aName
= String(SdResId(STR_POOLSHEET_TEXTBODY_JUSTIFY
));
355 pSheet
= &(pSSPool
->Make(aName
, SD_STYLE_FAMILY_GRAPHICS
, nMask
));
356 pSheet
->SetParent(aStdName
);
357 pSheet
->SetHelpId( aHelpFile
, HID_POOLSHEET_TEXTBODY_JUSTIFY
);
358 pISet
= &pSheet
->GetItemSet();
360 pISet
->Put(XLineStyleItem(XLINE_NONE
));
361 pISet
->Put(XFillStyleItem(XFILL_NONE
));
363 pISet
->Put(SvxAdjustItem(SVX_ADJUST_BLOCK
, EE_PARA_JUST
));
365 // ---- Textkoerper mit Einzug -----------------------------------------
367 aName
= String(SdResId(STR_POOLSHEET_TEXTBODY_INDENT
));
368 pSheet
= &(pSSPool
->Make(aName
, SD_STYLE_FAMILY_GRAPHICS
, nMask
));
369 pSheet
->SetParent(aStdName
);
370 pSheet
->SetHelpId( aHelpFile
, HID_POOLSHEET_TEXTBODY_INDENT
);
371 pISet
= &pSheet
->GetItemSet();
373 pISet
->Put(XLineStyleItem(XLINE_NONE
));
374 pISet
->Put(XFillStyleItem(XFILL_NONE
));
376 SvxLRSpaceItem
aLRSpaceItem( EE_PARA_LRSPACE
);
377 aLRSpaceItem
.SetTxtFirstLineOfst(600); // Erstzeileneinzug 6mm, rechts 0
378 pISet
->Put(aLRSpaceItem
);
381 // SvxLRSpaceItem hart gesetzt: NumBulletItem anpassen
382 SvxNumBulletItem aNumBullet( (const SvxNumBulletItem&) pISet->Get(EE_PARA_NUMBULLET) );
383 EditEngine::ImportBulletItem( aNumBullet, 0, NULL, &aLRSpaceItem );
384 pISet->Put( aNumBullet );
386 // ---- Titel ---------------------------------------------------------
388 aName
= String(SdResId(STR_POOLSHEET_TITLE
));
389 pSheet
= &(pSSPool
->Make(aName
, SD_STYLE_FAMILY_GRAPHICS
, nMask
));
390 pSheet
->SetParent(aStdName
);
391 pSheet
->SetHelpId( aHelpFile
, HID_POOLSHEET_TITLE
);
392 pISet
= &pSheet
->GetItemSet();
394 pISet
->Put(XLineStyleItem(XLINE_NONE
));
395 pISet
->Put(XFillStyleItem(XFILL_NONE
));
397 pISet
->Put(SvxFontHeightItem(1551, 100, EE_CHAR_FONTHEIGHT
)); // 44 pt
399 // ---- Titel1 --------------------------------------------------------
401 aName
= String(SdResId(STR_POOLSHEET_TITLE1
));
402 pSheet
= &(pSSPool
->Make(aName
, SD_STYLE_FAMILY_GRAPHICS
, nMask
));
403 pSheet
->SetParent(aStdName
);
404 pSheet
->SetHelpId( aHelpFile
, HID_POOLSHEET_TITLE1
);
405 pISet
= &pSheet
->GetItemSet();
407 pISet
->Put(XLineStyleItem(XLINE_NONE
));
408 pISet
->Put(XFillStyleItem(XFILL_SOLID
));
409 pISet
->Put(XFillColorItem(String(), RGB_Color(COL_CYAN
)));
411 pISet
->Put(SdrShadowItem(sal_True
));
412 pISet
->Put(SdrShadowColorItem(aNullStr
, RGB_Color(COL_GRAY
)));
413 pISet
->Put(SdrShadowXDistItem(200)); // 2 mm Schattendistanz
414 pISet
->Put(SdrShadowYDistItem(200));
416 pISet
->Put(SvxFontHeightItem(846, 100, EE_CHAR_FONTHEIGHT
)); // 24 pt
418 pISet
->Put(SvxAdjustItem(SVX_ADJUST_CENTER
, EE_PARA_JUST
));
420 // ---- Titel2 --------------------------------------------------------
422 aName
= String(SdResId(STR_POOLSHEET_TITLE2
));
423 pSheet
= &(pSSPool
->Make(aName
, SD_STYLE_FAMILY_GRAPHICS
, nMask
));
424 pSheet
->SetParent(aStdName
);
425 pSheet
->SetHelpId( aHelpFile
, HID_POOLSHEET_TITLE2
);
426 pISet
= &pSheet
->GetItemSet();
428 pISet
->Put(XLineWidthItem(50));
430 // Farbe nicht aus der Farbtabelle holen, denn da kann diese Farbe
431 // geloescht oder veraendert sein
432 Color
aOrange4(255, 204, 153);
433 pISet
->Put(XFillColorItem(String(), aOrange4
));
435 pISet
->Put(SdrShadowItem(sal_True
));
436 pISet
->Put(SdrShadowColorItem(aNullStr
, RGB_Color(COL_GRAY
)));
437 pISet
->Put(SdrShadowXDistItem(200)); // 2 mm Schattendistanz
438 pISet
->Put(SdrShadowYDistItem(200));
440 pISet
->Put(SvxFontHeightItem(1270, 100, EE_CHAR_FONTHEIGHT
)); // 36 pt
442 SvxLRSpaceItem
aLRSpItem( 200, 200, 0, 0, EE_PARA_LRSPACE
);
443 pISet
->Put( aLRSpItem
); // Erstzeileneinzug 0 mm, links und rechts 2 mm
446 // SvxLRSpaceItem hart gesetzt: NumBulletItem anpassen
447 SvxNumBulletItem aNmBullet( (const SvxNumBulletItem&) pISet->Get(EE_PARA_NUMBULLET) );
448 EditEngine::ImportBulletItem( aNmBullet, 0, NULL, &aLRSpItem );
449 pISet->Put( aNmBullet );
452 pISet
->Put(SvxULSpaceItem(100, 100, EE_PARA_ULSPACE
)); // Absatzrand oben/unten 1 mm
454 pISet
->Put(SvxAdjustItem(SVX_ADJUST_CENTER
, EE_PARA_JUST
));
456 // ---- Ueberschrift ---------------------------------------------------
458 aName
= String(SdResId(STR_POOLSHEET_HEADLINE
));
459 pSheet
= &(pSSPool
->Make(aName
, SD_STYLE_FAMILY_GRAPHICS
, nMask
));
460 pSheet
->SetParent(aStdName
);
461 pSheet
->SetHelpId( aHelpFile
, HID_POOLSHEET_HEADLINE
);
462 pISet
= &pSheet
->GetItemSet();
464 pISet
->Put(XLineStyleItem(XLINE_NONE
));
465 pISet
->Put(XFillStyleItem(XFILL_NONE
));
467 pISet
->Put(SvxFontHeightItem(846, 100, EE_CHAR_FONTHEIGHT
)); // 24 pt
469 pISet
->Put(SvxULSpaceItem(420, 210, EE_PARA_ULSPACE
)); // Absatzrand oben 4,2 mm,
472 // ---- Ueberschrift1 --------------------------------------------------
474 aName
= String(SdResId(STR_POOLSHEET_HEADLINE1
));
475 pSheet
= &(pSSPool
->Make(aName
, SD_STYLE_FAMILY_GRAPHICS
, nMask
));
476 pSheet
->SetParent(aStdName
);
477 pSheet
->SetHelpId( aHelpFile
, HID_POOLSHEET_HEADLINE1
);
478 pISet
= &pSheet
->GetItemSet();
480 pISet
->Put(XLineStyleItem(XLINE_NONE
));
481 pISet
->Put(XFillStyleItem(XFILL_NONE
));
483 pISet
->Put(SvxWeightItem(WEIGHT_BOLD
, EE_CHAR_WEIGHT
));
485 pISet
->Put(SvxFontHeightItem(635, 100, EE_CHAR_FONTHEIGHT
)); // 18 pt
487 pISet
->Put(SvxULSpaceItem(420, 210, EE_PARA_ULSPACE
)); // Absatzrand oben 4,2 mm,
490 // ---- Ueberschrift2 --------------------------------------------------
492 aName
= String(SdResId(STR_POOLSHEET_HEADLINE2
));
493 pSheet
= &(pSSPool
->Make(aName
, SD_STYLE_FAMILY_GRAPHICS
, nMask
));
494 pSheet
->SetParent(aStdName
);
495 pSheet
->SetHelpId( aHelpFile
, HID_POOLSHEET_HEADLINE2
);
496 pISet
= &pSheet
->GetItemSet();
498 pISet
->Put(XLineStyleItem(XLINE_NONE
));
499 pISet
->Put(XFillStyleItem(XFILL_NONE
));
501 pISet
->Put(SvxPostureItem(ITALIC_NORMAL
, EE_CHAR_ITALIC
));
502 pISet
->Put(SvxWeightItem(WEIGHT_BOLD
, EE_CHAR_WEIGHT
));
504 pISet
->Put(SvxFontHeightItem(494, 100, EE_CHAR_FONTHEIGHT
)); // 14 pt
506 pISet
->Put(SvxULSpaceItem(420, 210, EE_PARA_ULSPACE
)); // Absatzrand oben 4,2 mm,
509 // ---- Bemassung --------------------------------------------------
511 aName
= String(SdResId(STR_POOLSHEET_MEASURE
));
512 pSheet
= &(pSSPool
->Make(aName
, SD_STYLE_FAMILY_GRAPHICS
, nMask
));
513 pSheet
->SetParent(aStdName
);
514 pSheet
->SetHelpId( aHelpFile
, HID_POOLSHEET_MEASURE
);
515 pISet
= &pSheet
->GetItemSet();
517 pISet
->Put(XFillStyleItem(XFILL_NONE
));
518 pISet
->Put(XLineColorItem(String(), RGB_Color(COL_BLACK
)));
520 pISet
->Put(SvxFontHeightItem(423, 100, EE_CHAR_FONTHEIGHT
)); // 12 pt
522 pISet
->Put(XLineStartItem(SVX_RESSTR(RID_SVXSTR_ARROW
),::basegfx::B2DPolyPolygon(aArrow
)));
523 pISet
->Put(XLineStartWidthItem(200));
524 pISet
->Put(XLineEndItem(SVX_RESSTR(RID_SVXSTR_ARROW
),::basegfx::B2DPolyPolygon(aArrow
)));
525 pISet
->Put(XLineEndWidthItem(200));
526 pISet
->Put(XLineStyleItem(XLINE_SOLID
));
527 pISet
->Put(SdrMeasureShowUnitItem(true));
529 // Praesentationsvorlagen fuer das Standardlayout erzeugen
530 String aPrefix
= String(SdResId(STR_LAYOUT_DEFAULT_NAME
));
531 pSSPool
->CreateLayoutStyleSheets(aPrefix
);
534 static Any
implMakeSolidCellStyle( SdStyleSheetPool
* pSSPool
, const OUString
& rName
, const OUString rParent
, const Color
& rColor
)
536 SfxStyleSheetBase
* pSheet
= &(pSSPool
->Make(rName
, SD_STYLE_FAMILY_CELL
, SFXSTYLEBIT_AUTO
));
537 pSheet
->SetParent(rParent
);
538 SfxItemSet
* pISet
= &pSheet
->GetItemSet();
539 pISet
->Put(XFillStyleItem(XFILL_SOLID
));
540 pISet
->Put(XFillColorItem(String(), rColor
));
542 return Any( Reference
< XStyle
>( static_cast< XWeak
* >( pSheet
), UNO_QUERY
) );
545 static void implCreateTableTemplate( const Reference
< XNameContainer
>& xTableFamily
, const OUString
& rName
, const Any
& rBody
, const Any
& rHeading
, const Any
& rBanding
)
547 if( xTableFamily
.is() ) try
549 if( !xTableFamily
->hasByName( OUString( rName
) ) )
551 Reference
< XSingleServiceFactory
> xFactory( xTableFamily
, UNO_QUERY_THROW
);
552 Reference
< XNameReplace
> xDefaultTableStyle( xFactory
->createInstance(), UNO_QUERY_THROW
);
553 xTableFamily
->insertByName( OUString( rName
), Any( xDefaultTableStyle
) );
555 xDefaultTableStyle
->replaceByName( OUString( RTL_CONSTASCII_USTRINGPARAM("body") ), rBody
);
556 xDefaultTableStyle
->replaceByName( OUString( RTL_CONSTASCII_USTRINGPARAM("odd-rows") ), rBanding
);
557 xDefaultTableStyle
->replaceByName( OUString( RTL_CONSTASCII_USTRINGPARAM("odd-columns") ), rBanding
);
558 xDefaultTableStyle
->replaceByName( OUString( RTL_CONSTASCII_USTRINGPARAM("first-row") ), rHeading
);
559 xDefaultTableStyle
->replaceByName( OUString( RTL_CONSTASCII_USTRINGPARAM("first-column") ), rHeading
);
560 xDefaultTableStyle
->replaceByName( OUString( RTL_CONSTASCII_USTRINGPARAM("last-row") ), rHeading
);
561 xDefaultTableStyle
->replaceByName( OUString( RTL_CONSTASCII_USTRINGPARAM("last-column") ), rHeading
);
566 DBG_ERROR("sd::implCreateTableTemplate(), exception caught!");
570 void SdDrawDocument::CreateDefaultCellStyles()
572 SdStyleSheetPool
* pSSPool
= static_cast< SdStyleSheetPool
* >(GetStyleSheetPool());
573 SfxStyleSheetBase
* pSheet
= NULL
;
576 const OUString
sFamilyName( RTL_CONSTASCII_USTRINGPARAM( "table" ) );
577 Reference
< XNameContainer
> xTableFamily( pSSPool
->getByName( sFamilyName
), UNO_QUERY
);
579 // ---- Default -----------------------------------------------
581 sal_uInt16 nMask
= SFXSTYLEBIT_AUTO
;
583 OUString
aDefaultCellStyleName( RTL_CONSTASCII_USTRINGPARAM("default") );
585 pSheet
= &(pSSPool
->Make(aDefaultCellStyleName
, SD_STYLE_FAMILY_CELL
, nMask
));
586 pSheet
->SetHelpId( aHelpFile
, HID_SD_CELL_STYLE_DEFAULT
);
587 SfxItemSet
& rISet
= pSheet
->GetItemSet();
588 // SfxItemPool* pPool = rISet.GetPool();
592 Color
aNullCol(RGB_Color(COL_BLACK
));
595 XGradient
aNullGrad(aNullCol
,RGB_Color(COL_WHITE
));
596 aNullGrad
.SetStartIntens( 100 );
597 aNullGrad
.SetEndIntens( 100 );
598 XHatch
aNullHatch(aNullCol
);
600 rISet
.Put(XFillStyleItem(XFILL_SOLID
));
601 rISet
.Put(XFillColorItem(String(), RGB_Color(0x00ccccff)));
603 Font aLatinFont
, aCJKFont
, aCTLFont
;
605 getDefaultFonts( aLatinFont
, aCJKFont
, aCTLFont
);
607 SvxFontItem
aSvxFontItem( aLatinFont
.GetFamily(), aLatinFont
.GetName(), aLatinFont
.GetStyleName(), aLatinFont
.GetPitch(),
608 aLatinFont
.GetCharSet(), EE_CHAR_FONTINFO
);
610 SvxFontItem
aSvxFontItemCJK( aCJKFont
.GetFamily(), aCJKFont
.GetName(), aCJKFont
.GetStyleName(), aCJKFont
.GetPitch(),
611 aCJKFont
.GetCharSet(), EE_CHAR_FONTINFO_CJK
);
613 SvxFontItem
aSvxFontItemCTL( aCTLFont
.GetFamily(), aCTLFont
.GetName(), aCTLFont
.GetStyleName(), aCTLFont
.GetPitch(),
614 aCTLFont
.GetCharSet(), EE_CHAR_FONTINFO_CTL
);
616 rISet
.Put( aSvxFontItem
);
617 rISet
.Put( aSvxFontItemCJK
);
618 rISet
.Put( aSvxFontItemCTL
);
620 rISet
.Put( SvxFontHeightItem( 635, 100, EE_CHAR_FONTHEIGHT
) ); // sj: (i33745) changed default from 24 to 18 pt
621 rISet
.Put( SvxFontHeightItem( 635, 100, EE_CHAR_FONTHEIGHT_CJK
) ); // 18 pt
622 rISet
.Put( SvxFontHeightItem( convertFontHeightToCTL( 635 ), 100, EE_CHAR_FONTHEIGHT_CTL
) ); // 18 pt
624 // rISet.Put( SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT ) );
625 // rISet.Put( SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CJK ) );
626 // rISet.Put( SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CTL ) );
628 // rISet.Put( SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC ) );
629 // rISet.Put( SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CJK ) );
630 // rISet.Put( SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CTL ) );
632 // rISet.Put(SvxContourItem(sal_False, EE_CHAR_OUTLINE ));
633 // rISet.Put(SvxShadowedItem(sal_False, EE_CHAR_SHADOW ));
634 // rISet.Put(SvxUnderlineItem(UNDERLINE_NONE, EE_CHAR_UNDERLINE));
635 // rISet.Put(SvxOverlineItem(UNDERLINE_NONE, EE_CHAR_OVERLINE));
636 // rISet.Put(SvxCrossedOutItem(STRIKEOUT_NONE, EE_CHAR_STRIKEOUT ));
637 // rISet.Put(SvxEmphasisMarkItem(EMPHASISMARK_NONE, EE_CHAR_EMPHASISMARK));
638 // rISet.Put(SvxCharReliefItem(RELIEF_NONE, EE_CHAR_RELIEF));
639 rISet
.Put(SvxColorItem(Color(COL_AUTO
), EE_CHAR_COLOR
));
641 // Absatzattribute (Edit Engine)
642 rISet
.Put(SvxLRSpaceItem(EE_PARA_LRSPACE
));
643 rISet
.Put(SvxULSpaceItem(EE_PARA_ULSPACE
));
645 rISet
.Put( SdrTextLeftDistItem( 250 ) );
646 rISet
.Put( SdrTextRightDistItem( 250 ) );
647 rISet
.Put( SdrTextUpperDistItem( 130 ) );
648 rISet
.Put( SdrTextLowerDistItem( 130 ) );
650 rISet
.Put( SvxLineSpacingItem( LINE_SPACE_DEFAULT_HEIGHT
, EE_PARA_SBL
) );
651 rISet
.Put( SvxAutoKernItem( sal_True
, EE_CHAR_PAIRKERNING
) );
652 rISet
.Put( SdrTextVertAdjustItem(SDRTEXTVERTADJUST_TOP
) );
653 rISet
.Put( SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_LEFT
) );
655 Color
aWhite( COL_WHITE
);
656 SvxBorderLine
aBorderLine( &aWhite
, 1, 0, 0 );
658 SvxBoxItem
aBoxItem( SDRATTR_TABLE_BORDER
);
659 aBoxItem
.SetLine( &aBorderLine
, BOX_LINE_TOP
);
660 aBoxItem
.SetLine( &aBorderLine
, BOX_LINE_BOTTOM
);
661 aBoxItem
.SetLine( &aBorderLine
, BOX_LINE_LEFT
);
662 aBoxItem
.SetLine( &aBorderLine
, BOX_LINE_RIGHT
);
664 rISet
.Put( aBoxItem
);
666 Any
aDefaultCellStyle( Reference
< XStyle
>( static_cast< XWeak
* >( pSheet
), UNO_QUERY
) );
668 // ---- default --------------------------------------------------
670 Any
aBlue1( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("blue1") ), aDefaultCellStyleName
, RGB_COLORDATA(153,204,255)));
671 Any
aBlue2( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("blue2") ), aDefaultCellStyleName
, RGB_COLORDATA(0,153,255)));
672 Any
aBlue3( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("blue3") ), aDefaultCellStyleName
, RGB_COLORDATA(0,102,204)));
674 implCreateTableTemplate( xTableFamily
, OUString(RTL_CONSTASCII_USTRINGPARAM("default")), aBlue1
, aBlue3
, aBlue2
);
676 // ---- BW ------------------------------------------------
678 Any
aBW1( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("bw1") ), aDefaultCellStyleName
, RGB_COLORDATA(255,255,255)));
679 Any
aBW2( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("bw2") ), aDefaultCellStyleName
, RGB_COLORDATA(230,230,230)));
680 Any
aBW3( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("bw3") ), aDefaultCellStyleName
, RGB_COLORDATA(0,0,0)));
682 implCreateTableTemplate( xTableFamily
, OUString(RTL_CONSTASCII_USTRINGPARAM("bw") ), aBW1
, aBW3
, aBW2
);
684 // ---- Orange --------------------------------------------------
686 Any
aOrange1( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("orange1") ), aDefaultCellStyleName
, RGB_COLORDATA(255,204,153)));
687 Any
aOrange2( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("orange2") ), aDefaultCellStyleName
, RGB_COLORDATA(255,153,102)));
688 Any
aOrange3( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("orange3") ), aDefaultCellStyleName
, RGB_COLORDATA(255,102,51)));
690 implCreateTableTemplate( xTableFamily
, OUString(RTL_CONSTASCII_USTRINGPARAM("orange") ), aOrange1
, aOrange3
, aOrange2
);
692 // ---- Turquise --------------------------------------------------
694 Any
aTurquise1( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("turquise1") ), aDefaultCellStyleName
, RGB_COLORDATA(71,184,184)));
695 Any
aTurquise2( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("turquise2") ), aDefaultCellStyleName
, RGB_COLORDATA(51,163,163)));
696 Any
aTurquise3( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("turquise3") ), aDefaultCellStyleName
, RGB_COLORDATA(25,138,138)));
698 implCreateTableTemplate( xTableFamily
, OUString(RTL_CONSTASCII_USTRINGPARAM("turquise") ), aTurquise1
, aTurquise3
, aTurquise2
);
700 // ---- Gray ------------------------------------------------
702 Any
aGray1( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("gray1") ), aDefaultCellStyleName
, RGB_COLORDATA(230,230,230)));
703 Any
aGray2( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("gray2") ), aDefaultCellStyleName
, RGB_COLORDATA(204,204,204)));
704 Any
aGray3( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("gray3") ), aDefaultCellStyleName
, RGB_COLORDATA(179,179,179)));
706 implCreateTableTemplate( xTableFamily
, OUString(RTL_CONSTASCII_USTRINGPARAM("gray") ), aGray1
, aGray3
, aGray2
);
708 // ---- Sun ------------------------------------------------
710 Any
aSun1( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("sun1") ), aDefaultCellStyleName
, RGB_COLORDATA(230,230,255)));
711 Any
aSun2( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("sun2") ), aDefaultCellStyleName
, RGB_COLORDATA(204,204,255)));
712 Any
aSun3( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("sun3") ), aDefaultCellStyleName
, RGB_COLORDATA(153,153,255)));
714 implCreateTableTemplate( xTableFamily
, OUString(RTL_CONSTASCII_USTRINGPARAM("sun") ), aSun1
, aSun3
, aSun2
);
716 // ---- Earth ----------------------------------------------
718 Any
aEarth1( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("earth1") ), aDefaultCellStyleName
, RGB_COLORDATA(255,255,204)));
719 Any
aEarth2( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("earth2") ), aDefaultCellStyleName
, RGB_COLORDATA(255,204,153)));
720 Any
aEarth3( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("earth3") ), aDefaultCellStyleName
, RGB_COLORDATA(204,102,51)));
722 implCreateTableTemplate( xTableFamily
, OUString(RTL_CONSTASCII_USTRINGPARAM("earth") ), aEarth1
, aEarth3
, aEarth2
);
724 // ---- Green ----------------------------------------------
726 Any
aGreen1( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("green1") ), aDefaultCellStyleName
, RGB_COLORDATA(255,255,204)));
727 Any
aGreen2( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("green2") ), aDefaultCellStyleName
, RGB_COLORDATA(148,189,94)));
728 Any
aGreen3( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("green3") ), aDefaultCellStyleName
, RGB_COLORDATA(92,133,38)));
730 implCreateTableTemplate( xTableFamily
, OUString(RTL_CONSTASCII_USTRINGPARAM("green") ), aGreen1
, aGreen3
, aGreen2
);
732 // ---- Seetang ----------------------------------------------
734 Any
aSeetang1( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("seetang1") ), aDefaultCellStyleName
, RGB_COLORDATA(204,255,255)));
735 Any
aSeetang2( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("seetang2") ), aDefaultCellStyleName
, RGB_COLORDATA(71,184,184)));
736 Any
aSeetang3( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("seetang3") ), aDefaultCellStyleName
, RGB_COLORDATA(51,163,163)));
738 implCreateTableTemplate( xTableFamily
, OUString(RTL_CONSTASCII_USTRINGPARAM("seetang") ), aSeetang1
, aSeetang3
, aSeetang2
);
740 // ---- LightBlue ----------------------------------------------
742 Any
aLightBlue1( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("lightblue1") ), aDefaultCellStyleName
, RGB_COLORDATA(255,255,255)));
743 Any
aLightBlue2( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("lightblue2") ), aDefaultCellStyleName
, RGB_COLORDATA(230,230,255)));
744 Any
aLightBlue3( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("lightblue3") ), aDefaultCellStyleName
, RGB_COLORDATA(153,153,204)));
746 implCreateTableTemplate( xTableFamily
, OUString(RTL_CONSTASCII_USTRINGPARAM("lightblue") ), aLightBlue1
, aLightBlue3
, aLightBlue2
);
748 // ---- Yellow ----------------------------------------------
750 Any
aYellow1( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("yellow1") ), aDefaultCellStyleName
, RGB_COLORDATA(255,255,204)));
751 Any
aYellow2( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("yellow2") ), aDefaultCellStyleName
, RGB_COLORDATA(255,255,153)));
752 Any
aYellow3( implMakeSolidCellStyle( pSSPool
, OUString( RTL_CONSTASCII_USTRINGPARAM("yellow3") ), aDefaultCellStyleName
, RGB_COLORDATA(255,204,153)));
754 implCreateTableTemplate( xTableFamily
, OUString(RTL_CONSTASCII_USTRINGPARAM("yellow") ), aYellow1
, aYellow3
, aYellow2
);
757 /*************************************************************************
759 |* Anzahl der Seiten, die eine masterPage referenzieren
761 \************************************************************************/
763 sal_uInt16
SdDrawDocument::GetMasterPageUserCount(SdrPage
* pMaster
) const
765 sal_uInt16 nResult
= 0;
767 sal_uInt16 nPageCount
= GetPageCount();
769 for (nPage
= 0; nPage
< nPageCount
; nPage
++)
771 const SdrPage
* pPage
= GetPage(nPage
);
773 if(pPage
->TRG_HasMasterPage())
775 if(&(pPage
->TRG_GetMasterPage()) == pMaster
)
785 /*************************************************************************
787 |* OnlineSpelling im Hintergrund beenden
789 \************************************************************************/
791 void SdDrawDocument::StopOnlineSpelling()
793 if (mpOnlineSpellingTimer
&& mpOnlineSpellingTimer
->IsActive())
795 mpOnlineSpellingTimer
->Stop();
798 delete mpOnlineSpellingTimer
;
799 mpOnlineSpellingTimer
= NULL
;
801 delete mpOnlineSpellingList
;
802 mpOnlineSpellingList
= NULL
;
805 /*************************************************************************
807 |* OnlineSpelling im Hintergrund starten
809 \************************************************************************/
811 void SdDrawDocument::StartOnlineSpelling(sal_Bool bForceSpelling
)
813 if (mbOnlineSpell
&& (bForceSpelling
|| mbInitialOnlineSpellingEnabled
) &&
814 mpDocSh
&& !mpDocSh
->IsReadOnly() )
816 StopOnlineSpelling();
818 ::sd::Outliner
* pOutl
= GetInternalOutliner(sal_True
);
820 Reference
< XSpellChecker1
> xSpellChecker( LinguMgr::GetSpellChecker() );
821 if ( xSpellChecker
.is() )
822 pOutl
->SetSpeller( xSpellChecker
);
824 Reference
< XHyphenator
> xHyphenator( LinguMgr::GetHyphenator() );
825 if( xHyphenator
.is() )
826 pOutl
->SetHyphenator( xHyphenator
);
828 pOutl
->SetDefaultLanguage( meLanguage
);
830 mpOnlineSpellingList
= new ShapeList
;
833 for ( nPage
= 0; nPage
< GetPageCount(); nPage
++ )
835 // Alle Pages durchsuchen
836 FillOnlineSpellingList((SdPage
*) GetPage(nPage
));
839 for (nPage
= 0; nPage
< GetMasterPageCount(); nPage
++)
841 // Alle MasterPages durchsuchen
842 FillOnlineSpellingList((SdPage
*) GetMasterPage(nPage
));
845 mpOnlineSpellingList
->seekShape(0);
846 mpOnlineSpellingTimer
= new Timer();
847 mpOnlineSpellingTimer
->SetTimeoutHdl( LINK(this, SdDrawDocument
, OnlineSpellingHdl
) );
848 mpOnlineSpellingTimer
->SetTimeout(250);
849 mpOnlineSpellingTimer
->Start();
853 /*************************************************************************
855 |* OnlineSpelling-Liste fuellen
857 \************************************************************************/
859 void SdDrawDocument::FillOnlineSpellingList(SdPage
* pPage
)
861 SdrObject
* pObj
= NULL
;
862 SdrObjListIter
aIter(*pPage
, IM_FLAT
);
864 while (aIter
.IsMore())
871 if (pObj
->GetOutlinerParaObject())
873 // Textobjekt gefunden
874 mpOnlineSpellingList
->addShape(*pObj
);
876 else if (pObj
->GetObjIdentifier() == OBJ_GRUP
)
878 // Gruppenobjekt gefunden
879 SdrObjListIter
aGroupIter(*((SdrObjGroup
*)pObj
)->GetSubList(),
882 sal_Bool bSubTextObjFound
= sal_False
;
884 while (aGroupIter
.IsMore() && !bSubTextObjFound
)
886 if (aGroupIter
.Next()->GetOutlinerParaObject())
888 // Textobjekt im Gruppenobjekt gefunden
889 bSubTextObjFound
= sal_True
;
893 if (bSubTextObjFound
)
895 mpOnlineSpellingList
->addShape(*pObj
);
901 /*************************************************************************
903 |* OnlineSpelling im Hintergrund
905 \************************************************************************/
907 IMPL_LINK(SdDrawDocument
, OnlineSpellingHdl
, Timer
*, EMPTYARG
)
909 if (mpOnlineSpellingList
!=NULL
910 && ( !mbOnlineSpell
|| mpOnlineSpellingList
->hasMore()))
912 /**********************************************************************
913 * Naechstes Objekt spellen
914 **********************************************************************/
915 SdrObject
* pObj
= mpOnlineSpellingList
->getNextShape();
919 if (pObj
->GetOutlinerParaObject() && pObj
->ISA(SdrTextObj
))
921 // Textobjekt spellen
922 SpellObject((SdrTextObj
*) pObj
);
924 else if (pObj
->GetObjIdentifier() == OBJ_GRUP
)
926 // Gruppenobjekt gefunden
927 SdrObjListIter
aGroupIter(*((SdrObjGroup
*)pObj
)->GetSubList(),
930 SdrObject
* pSubObj
= NULL
;
932 while (aGroupIter
.IsMore())
934 pSubObj
= aGroupIter
.Next();
936 if (pSubObj
->GetOutlinerParaObject() && pSubObj
->ISA(SdrTextObj
))
938 // Textobjekt im Gruppenobjekt gefunden
939 SpellObject((SdrTextObj
*) pSubObj
);
946 mpOnlineSpellingTimer
->Start();
950 // Spelling wurde initial durchgefuehrt
951 mbInitialOnlineSpellingEnabled
= sal_False
;
954 StopOnlineSpelling();
956 delete mpOnlineSearchItem
;
957 mpOnlineSearchItem
= NULL
;
963 /*************************************************************************
965 |* Objekt spellen (fuer OnlineSpelling)
967 \************************************************************************/
969 void SdDrawDocument::SpellObject(SdrTextObj
* pObj
)
971 if (pObj
&& pObj
->GetOutlinerParaObject() /* && pObj != pView->GetTextEditObject() */)
973 mbHasOnlineSpellErrors
= sal_False
;
974 ::sd::Outliner
* pOutl
= GetInternalOutliner(sal_True
);
975 pOutl
->SetUpdateMode(sal_True
);
976 Link aEvtHdl
= pOutl
->GetStatusEventHdl();
977 pOutl
->SetStatusEventHdl(LINK(this, SdDrawDocument
, OnlineSpellEventHdl
));
979 sal_uInt16 nOldOutlMode
= pOutl
->GetMode();
980 sal_uInt16 nOutlMode
= OUTLINERMODE_TEXTOBJECT
;
981 if (((SdrTextObj
*) pObj
)->GetObjInventor() == SdrInventor
&&
982 ((SdrTextObj
*) pObj
)->GetObjIdentifier() == OBJ_OUTLINETEXT
)
984 nOutlMode
= OUTLINERMODE_OUTLINEOBJECT
;
986 pOutl
->Init( nOutlMode
);
988 // Text in den Outliner setzen
989 pOutl
->SetText(*((SdrTextObj
*) pObj
)->GetOutlinerParaObject());
991 if (!mpOnlineSearchItem
|| pOutl
->HasText(*mpOnlineSearchItem
))
994 pOutl
->CompleteOnlineSpelling();
996 if (mbHasOnlineSpellErrors
)
998 sd::ModifyGuard
aGuard( this );
999 SdrModel
* pModel
= pObj
->GetModel();
1000 sal_Bool bLock
= sal_False
;
1003 bLock
= pModel
->isLocked();
1004 pModel
->setLock( sal_True
);
1006 // taking text from the outliner
1007 ((SdrTextObj
*) pObj
)->SetOutlinerParaObject( pOutl
->CreateParaObject() );
1009 pObj
->BroadcastObjectChange();
1011 pModel
->setLock( bLock
);
1015 pOutl
->SetStatusEventHdl(aEvtHdl
);
1016 pOutl
->SetUpdateMode(sal_False
);
1017 pOutl
->Init( nOldOutlMode
);
1018 mbHasOnlineSpellErrors
= sal_False
;
1022 /*************************************************************************
1024 |* Objekt wurde ins Model eingefuegt
1026 \************************************************************************/
1027 void SdDrawDocument::InsertObject(SdrObject
* pObj
, SdPage
* /*pPage*/)
1029 if(mpOnlineSpellingList
&& pObj
)
1031 if (pObj
->GetOutlinerParaObject() || (pObj
->GetObjIdentifier() == OBJ_GRUP
))
1033 // Objekt in OnlineSpelling-Liste aufnehmen
1034 mpOnlineSpellingList
->addShape(*pObj
);
1039 /*************************************************************************
1041 |* Objekt wurde aus dem Model entfernt
1043 \************************************************************************/
1044 void SdDrawDocument::RemoveObject(SdrObject
* pObj
, SdPage
* /*pPage*/)
1046 if(mpOnlineSpellingList
&& pObj
)
1048 if (pObj
->GetOutlinerParaObject() || (pObj
->GetObjIdentifier() == OBJ_GRUP
))
1050 // Objekt in OnlineSpelling-Liste durch NULL-Pointer ersetzt
1051 mpOnlineSpellingList
->removeShape(*pObj
);
1056 /*************************************************************************
1058 |* Callback fuer ExecuteSpellPopup()
1060 \************************************************************************/
1061 IMPL_LINK(SdDrawDocument
, OnlineSpellEventHdl
, EditStatus
*, pEditStat
)
1063 sal_uLong nStat
= pEditStat
->GetStatusWord();
1064 mbHasOnlineSpellErrors
= (nStat
& EE_STAT_WRONGWORDCHANGED
) != 0;
1069 /*************************************************************************
1071 |* Callback fuer ExecuteSpellPopup()
1073 \************************************************************************/
1075 // #91457# removed link and replaced with Imp method
1076 void SdDrawDocument::ImpOnlineSpellCallback(SpellCallbackInfo
* pInfo
, SdrObject
* pObj
, SdrOutliner
* pOutl
)
1078 delete mpOnlineSearchItem
;
1079 mpOnlineSearchItem
= NULL
;
1081 sal_uInt16 nCommand
= pInfo
->nCommand
;
1083 if (nCommand
== SPELLCMD_IGNOREWORD
1084 // #91457# restart when add to dictionary takes place, too.
1085 || nCommand
== SPELLCMD_ADDTODICTIONARY
)
1087 if(pObj
&& pOutl
&& pObj
->ISA(SdrTextObj
))
1089 sal_Bool
bModified(IsChanged());
1090 ((SdrTextObj
*)pObj
)->SetOutlinerParaObject(pOutl
->CreateParaObject());
1091 SetChanged(bModified
);
1092 pObj
->BroadcastObjectChange();
1095 mpOnlineSearchItem
= new SvxSearchItem( SID_SEARCH_ITEM
);
1096 mpOnlineSearchItem
->SetSearchString(pInfo
->aWord
);
1097 StartOnlineSpelling();
1099 else if (nCommand
== SPELLCMD_STARTSPELLDLG
)
1101 SfxViewFrame::Current()->GetDispatcher()->Execute( SID_SPELL_DIALOG
,
1102 SFX_CALLMODE_ASYNCHRON
);
1106 /*************************************************************************
1108 |* Eindeutige Namen der StandardLayer durch sprachabhaengige Namen ersetzen
1110 \************************************************************************/
1111 void SdDrawDocument::RestoreLayerNames()
1113 SdrLayerAdmin
& rLayerAdmin
= GetLayerAdmin();
1114 sal_uInt16 nLayerCount
= rLayerAdmin
.GetLayerCount();
1116 for (sal_uInt16 nLayer
= 0; nLayer
< nLayerCount
; nLayer
++)
1118 SdrLayer
* pLayer
= rLayerAdmin
.GetLayer(nLayer
);
1122 String
aLayerName(pLayer
->GetName());
1124 if (aLayerName
.EqualsAscii( "LAYER_LAYOUT" ))
1126 pLayer
->SetName(String(SdResId(STR_LAYER_LAYOUT
)));
1128 else if (aLayerName
.EqualsAscii( "LAYER_BCKGRND" ))
1130 pLayer
->SetName(String(SdResId(STR_LAYER_BCKGRND
)));
1132 else if (aLayerName
.EqualsAscii( "LAYER_BACKGRNDOBJ" ))
1134 pLayer
->SetName(String(SdResId(STR_LAYER_BCKGRNDOBJ
)));
1136 else if (aLayerName
.EqualsAscii( "LAYER_CONTROLS" ))
1138 pLayer
->SetName(String(SdResId(STR_LAYER_CONTROLS
)));
1140 else if (aLayerName
.EqualsAscii( "LAYER_MEASURELINES" ))
1142 pLayer
->SetName(String(SdResId(STR_LAYER_MEASURELINES
)));
1148 /*************************************************************************
1150 |* Formatierte Seitennummer zurueckgeben (1, I, i, a, usw.)
1152 \************************************************************************/
1154 String
SdDrawDocument::CreatePageNumValue(sal_uInt16 nNum
) const
1156 String aPageNumValue
;
1157 sal_Bool bUpper
= sal_False
;
1159 switch (mePageNumType
)
1161 case SVX_CHARS_UPPER_LETTER
:
1162 aPageNumValue
+= (sal_Unicode
)(char)((nNum
- 1) % 26 + 'A');
1164 case SVX_CHARS_LOWER_LETTER
:
1165 aPageNumValue
+= (sal_Unicode
)(char)((nNum
- 1) % 26 + 'a');
1167 case SVX_ROMAN_UPPER
:
1169 case SVX_ROMAN_LOWER
:
1170 aPageNumValue
+= SvxNumberFormat::CreateRomanString(nNum
, bUpper
);
1172 case SVX_NUMBER_NONE
:
1173 aPageNumValue
.Erase();
1174 aPageNumValue
+= sal_Unicode(' ');
1177 aPageNumValue
+= String::CreateFromInt32( (sal_Int32
)nNum
);
1180 return(aPageNumValue
);
1185 /*************************************************************************
1187 |* Layout-Template umbenennen
1188 |* Zu beachten ist, das rOldLayoutName im Gegensatz zu rNewName den
1189 |* kompletten Layout(!)-Namen enthaelt (inkl. ~LT~)!
1191 \************************************************************************/
1193 void SdDrawDocument::RenameLayoutTemplate(const String
& rOldLayoutName
, const String
& rNewName
)
1195 String
aOldName(rOldLayoutName
);
1196 sal_uInt16 nPos
= aOldName
.SearchAscii( SD_LT_SEPARATOR
);
1198 // erase everything after '~LT~'
1199 aOldName
.Erase(nPos
+ sizeof(SD_LT_SEPARATOR
) - 1 );
1200 sal_uInt16 nLen
= aOldName
.Len();
1203 SfxStyleSheetIterator
aIter(mxStyleSheetPool
.get(), SD_STYLE_FAMILY_MASTERPAGE
);
1204 SfxStyleSheetBase
* pSheet
= aIter
.First();
1208 String aSheetName
= pSheet
->GetName();
1210 // if the sheetname starts with aOldName + "~LT~"
1211 if (aSheetName
.Match(aOldName
) == nLen
)
1213 aSheetName
.Erase(0, nLen
- sizeof(SD_LT_SEPARATOR
) + 1 );
1214 aSheetName
.Insert(rNewName
, 0);
1216 StyleReplaceData
* pReplData
= new StyleReplaceData
;
1217 pReplData
->nFamily
= pSheet
->GetFamily();
1218 pReplData
->nNewFamily
= pSheet
->GetFamily();
1219 pReplData
->aName
= pSheet
->GetName();
1220 pReplData
->aNewName
= aSheetName
;
1221 aReplList
.Insert(pReplData
, LIST_APPEND
);
1223 pSheet
->SetName(aSheetName
);
1226 pSheet
= aIter
.Next();
1229 // jetzt noch den Layoutnamen der Zeichen- und der Notizseite
1230 // sowie ihrer Masterpages setzen
1231 String
aPageLayoutName(rNewName
);
1232 aPageLayoutName
.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR
));
1233 aPageLayoutName
+= String(SdResId(STR_LAYOUT_OUTLINE
));
1235 // an allen Seiten, die das jetzt umbeannte Layout benutzen, die
1236 // Textobjekte von der Aenderung unterrichten und Layoutnamen setzen
1238 for (nPage
= 0; nPage
< GetPageCount(); nPage
++)
1240 SdPage
* pPage
= (SdPage
*) GetPage(nPage
);
1241 String
aTemp(pPage
->GetLayoutName());
1243 if (aTemp
== rOldLayoutName
)
1245 pPage
->SetLayoutName(aPageLayoutName
);
1247 for (sal_uLong nObj
= 0; nObj
< pPage
->GetObjCount(); nObj
++)
1249 SdrObject
* pObj
= pPage
->GetObj(nObj
);
1251 if (pObj
->GetObjInventor() == SdrInventor
)
1253 switch( pObj
->GetObjIdentifier() )
1256 case OBJ_OUTLINETEXT
:
1259 OutlinerParaObject
* pOPO
= ((SdrTextObj
*) pObj
)->GetOutlinerParaObject();
1263 StyleReplaceData
* pReplData
= (StyleReplaceData
*) aReplList
.First();
1267 pOPO
->ChangeStyleSheets( pReplData
->aName
, pReplData
->nFamily
, pReplData
->aNewName
, pReplData
->nNewFamily
);
1268 pReplData
= (StyleReplaceData
*) aReplList
.Next();
1282 // und nochmal fuer die Masterpages
1283 // die betroffenen Masterpages erhalten als Seitennamen den Namen
1285 for (nPage
= 0; nPage
< GetMasterPageCount(); nPage
++)
1287 SdPage
* pPage
= (SdPage
*) GetMasterPage(nPage
);
1288 String
aTemp(pPage
->GetLayoutName());
1290 if (aTemp
== rOldLayoutName
)
1292 pPage
->SetLayoutName(aPageLayoutName
);
1293 pPage
->SetName(rNewName
);
1295 for (sal_uLong nObj
= 0; nObj
< pPage
->GetObjCount(); nObj
++)
1297 SdrObject
* pObj
= pPage
->GetObj(nObj
);
1299 if (pObj
->GetObjInventor() == SdrInventor
)
1301 switch(pObj
->GetObjIdentifier())
1304 case OBJ_OUTLINETEXT
:
1307 OutlinerParaObject
* pOPO
= ((SdrTextObj
*)pObj
)->GetOutlinerParaObject();
1311 StyleReplaceData
* pReplData
= (StyleReplaceData
*) aReplList
.First();
1315 pOPO
->ChangeStyleSheets( pReplData
->aName
, pReplData
->nFamily
, pReplData
->aNewName
, pReplData
->nNewFamily
);
1316 pReplData
= (StyleReplaceData
*) aReplList
.Next();
1331 /*************************************************************************
1333 |* Outliner-Defaults setzen (Pool-Defaults)
1335 \************************************************************************/
1336 void SdDrawDocument::SetTextDefaults() const
1338 // BulletItem und BulletFont fuer Titel und Gliederung
1339 SvxBulletItem
aBulletItem(EE_PARA_BULLET
);
1340 Font
aBulletFont( static_cast<SdStyleSheetPool
*>( mxStyleSheetPool
.get())->GetBulletFont() );
1341 aBulletFont
.SetSize(Size(0,846)); // 24 pt
1342 aBulletItem
.SetFont(aBulletFont
);
1343 aBulletItem
.SetStyle(BS_BULLET
);
1344 aBulletItem
.SetStart(1);
1345 aBulletItem
.SetScale(45); // in Prozent
1346 aBulletItem
.SetSymbol( 0x25CF ); // Punkt
1347 pItemPool
->SetPoolDefaultItem( aBulletItem
);
1349 // Bullets nicht sichtbar
1350 // SfxUInt16Item aBulletStateItem(EE_PARA_BULLETSTATE, 0);
1351 // pItemPool->SetPoolDefaultItem( aBulletStateItem );
1354 SvxNumberFormat
aNumberFormat(SVX_NUM_CHAR_SPECIAL
);
1355 aNumberFormat
.SetBulletFont(&aBulletFont
);
1356 aNumberFormat
.SetBulletChar( 0x25CF ); // StarBats: 0xF000 + 34
1357 aNumberFormat
.SetBulletRelSize(45);
1358 aNumberFormat
.SetBulletColor(Color(COL_AUTO
));
1359 aNumberFormat
.SetStart(1);
1360 aNumberFormat
.SetNumAdjust(SVX_ADJUST_LEFT
);
1362 SvxNumRule
aNumRule( NUM_BULLET_REL_SIZE
|NUM_BULLET_COLOR
|NUM_CHAR_TEXT_DISTANCE
, 10, sal_False
);
1364 aNumberFormat
.SetLSpace( 0 );
1365 aNumberFormat
.SetAbsLSpace( 0 );
1366 aNumberFormat
.SetFirstLineOffset( 0 );
1367 aNumRule
.SetLevel( 0, aNumberFormat
);
1369 for( sal_uInt16 i
= 1; i
< aNumRule
.GetLevelCount(); i
++ )
1371 const short nLSpace
= (i
+ 1) * 600;
1372 aNumberFormat
.SetLSpace(nLSpace
);
1373 aNumberFormat
.SetAbsLSpace(nLSpace
);
1374 aNumberFormat
.SetFirstLineOffset(-600);
1375 aNumRule
.SetLevel( i
, aNumberFormat
);
1378 SvxNumBulletItem
aNumBulletItem( aNumRule
, EE_PARA_NUMBULLET
);
1379 pItemPool
->SetPoolDefaultItem( aNumBulletItem
);
1382 /*************************************************************************
1386 \************************************************************************/
1388 ::com::sun::star::text::WritingMode
SdDrawDocument::GetDefaultWritingMode() const
1390 const SfxPoolItem
* pItem
= ( pItemPool
? pItemPool
->GetPoolDefaultItem( EE_PARA_WRITINGDIR
) : NULL
);
1391 ::com::sun::star::text::WritingMode eRet
= ::com::sun::star::text::WritingMode_LR_TB
;
1395 switch( ( (SvxFrameDirectionItem
&)( *pItem
) ).GetValue() )
1397 case( FRMDIR_HORI_LEFT_TOP
): eRet
= ::com::sun::star::text::WritingMode_LR_TB
; break;
1398 case( FRMDIR_HORI_RIGHT_TOP
): eRet
= ::com::sun::star::text::WritingMode_RL_TB
; break;
1399 case( FRMDIR_VERT_TOP_RIGHT
): eRet
= ::com::sun::star::text::WritingMode_TB_RL
; break;
1402 DBG_ERROR( "Frame direction not supported yet" );
1410 void SdDrawDocument::SetDefaultWritingMode(::com::sun::star::text::WritingMode eMode
)
1414 SvxFrameDirection nVal
;
1417 case ::com::sun::star::text::WritingMode_LR_TB
: nVal
= FRMDIR_HORI_LEFT_TOP
; break;
1418 case ::com::sun::star::text::WritingMode_RL_TB
: nVal
= FRMDIR_HORI_RIGHT_TOP
; break;
1419 case ::com::sun::star::text::WritingMode_TB_RL
: nVal
= FRMDIR_VERT_TOP_RIGHT
; break;
1421 DBG_ERROR( "Frame direction not supported yet" );
1425 SvxFrameDirectionItem
aModeItem( nVal
, EE_PARA_WRITINGDIR
);
1426 pItemPool
->SetPoolDefaultItem( aModeItem
);
1428 SvxAdjustItem
aAdjust( SVX_ADJUST_LEFT
, EE_PARA_JUST
);
1430 if( eMode
== ::com::sun::star::text::WritingMode_RL_TB
)
1431 aAdjust
.SetEnumValue( SVX_ADJUST_RIGHT
);
1433 pItemPool
->SetPoolDefaultItem( aAdjust
);
1439 void SdDrawDocument::getDefaultFonts( Font
& rLatinFont
, Font
& rCJKFont
, Font
& rCTLFont
)
1441 LanguageType eLatin
= GetLanguage( EE_CHAR_LANGUAGE
);
1443 // #108374# / #107782#: If the UI language is Korean, the default Latin font has to
1444 // be queried for Korean, too (the Latin language from the document can't be Korean).
1445 // This is the same logic as in SwDocShell::InitNew.
1446 LanguageType eUiLanguage
= Application::GetSettings().GetUILanguage();
1447 switch( eUiLanguage
)
1449 case LANGUAGE_KOREAN
:
1450 case LANGUAGE_KOREAN_JOHAB
:
1451 eLatin
= eUiLanguage
;
1455 rLatinFont
= OutputDevice::GetDefaultFont( DEFAULTFONT_LATIN_PRESENTATION
, eLatin
, DEFAULTFONT_FLAGS_ONLYONE
);
1456 rCJKFont
= OutputDevice::GetDefaultFont( DEFAULTFONT_CJK_PRESENTATION
, GetLanguage( EE_CHAR_LANGUAGE_CJK
), DEFAULTFONT_FLAGS_ONLYONE
);
1457 rCTLFont
= OutputDevice::GetDefaultFont( DEFAULTFONT_CTL_PRESENTATION
, GetLanguage( EE_CHAR_LANGUAGE_CTL
), DEFAULTFONT_FLAGS_ONLYONE
) ;
1460 /* converts the given western font height to a corresponding ctl font height, deppending on the system language */
1461 sal_uInt32
SdDrawDocument::convertFontHeightToCTL( sal_uInt32 nWesternFontHeight
)
1463 LanguageType eRealCTLLanguage
= Application::GetSettings().GetLanguage();
1464 if( LANGUAGE_THAI
== eRealCTLLanguage
)
1466 // http://specs.openoffice.org/g11n/font_sizes/42775_42725_Individual_configurable_font_size_for_default_fonts.odt
1467 double fTemp
= double(nWesternFontHeight
) * 1.333;
1468 nWesternFontHeight
= (sal_uInt32
)fTemp
;
1469 // make some nice values for UI that displays PT instead of 1/100th mm
1470 nWesternFontHeight
= ((nWesternFontHeight
* 72) + 1270) / 2540L;
1471 nWesternFontHeight
= ((nWesternFontHeight
* 2540L) + 36) / 72;
1473 return nWesternFontHeight
;
1476 SdStyleSheetPool
* SdDrawDocument::GetSdStyleSheetPool() const
1478 return dynamic_cast< SdStyleSheetPool
* >( GetStyleSheetPool() );
1481 ModifyGuard::ModifyGuard( SdDrawDocument
* pDoc
)
1482 : mpDocShell( 0 ), mpDoc( pDoc
)
1487 void ModifyGuard::init()
1491 mpDoc
= mpDocShell
->GetDoc();
1495 mpDocShell
= mpDoc
->GetDocSh();
1498 mbIsEnableSetModified
= mpDocShell
? mpDocShell
->IsEnableSetModified() : sal_False
;
1499 mbIsDocumentChanged
= mpDoc
? mpDoc
->IsChanged() : sal_False
;
1501 if( mbIsEnableSetModified
)
1502 mpDocShell
->EnableSetModified( sal_False
);
1505 ModifyGuard::~ModifyGuard()
1507 if( mbIsEnableSetModified
)
1508 mpDocShell
->EnableSetModified( sal_True
);
1510 if( mpDoc
&& (mpDoc
->IsChanged() != mbIsDocumentChanged
) )
1511 mpDoc
->SetChanged(mbIsDocumentChanged
);