xref: /aoo41x/main/sd/source/ui/func/futempl.cxx (revision cdf0e10c)
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 
32*cdf0e10cSrcweir #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
33*cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
34*cdf0e10cSrcweir #include <com/sun/star/container/XNameAccess.hpp>
35*cdf0e10cSrcweir 
36*cdf0e10cSrcweir #include "futempl.hxx"
37*cdf0e10cSrcweir 
38*cdf0e10cSrcweir #include <editeng/editdata.hxx>
39*cdf0e10cSrcweir #include <editeng/bulitem.hxx>
40*cdf0e10cSrcweir #include <svx/svxids.hrc>   // fuer SID_OBJECT_SELECT
41*cdf0e10cSrcweir #include <sfx2/bindings.hxx>
42*cdf0e10cSrcweir #include <svl/aeitem.hxx>
43*cdf0e10cSrcweir #include <sfx2/dispatch.hxx>
44*cdf0e10cSrcweir #include <vcl/msgbox.hxx>
45*cdf0e10cSrcweir #include <editeng/eeitem.hxx>
46*cdf0e10cSrcweir #include <sfx2/request.hxx>
47*cdf0e10cSrcweir #include <editeng/numitem.hxx>
48*cdf0e10cSrcweir #include <editeng/editeng.hxx>
49*cdf0e10cSrcweir #include <editeng/lrspitem.hxx>
50*cdf0e10cSrcweir #include <svx/svdopage.hxx>
51*cdf0e10cSrcweir #include <svx/svditer.hxx>
52*cdf0e10cSrcweir #include <svx/sdr/properties/properties.hxx>
53*cdf0e10cSrcweir 
54*cdf0e10cSrcweir #include <sfx2/viewfrm.hxx>
55*cdf0e10cSrcweir #include <svx/xlndsit.hxx>
56*cdf0e10cSrcweir #include <svx/xlnstit.hxx>
57*cdf0e10cSrcweir #include <svx/xlnedit.hxx>
58*cdf0e10cSrcweir #include "app.hrc"
59*cdf0e10cSrcweir #include "stlsheet.hxx"
60*cdf0e10cSrcweir #include "sdpage.hxx"
61*cdf0e10cSrcweir #include "stlpool.hxx"
62*cdf0e10cSrcweir #include "app.hxx"
63*cdf0e10cSrcweir #include "View.hxx"
64*cdf0e10cSrcweir #ifndef SD_WINDOW_SHELL_HXX
65*cdf0e10cSrcweir #include "Window.hxx"
66*cdf0e10cSrcweir #endif
67*cdf0e10cSrcweir #include "drawview.hxx"
68*cdf0e10cSrcweir #include "drawdoc.hxx"
69*cdf0e10cSrcweir #include "DrawDocShell.hxx"
70*cdf0e10cSrcweir #include "DrawViewShell.hxx"
71*cdf0e10cSrcweir #include "ViewShell.hxx"
72*cdf0e10cSrcweir #include "res_bmp.hrc"
73*cdf0e10cSrcweir #include "glob.hrc"
74*cdf0e10cSrcweir #include "prlayout.hxx"         // enum PresentationObjects
75*cdf0e10cSrcweir #include "prltempl.hrc"         // TAB_PRES_LAYOUT_TEMPLATE_x
76*cdf0e10cSrcweir #include <svx/tabarea.hxx>
77*cdf0e10cSrcweir #include "sdresid.hxx"
78*cdf0e10cSrcweir #include "OutlineViewShell.hxx"
79*cdf0e10cSrcweir #include "strings.hrc"
80*cdf0e10cSrcweir #include "helpids.h"
81*cdf0e10cSrcweir #include "sdabstdlg.hxx"
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir using rtl::OUString;
84*cdf0e10cSrcweir using namespace com::sun::star::uno;
85*cdf0e10cSrcweir using namespace com::sun::star::container;
86*cdf0e10cSrcweir using namespace com::sun::star::beans;
87*cdf0e10cSrcweir using namespace com::sun::star::style;
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir namespace sd
90*cdf0e10cSrcweir {
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir TYPEINIT1( FuTemplate, FuPoor );
93*cdf0e10cSrcweir 
94*cdf0e10cSrcweir /*************************************************************************
95*cdf0e10cSrcweir |*
96*cdf0e10cSrcweir |* Konstruktor
97*cdf0e10cSrcweir |*
98*cdf0e10cSrcweir \************************************************************************/
99*cdf0e10cSrcweir 
100*cdf0e10cSrcweir FuTemplate::FuTemplate (
101*cdf0e10cSrcweir     ViewShell* pViewSh,
102*cdf0e10cSrcweir     ::sd::Window* pWin,
103*cdf0e10cSrcweir     ::sd::View* pView,
104*cdf0e10cSrcweir     SdDrawDocument* pDoc,
105*cdf0e10cSrcweir     SfxRequest& rReq )
106*cdf0e10cSrcweir     : FuPoor( pViewSh, pWin, pView, pDoc, rReq )
107*cdf0e10cSrcweir {
108*cdf0e10cSrcweir }
109*cdf0e10cSrcweir 
110*cdf0e10cSrcweir FunctionReference FuTemplate::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq )
111*cdf0e10cSrcweir {
112*cdf0e10cSrcweir 	FunctionReference xFunc( new FuTemplate( pViewSh, pWin, pView, pDoc, rReq ) );
113*cdf0e10cSrcweir 	xFunc->DoExecute(rReq);
114*cdf0e10cSrcweir 	return xFunc;
115*cdf0e10cSrcweir }
116*cdf0e10cSrcweir 
117*cdf0e10cSrcweir void FuTemplate::DoExecute( SfxRequest& rReq )
118*cdf0e10cSrcweir {
119*cdf0e10cSrcweir 	const SfxItemSet* pArgs = rReq.GetArgs();
120*cdf0e10cSrcweir 	sal_uInt16 nSId = rReq.GetSlot();
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir 	// StyleSheet-Parameter holen
123*cdf0e10cSrcweir 	SfxStyleSheetBasePool* pSSPool = mpDoc->GetDocSh()->GetStyleSheetPool();
124*cdf0e10cSrcweir 	SfxStyleSheetBase* pStyleSheet = NULL;
125*cdf0e10cSrcweir 
126*cdf0e10cSrcweir 	const SfxPoolItem* pItem;
127*cdf0e10cSrcweir     sal_uInt16 nFamily = USHRT_MAX;
128*cdf0e10cSrcweir     if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( SID_STYLE_FAMILY,
129*cdf0e10cSrcweir         sal_False, &pItem ))
130*cdf0e10cSrcweir     {
131*cdf0e10cSrcweir         nFamily = ( (const SfxUInt16Item &) pArgs->Get( SID_STYLE_FAMILY ) ).GetValue();
132*cdf0e10cSrcweir     }
133*cdf0e10cSrcweir     else
134*cdf0e10cSrcweir     if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( SID_STYLE_FAMILYNAME,
135*cdf0e10cSrcweir         sal_False, &pItem ))
136*cdf0e10cSrcweir     {
137*cdf0e10cSrcweir         String sFamily = ( (const SfxStringItem &) pArgs->Get( SID_STYLE_FAMILYNAME ) ).GetValue();
138*cdf0e10cSrcweir         if (sFamily.CompareToAscii("graphics") == COMPARE_EQUAL)
139*cdf0e10cSrcweir             nFamily = SD_STYLE_FAMILY_GRAPHICS;
140*cdf0e10cSrcweir 		else
141*cdf0e10cSrcweir 			nFamily = SD_STYLE_FAMILY_PSEUDO;
142*cdf0e10cSrcweir     }
143*cdf0e10cSrcweir 
144*cdf0e10cSrcweir 	String aStyleName;
145*cdf0e10cSrcweir 	sal_uInt16 nRetMask = 0xffff;
146*cdf0e10cSrcweir 
147*cdf0e10cSrcweir 	switch( nSId )
148*cdf0e10cSrcweir 	{
149*cdf0e10cSrcweir 		case SID_STYLE_APPLY:
150*cdf0e10cSrcweir 		case SID_STYLE_EDIT:
151*cdf0e10cSrcweir 		case SID_STYLE_DELETE:
152*cdf0e10cSrcweir 		case SID_STYLE_FAMILY:
153*cdf0e10cSrcweir 		case SID_STYLE_NEW_BY_EXAMPLE:
154*cdf0e10cSrcweir 		{
155*cdf0e10cSrcweir             SFX_REQUEST_ARG( rReq, pNameItem, SfxStringItem, SID_APPLY_STYLE, sal_False );
156*cdf0e10cSrcweir             SFX_REQUEST_ARG( rReq, pFamilyItem, SfxStringItem, SID_STYLE_FAMILYNAME, sal_False );
157*cdf0e10cSrcweir             if ( pFamilyItem && pNameItem )
158*cdf0e10cSrcweir             {
159*cdf0e10cSrcweir                 try
160*cdf0e10cSrcweir                 {
161*cdf0e10cSrcweir 					Reference< XStyleFamiliesSupplier > xModel(mpDoc->GetDocSh()->GetModel(), UNO_QUERY_THROW );
162*cdf0e10cSrcweir                     Reference< XNameAccess > xCont( xModel->getStyleFamilies() );
163*cdf0e10cSrcweir                     Reference< XNameAccess > xStyles( xCont->getByName(pFamilyItem->GetValue()), UNO_QUERY_THROW );
164*cdf0e10cSrcweir                     Reference< XPropertySet > xInfo( xStyles->getByName( pNameItem->GetValue() ), UNO_QUERY_THROW );
165*cdf0e10cSrcweir 
166*cdf0e10cSrcweir 					OUString aUIName;
167*cdf0e10cSrcweir                     xInfo->getPropertyValue( ::rtl::OUString::createFromAscii("DisplayName") ) >>= aUIName;
168*cdf0e10cSrcweir                     if ( aUIName.getLength() )
169*cdf0e10cSrcweir                         rReq.AppendItem( SfxStringItem( nSId, aUIName ) );
170*cdf0e10cSrcweir                 }
171*cdf0e10cSrcweir                 catch( Exception& )
172*cdf0e10cSrcweir                 {
173*cdf0e10cSrcweir                 }
174*cdf0e10cSrcweir             }
175*cdf0e10cSrcweir 
176*cdf0e10cSrcweir 			if (pArgs->GetItemState(nSId) == SFX_ITEM_SET)
177*cdf0e10cSrcweir 				aStyleName = ( ( (const SfxStringItem &) pArgs->Get( nSId ) ).GetValue() );
178*cdf0e10cSrcweir 		}
179*cdf0e10cSrcweir 	}
180*cdf0e10cSrcweir 
181*cdf0e10cSrcweir 	switch( nSId )
182*cdf0e10cSrcweir 	{
183*cdf0e10cSrcweir 		case SID_STYLE_NEW:
184*cdf0e10cSrcweir 		{
185*cdf0e10cSrcweir 			SfxStyleSheetBase *p = pSSPool->Find(aStyleName, (SfxStyleFamily) nFamily, SFXSTYLEBIT_ALL );
186*cdf0e10cSrcweir 			if(p)
187*cdf0e10cSrcweir 			{
188*cdf0e10cSrcweir 				pSSPool->Remove(p);
189*cdf0e10cSrcweir 				p = 0;
190*cdf0e10cSrcweir 			}
191*cdf0e10cSrcweir 			pStyleSheet = &pSSPool->Make( aStyleName, (SfxStyleFamily) nFamily, SFXSTYLEBIT_USERDEF );
192*cdf0e10cSrcweir 
193*cdf0e10cSrcweir 			if (pArgs->GetItemState(SID_STYLE_REFERENCE) == SFX_ITEM_ON)
194*cdf0e10cSrcweir 			{
195*cdf0e10cSrcweir 				String aParentName(((const SfxStringItem&) pArgs->Get(SID_STYLE_REFERENCE)).GetValue());
196*cdf0e10cSrcweir 				pStyleSheet->SetParent(aParentName);
197*cdf0e10cSrcweir 			}
198*cdf0e10cSrcweir 			else
199*cdf0e10cSrcweir 			{
200*cdf0e10cSrcweir 				pStyleSheet->SetParent(String(SdResId(STR_STANDARD_STYLESHEET_NAME)));
201*cdf0e10cSrcweir 			}
202*cdf0e10cSrcweir 		}
203*cdf0e10cSrcweir 		break;
204*cdf0e10cSrcweir 
205*cdf0e10cSrcweir 		case SID_STYLE_NEW_BY_EXAMPLE:
206*cdf0e10cSrcweir 		{
207*cdf0e10cSrcweir 			// Z.Z. geht immer noch der Dialog auf, um den Namen
208*cdf0e10cSrcweir 			// der Vorlage einzugeben.
209*cdf0e10cSrcweir 			if( mpView->AreObjectsMarked() || sal_True )
210*cdf0e10cSrcweir 			{
211*cdf0e10cSrcweir 				SfxStyleSheetBase *p = pSSPool->Find(aStyleName, (SfxStyleFamily) nFamily, SFXSTYLEBIT_ALL );
212*cdf0e10cSrcweir 				if(p)
213*cdf0e10cSrcweir 				{
214*cdf0e10cSrcweir 					pSSPool->Remove(p);
215*cdf0e10cSrcweir 					p = 0;
216*cdf0e10cSrcweir 				}
217*cdf0e10cSrcweir 				pStyleSheet = &pSSPool->Make( aStyleName, (SfxStyleFamily) nFamily, SFXSTYLEBIT_USERDEF );
218*cdf0e10cSrcweir 				pStyleSheet->SetParent(String(SdResId(STR_STANDARD_STYLESHEET_NAME)));
219*cdf0e10cSrcweir 			}
220*cdf0e10cSrcweir 		}
221*cdf0e10cSrcweir 		break;
222*cdf0e10cSrcweir 
223*cdf0e10cSrcweir 		case SID_STYLE_EDIT:
224*cdf0e10cSrcweir 			pStyleSheet = pSSPool->Find( aStyleName, (SfxStyleFamily) nFamily);
225*cdf0e10cSrcweir 		break;
226*cdf0e10cSrcweir 
227*cdf0e10cSrcweir 		case SID_STYLE_DELETE:
228*cdf0e10cSrcweir 			pStyleSheet = pSSPool->Find( aStyleName, (SfxStyleFamily) nFamily);
229*cdf0e10cSrcweir 			if( pStyleSheet )
230*cdf0e10cSrcweir 			{
231*cdf0e10cSrcweir 				pSSPool->Remove( pStyleSheet );
232*cdf0e10cSrcweir 				nRetMask = sal_True;
233*cdf0e10cSrcweir 				mpDoc->SetChanged(sal_True);
234*cdf0e10cSrcweir 			}
235*cdf0e10cSrcweir 			else
236*cdf0e10cSrcweir 			{
237*cdf0e10cSrcweir 				nRetMask = sal_False;
238*cdf0e10cSrcweir 			}
239*cdf0e10cSrcweir 		break;
240*cdf0e10cSrcweir 
241*cdf0e10cSrcweir 		case SID_STYLE_APPLY:
242*cdf0e10cSrcweir 			// Anwenden der Vorlage auf das Dokument
243*cdf0e10cSrcweir 			pStyleSheet = pSSPool->Find( aStyleName, (SfxStyleFamily) nFamily);
244*cdf0e10cSrcweir 
245*cdf0e10cSrcweir 			// do not set presentation styles, they will be set implicit
246*cdf0e10cSrcweir 			if ( pStyleSheet && pStyleSheet->GetFamily() != SD_STYLE_FAMILY_PSEUDO )
247*cdf0e10cSrcweir 			{
248*cdf0e10cSrcweir 				SfxStyleSheet* pOldStyleSheet = mpView->GetStyleSheet();
249*cdf0e10cSrcweir 				String aStr;
250*cdf0e10cSrcweir 
251*cdf0e10cSrcweir 				if( // if the object had no style sheet, allow all
252*cdf0e10cSrcweir 					!pOldStyleSheet ||
253*cdf0e10cSrcweir 
254*cdf0e10cSrcweir 					// allow if old and new style sheet has same family
255*cdf0e10cSrcweir 					pStyleSheet->GetFamily() == pOldStyleSheet->GetFamily() ||
256*cdf0e10cSrcweir 
257*cdf0e10cSrcweir 					// allow if old was background objects and new is graphics
258*cdf0e10cSrcweir 					pStyleSheet->GetFamily() == (SD_STYLE_FAMILY_GRAPHICS && pOldStyleSheet->GetHelpId( aStr ) == HID_PSEUDOSHEET_BACKGROUNDOBJECTS) ||
259*cdf0e10cSrcweir 
260*cdf0e10cSrcweir 					// allow if old was presentation and we are a drawing document
261*cdf0e10cSrcweir 					(pOldStyleSheet->GetFamily() == SD_STYLE_FAMILY_MASTERPAGE && mpDoc->GetDocumentType() == DOCUMENT_TYPE_DRAW) )
262*cdf0e10cSrcweir 				{
263*cdf0e10cSrcweir 					mpView->SetStyleSheet( (SfxStyleSheet*) pStyleSheet);
264*cdf0e10cSrcweir 					mpDoc->SetChanged(sal_True);
265*cdf0e10cSrcweir 					mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_STYLE_FAMILY2 );
266*cdf0e10cSrcweir 				}
267*cdf0e10cSrcweir 			}
268*cdf0e10cSrcweir /* #96983# GrabFocus moved to stylist
269*cdf0e10cSrcweir 			pWin->GrabFocus();
270*cdf0e10cSrcweir */
271*cdf0e10cSrcweir 		break;
272*cdf0e10cSrcweir 
273*cdf0e10cSrcweir 		case SID_STYLE_WATERCAN:
274*cdf0e10cSrcweir 		{
275*cdf0e10cSrcweir 			if( !SD_MOD()->GetWaterCan() )
276*cdf0e10cSrcweir 			{
277*cdf0e10cSrcweir 				if( pArgs->GetItemState( nSId ) == SFX_ITEM_SET )
278*cdf0e10cSrcweir 				{
279*cdf0e10cSrcweir 					aStyleName = ( ( (const SfxStringItem &) pArgs->Get( nSId ) ).GetValue() );
280*cdf0e10cSrcweir 					SD_MOD()->SetWaterCan( sal_True );
281*cdf0e10cSrcweir 					pStyleSheet = pSSPool->Find( aStyleName, (SfxStyleFamily) nFamily);
282*cdf0e10cSrcweir 				}
283*cdf0e10cSrcweir 				// keine Praesentationsobjektvorlagen, die werden nur
284*cdf0e10cSrcweir 				// implizit zugewiesen
285*cdf0e10cSrcweir 				if( pStyleSheet && pStyleSheet->GetFamily() != SD_STYLE_FAMILY_PSEUDO )
286*cdf0e10cSrcweir 				{
287*cdf0e10cSrcweir 					( (SdStyleSheetPool*) pSSPool )->SetActualStyleSheet( pStyleSheet );
288*cdf0e10cSrcweir 
289*cdf0e10cSrcweir 					// Es wird explizit in den Selektionsmodus geschaltet
290*cdf0e10cSrcweir 					mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_OBJECT_SELECT,
291*cdf0e10cSrcweir 										SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD );
292*cdf0e10cSrcweir 
293*cdf0e10cSrcweir 				}
294*cdf0e10cSrcweir 				else
295*cdf0e10cSrcweir 					SD_MOD()->SetWaterCan( sal_False );
296*cdf0e10cSrcweir 			}
297*cdf0e10cSrcweir 			else
298*cdf0e10cSrcweir 			{
299*cdf0e10cSrcweir 				SD_MOD()->SetWaterCan( sal_False );
300*cdf0e10cSrcweir 				// Werkzeugleiste muss wieder enabled werden
301*cdf0e10cSrcweir 				mpViewShell->Invalidate();
302*cdf0e10cSrcweir 			}
303*cdf0e10cSrcweir 		}
304*cdf0e10cSrcweir 		break;
305*cdf0e10cSrcweir 
306*cdf0e10cSrcweir 		default:
307*cdf0e10cSrcweir 		break;
308*cdf0e10cSrcweir 	}
309*cdf0e10cSrcweir 
310*cdf0e10cSrcweir 	switch( nSId )
311*cdf0e10cSrcweir 	{
312*cdf0e10cSrcweir 		case SID_STYLE_NEW:
313*cdf0e10cSrcweir 		case SID_STYLE_EDIT:
314*cdf0e10cSrcweir 		{
315*cdf0e10cSrcweir 			PresentationObjects ePO = PO_OUTLINE_1;
316*cdf0e10cSrcweir 
317*cdf0e10cSrcweir 			if( pStyleSheet )
318*cdf0e10cSrcweir 			{
319*cdf0e10cSrcweir 				SfxAbstractTabDialog*  pStdDlg  = NULL;
320*cdf0e10cSrcweir 				SfxAbstractTabDialog*  pPresDlg = NULL;
321*cdf0e10cSrcweir 				SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
322*cdf0e10cSrcweir 				sal_Bool bOldDocInOtherLanguage = sal_False;
323*cdf0e10cSrcweir 				SfxItemSet aOriSet( pStyleSheet->GetItemSet() );
324*cdf0e10cSrcweir 
325*cdf0e10cSrcweir 				SfxStyleFamily eFamily = pStyleSheet->GetFamily();
326*cdf0e10cSrcweir 
327*cdf0e10cSrcweir 				if (eFamily == SD_STYLE_FAMILY_GRAPHICS)
328*cdf0e10cSrcweir 				{
329*cdf0e10cSrcweir 					pStdDlg = pFact ? pFact->CreateSdTabTemplateDlg( 0, mpDoc->GetDocSh(), *pStyleSheet, mpDoc, mpView ) : 0;
330*cdf0e10cSrcweir 				}
331*cdf0e10cSrcweir 				else if (eFamily == SD_STYLE_FAMILY_PSEUDO)
332*cdf0e10cSrcweir 				{
333*cdf0e10cSrcweir 					String aName(pStyleSheet->GetName());
334*cdf0e10cSrcweir 					sal_uInt16 nDlgId = 0;
335*cdf0e10cSrcweir 
336*cdf0e10cSrcweir 					if (aName == String(SdResId(STR_PSEUDOSHEET_TITLE)))
337*cdf0e10cSrcweir 					{
338*cdf0e10cSrcweir 						nDlgId = TAB_PRES_LAYOUT_TEMPLATE;
339*cdf0e10cSrcweir 						ePO    = PO_TITLE;
340*cdf0e10cSrcweir 					}
341*cdf0e10cSrcweir 					else if (aName == String(SdResId(STR_PSEUDOSHEET_SUBTITLE)))
342*cdf0e10cSrcweir 					{
343*cdf0e10cSrcweir 						nDlgId = TAB_PRES_LAYOUT_TEMPLATE;
344*cdf0e10cSrcweir 						ePO    = PO_SUBTITLE;
345*cdf0e10cSrcweir 					}
346*cdf0e10cSrcweir 					else if (aName ==
347*cdf0e10cSrcweir 							 String(SdResId(STR_PSEUDOSHEET_BACKGROUND)))
348*cdf0e10cSrcweir 					{
349*cdf0e10cSrcweir 						nDlgId = TAB_PRES_LAYOUT_TEMPLATE_BACKGROUND;
350*cdf0e10cSrcweir 						ePO    = PO_BACKGROUND;
351*cdf0e10cSrcweir 					}
352*cdf0e10cSrcweir 					else if (aName ==
353*cdf0e10cSrcweir 							 String(SdResId(STR_PSEUDOSHEET_BACKGROUNDOBJECTS)))
354*cdf0e10cSrcweir 					{
355*cdf0e10cSrcweir 						nDlgId = TAB_PRES_LAYOUT_TEMPLATE;
356*cdf0e10cSrcweir 						ePO    = PO_BACKGROUNDOBJECTS;
357*cdf0e10cSrcweir 					}
358*cdf0e10cSrcweir 					else if (aName ==
359*cdf0e10cSrcweir 							 String(SdResId(STR_PSEUDOSHEET_NOTES)))
360*cdf0e10cSrcweir 					{
361*cdf0e10cSrcweir 						nDlgId = TAB_PRES_LAYOUT_TEMPLATE;
362*cdf0e10cSrcweir 						ePO    = PO_NOTES;
363*cdf0e10cSrcweir 					}
364*cdf0e10cSrcweir 					else if(aName.Search(String(SdResId(STR_PSEUDOSHEET_OUTLINE))) !=
365*cdf0e10cSrcweir 							STRING_NOTFOUND)
366*cdf0e10cSrcweir 					{
367*cdf0e10cSrcweir 						nDlgId = TAB_PRES_LAYOUT_TEMPLATE;
368*cdf0e10cSrcweir 
369*cdf0e10cSrcweir 						String aOutlineStr((SdResId(STR_PSEUDOSHEET_OUTLINE)));
370*cdf0e10cSrcweir 						// die Nummer ermitteln; ein Leerzeichen zwischen
371*cdf0e10cSrcweir 						// Name und Nummer beachten
372*cdf0e10cSrcweir 						String aNumStr(aName.Copy(aOutlineStr.Len() + 1));
373*cdf0e10cSrcweir 						sal_uInt16 nLevel = (sal_uInt16)aNumStr.ToInt32();
374*cdf0e10cSrcweir 						switch (nLevel)
375*cdf0e10cSrcweir 						{
376*cdf0e10cSrcweir 							case 1: ePO = PO_OUTLINE_1; break;
377*cdf0e10cSrcweir 							case 2: ePO = PO_OUTLINE_2; break;
378*cdf0e10cSrcweir 							case 3: ePO = PO_OUTLINE_3; break;
379*cdf0e10cSrcweir 							case 4: ePO = PO_OUTLINE_4; break;
380*cdf0e10cSrcweir 							case 5: ePO = PO_OUTLINE_5; break;
381*cdf0e10cSrcweir 							case 6: ePO = PO_OUTLINE_6; break;
382*cdf0e10cSrcweir 							case 7: ePO = PO_OUTLINE_7; break;
383*cdf0e10cSrcweir 							case 8: ePO = PO_OUTLINE_8; break;
384*cdf0e10cSrcweir 							case 9: ePO = PO_OUTLINE_9; break;
385*cdf0e10cSrcweir 						}
386*cdf0e10cSrcweir 					}
387*cdf0e10cSrcweir 					else
388*cdf0e10cSrcweir 					{
389*cdf0e10cSrcweir 						DBG_ERROR("Vorlage aus aelterer anderssprachiger Version");
390*cdf0e10cSrcweir 						bOldDocInOtherLanguage = sal_True;
391*cdf0e10cSrcweir 					}
392*cdf0e10cSrcweir 
393*cdf0e10cSrcweir 					if( !bOldDocInOtherLanguage )
394*cdf0e10cSrcweir 					{
395*cdf0e10cSrcweir 						pPresDlg = pFact ? pFact->CreateSdPresLayoutTemplateDlg( mpDocSh, NULL, SdResId(nDlgId), *pStyleSheet, ePO, pSSPool ) : 0;
396*cdf0e10cSrcweir 					}
397*cdf0e10cSrcweir 				}
398*cdf0e10cSrcweir 				else if (eFamily == SD_STYLE_FAMILY_CELL)
399*cdf0e10cSrcweir 				{
400*cdf0e10cSrcweir 				}
401*cdf0e10cSrcweir 
402*cdf0e10cSrcweir 				sal_uInt16 nResult = RET_CANCEL;
403*cdf0e10cSrcweir 				const SfxItemSet* pOutSet = NULL;
404*cdf0e10cSrcweir 				if (pStdDlg)
405*cdf0e10cSrcweir 				{
406*cdf0e10cSrcweir 					nResult = pStdDlg->Execute();
407*cdf0e10cSrcweir 					pOutSet = pStdDlg->GetOutputItemSet();
408*cdf0e10cSrcweir 				}
409*cdf0e10cSrcweir 				else if( pPresDlg )
410*cdf0e10cSrcweir 				{
411*cdf0e10cSrcweir 					nResult = pPresDlg->Execute();
412*cdf0e10cSrcweir 					pOutSet = pPresDlg->GetOutputItemSet();
413*cdf0e10cSrcweir 				}
414*cdf0e10cSrcweir 
415*cdf0e10cSrcweir 				switch( nResult )
416*cdf0e10cSrcweir 				{
417*cdf0e10cSrcweir 					case RET_OK:
418*cdf0e10cSrcweir 					{
419*cdf0e10cSrcweir 						nRetMask = pStyleSheet->GetMask();
420*cdf0e10cSrcweir 
421*cdf0e10cSrcweir 						if (eFamily == SD_STYLE_FAMILY_PSEUDO)
422*cdf0e10cSrcweir 						{
423*cdf0e10cSrcweir 							SfxItemSet aTempSet(*pOutSet);
424*cdf0e10cSrcweir 							((SdStyleSheet*)pStyleSheet)->AdjustToFontHeight(aTempSet);
425*cdf0e10cSrcweir 
426*cdf0e10cSrcweir 							// Sonderbehandlung: die INVALIDS auf NULL-Pointer
427*cdf0e10cSrcweir 							// zurueckgesetzen (sonst landen INVALIDs oder
428*cdf0e10cSrcweir 							// Pointer auf die DefaultItems in der Vorlage;
429*cdf0e10cSrcweir 							// beides wuerde die Attribut-Vererbung unterbinden)
430*cdf0e10cSrcweir 							aTempSet.ClearInvalidItems();
431*cdf0e10cSrcweir 
432*cdf0e10cSrcweir 							// EE_PARA_NUMBULLET item is only valid in first outline template
433*cdf0e10cSrcweir 							if( (ePO >= PO_OUTLINE_2) && (ePO <= PO_OUTLINE_9) )
434*cdf0e10cSrcweir 							{
435*cdf0e10cSrcweir 								if (aTempSet.GetItemState(EE_PARA_NUMBULLET) == SFX_ITEM_SET)
436*cdf0e10cSrcweir 								{
437*cdf0e10cSrcweir 									SvxNumRule aRule(*((SvxNumBulletItem*)aTempSet.GetItem(EE_PARA_NUMBULLET))->GetNumRule());
438*cdf0e10cSrcweir 
439*cdf0e10cSrcweir 									String sStyleName((SdResId(STR_PSEUDOSHEET_OUTLINE)));
440*cdf0e10cSrcweir 									sStyleName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " 1" ) );
441*cdf0e10cSrcweir 									SfxStyleSheetBase* pFirstStyleSheet = pSSPool->Find( sStyleName, SD_STYLE_FAMILY_PSEUDO);
442*cdf0e10cSrcweir 
443*cdf0e10cSrcweir 									if(pFirstStyleSheet)
444*cdf0e10cSrcweir 									{
445*cdf0e10cSrcweir 										pFirstStyleSheet->GetItemSet().Put( SvxNumBulletItem( aRule, EE_PARA_NUMBULLET ));
446*cdf0e10cSrcweir 										SdStyleSheet* pRealSheet = ((SdStyleSheet*)pFirstStyleSheet)->GetRealStyleSheet();
447*cdf0e10cSrcweir 										pRealSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
448*cdf0e10cSrcweir 									}
449*cdf0e10cSrcweir 
450*cdf0e10cSrcweir 									aTempSet.ClearItem( EE_PARA_NUMBULLET );
451*cdf0e10cSrcweir 								}
452*cdf0e10cSrcweir 							}
453*cdf0e10cSrcweir 
454*cdf0e10cSrcweir 							String sStyleName((SdResId(STR_PSEUDOSHEET_OUTLINE)));
455*cdf0e10cSrcweir 							sStyleName.Append( sal_Unicode( ' ' ));
456*cdf0e10cSrcweir 
457*cdf0e10cSrcweir 							pStyleSheet->GetItemSet().Put(aTempSet);
458*cdf0e10cSrcweir 
459*cdf0e10cSrcweir 							SdStyleSheet* pRealSheet =((SdStyleSheet*)pStyleSheet)->GetRealStyleSheet();
460*cdf0e10cSrcweir 							pRealSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
461*cdf0e10cSrcweir 
462*cdf0e10cSrcweir 							if( (ePO >= PO_OUTLINE_1) && (ePO <= PO_OUTLINE_8) )
463*cdf0e10cSrcweir 							{
464*cdf0e10cSrcweir 								for( sal_uInt16 n = (sal_uInt16)(ePO - PO_OUTLINE_1 + 2); n < 10; n++ )
465*cdf0e10cSrcweir 								{
466*cdf0e10cSrcweir 									String aName( sStyleName );
467*cdf0e10cSrcweir 									aName.Append( String::CreateFromInt32( (sal_Int32) n ));
468*cdf0e10cSrcweir 
469*cdf0e10cSrcweir 									SfxStyleSheetBase* pSheet = pSSPool->Find( aName, SD_STYLE_FAMILY_PSEUDO);
470*cdf0e10cSrcweir 
471*cdf0e10cSrcweir 									if(pSheet)
472*cdf0e10cSrcweir 									{
473*cdf0e10cSrcweir 										SdStyleSheet* pRealStyleSheet = ((SdStyleSheet*)pSheet)->GetRealStyleSheet();
474*cdf0e10cSrcweir 										pRealStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
475*cdf0e10cSrcweir 									}
476*cdf0e10cSrcweir 								}
477*cdf0e10cSrcweir 							}
478*cdf0e10cSrcweir 						}
479*cdf0e10cSrcweir 
480*cdf0e10cSrcweir 						SfxItemSet& rAttr = pStyleSheet->GetItemSet();
481*cdf0e10cSrcweir 
482*cdf0e10cSrcweir 						sdr::properties::CleanupFillProperties( rAttr );
483*cdf0e10cSrcweir 
484*cdf0e10cSrcweir 						// check for unique names of named items for xml
485*cdf0e10cSrcweir 						if( rAttr.GetItemState( XATTR_FILLBITMAP ) == SFX_ITEM_SET )
486*cdf0e10cSrcweir 						{
487*cdf0e10cSrcweir 							const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_FILLBITMAP );
488*cdf0e10cSrcweir 							SfxPoolItem* pNewItem = ((XFillBitmapItem*)pOldItem)->checkForUniqueItem( mpDoc );
489*cdf0e10cSrcweir 							if( pOldItem != pNewItem )
490*cdf0e10cSrcweir 							{
491*cdf0e10cSrcweir 								rAttr.Put( *pNewItem );
492*cdf0e10cSrcweir 								delete pNewItem;
493*cdf0e10cSrcweir 							}
494*cdf0e10cSrcweir 						}
495*cdf0e10cSrcweir 						if( rAttr.GetItemState( XATTR_LINEDASH ) == SFX_ITEM_SET )
496*cdf0e10cSrcweir 						{
497*cdf0e10cSrcweir 							const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_LINEDASH );
498*cdf0e10cSrcweir 							SfxPoolItem* pNewItem = ((XLineDashItem*)pOldItem)->checkForUniqueItem( mpDoc );
499*cdf0e10cSrcweir 							if( pOldItem != pNewItem )
500*cdf0e10cSrcweir 							{
501*cdf0e10cSrcweir 								rAttr.Put( *pNewItem );
502*cdf0e10cSrcweir 								delete pNewItem;
503*cdf0e10cSrcweir 							}
504*cdf0e10cSrcweir 						}
505*cdf0e10cSrcweir 						if( rAttr.GetItemState( XATTR_LINESTART ) == SFX_ITEM_SET )
506*cdf0e10cSrcweir 						{
507*cdf0e10cSrcweir 							const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_LINESTART );
508*cdf0e10cSrcweir 							SfxPoolItem* pNewItem = ((XLineStartItem*)pOldItem)->checkForUniqueItem( mpDoc );
509*cdf0e10cSrcweir 							if( pOldItem != pNewItem )
510*cdf0e10cSrcweir 							{
511*cdf0e10cSrcweir 								rAttr.Put( *pNewItem );
512*cdf0e10cSrcweir 								delete pNewItem;
513*cdf0e10cSrcweir 							}
514*cdf0e10cSrcweir 						}
515*cdf0e10cSrcweir 						if( rAttr.GetItemState( XATTR_LINEEND ) == SFX_ITEM_SET )
516*cdf0e10cSrcweir 						{
517*cdf0e10cSrcweir 							const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_LINEEND );
518*cdf0e10cSrcweir 							SfxPoolItem* pNewItem = ((XLineEndItem*)pOldItem)->checkForUniqueItem( mpDoc );
519*cdf0e10cSrcweir 							if( pOldItem != pNewItem )
520*cdf0e10cSrcweir 							{
521*cdf0e10cSrcweir 								rAttr.Put( *pNewItem );
522*cdf0e10cSrcweir 								delete pNewItem;
523*cdf0e10cSrcweir 							}
524*cdf0e10cSrcweir 						}
525*cdf0e10cSrcweir 						if( rAttr.GetItemState( XATTR_FILLGRADIENT ) == SFX_ITEM_SET )
526*cdf0e10cSrcweir 						{
527*cdf0e10cSrcweir 							const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_FILLGRADIENT );
528*cdf0e10cSrcweir 							SfxPoolItem* pNewItem = ((XFillGradientItem*)pOldItem)->checkForUniqueItem( mpDoc );
529*cdf0e10cSrcweir 							if( pOldItem != pNewItem )
530*cdf0e10cSrcweir 							{
531*cdf0e10cSrcweir 								rAttr.Put( *pNewItem );
532*cdf0e10cSrcweir 								delete pNewItem;
533*cdf0e10cSrcweir 							}
534*cdf0e10cSrcweir 						}
535*cdf0e10cSrcweir 						if( rAttr.GetItemState( XATTR_FILLFLOATTRANSPARENCE ) == SFX_ITEM_SET )
536*cdf0e10cSrcweir 						{
537*cdf0e10cSrcweir 							const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_FILLFLOATTRANSPARENCE );
538*cdf0e10cSrcweir 							SfxPoolItem* pNewItem = ((XFillFloatTransparenceItem*)pOldItem)->checkForUniqueItem( mpDoc );
539*cdf0e10cSrcweir 							if( pOldItem != pNewItem )
540*cdf0e10cSrcweir 							{
541*cdf0e10cSrcweir 								rAttr.Put( *pNewItem );
542*cdf0e10cSrcweir 								delete pNewItem;
543*cdf0e10cSrcweir 							}
544*cdf0e10cSrcweir 						}
545*cdf0e10cSrcweir 						if( rAttr.GetItemState( XATTR_FILLHATCH ) == SFX_ITEM_SET )
546*cdf0e10cSrcweir 						{
547*cdf0e10cSrcweir 							const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_FILLHATCH );
548*cdf0e10cSrcweir 							SfxPoolItem* pNewItem = ((XFillHatchItem*)pOldItem)->checkForUniqueItem( mpDoc );
549*cdf0e10cSrcweir 							if( pOldItem != pNewItem )
550*cdf0e10cSrcweir 							{
551*cdf0e10cSrcweir 								rAttr.Put( *pNewItem );
552*cdf0e10cSrcweir 								delete pNewItem;
553*cdf0e10cSrcweir 							}
554*cdf0e10cSrcweir 						}
555*cdf0e10cSrcweir 
556*cdf0e10cSrcweir 						( (SfxStyleSheet*) pStyleSheet )->Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
557*cdf0e10cSrcweir 
558*cdf0e10cSrcweir 						DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >( mpViewShell );
559*cdf0e10cSrcweir 						if( pDrawViewShell )
560*cdf0e10cSrcweir 						{
561*cdf0e10cSrcweir 							PageKind ePageKind = pDrawViewShell->GetPageKind();
562*cdf0e10cSrcweir 							if( ePageKind == PK_NOTES || ePageKind == PK_HANDOUT )
563*cdf0e10cSrcweir 							{
564*cdf0e10cSrcweir 								SdPage* pPage = mpViewShell->GetActualPage();
565*cdf0e10cSrcweir 
566*cdf0e10cSrcweir 								if(pDrawViewShell->GetEditMode() == EM_MASTERPAGE)
567*cdf0e10cSrcweir 								{
568*cdf0e10cSrcweir 									pPage = static_cast<SdPage*>((&(pPage->TRG_GetMasterPage())));
569*cdf0e10cSrcweir 								}
570*cdf0e10cSrcweir 
571*cdf0e10cSrcweir 								if( pPage )
572*cdf0e10cSrcweir 								{
573*cdf0e10cSrcweir 									SdrObjListIter aIter( *pPage );
574*cdf0e10cSrcweir 									while( aIter.IsMore() )
575*cdf0e10cSrcweir 									{
576*cdf0e10cSrcweir 										SdrObject* pObj = aIter.Next();
577*cdf0e10cSrcweir 										if( pObj->ISA(SdrPageObj) )
578*cdf0e10cSrcweir 										{
579*cdf0e10cSrcweir 											// repaint only
580*cdf0e10cSrcweir 											pObj->ActionChanged();
581*cdf0e10cSrcweir 											// pObj->SendRepaintBroadcast();
582*cdf0e10cSrcweir 										}
583*cdf0e10cSrcweir 									}
584*cdf0e10cSrcweir 								}
585*cdf0e10cSrcweir 							}
586*cdf0e10cSrcweir 						}
587*cdf0e10cSrcweir 
588*cdf0e10cSrcweir 						if( mpDoc->GetOnlineSpell() )
589*cdf0e10cSrcweir 						{
590*cdf0e10cSrcweir 							const SfxPoolItem* pTempItem;
591*cdf0e10cSrcweir 							if( SFX_ITEM_SET == rAttr.GetItemState(EE_CHAR_LANGUAGE, sal_False, &pTempItem ) ||
592*cdf0e10cSrcweir 								SFX_ITEM_SET == rAttr.GetItemState(EE_CHAR_LANGUAGE_CJK, sal_False, &pTempItem ) ||
593*cdf0e10cSrcweir 								SFX_ITEM_SET == rAttr.GetItemState(EE_CHAR_LANGUAGE_CTL, sal_False, &pTempItem ) )
594*cdf0e10cSrcweir 							{
595*cdf0e10cSrcweir 								mpDoc->StopOnlineSpelling();
596*cdf0e10cSrcweir 								mpDoc->StartOnlineSpelling();
597*cdf0e10cSrcweir 							}
598*cdf0e10cSrcweir 						}
599*cdf0e10cSrcweir 
600*cdf0e10cSrcweir 						mpDoc->SetChanged(sal_True);
601*cdf0e10cSrcweir 					}
602*cdf0e10cSrcweir 					break;
603*cdf0e10cSrcweir 
604*cdf0e10cSrcweir 					default:
605*cdf0e10cSrcweir 					{
606*cdf0e10cSrcweir 						if( nSId == SID_STYLE_NEW )
607*cdf0e10cSrcweir 							pSSPool->Remove( pStyleSheet );
608*cdf0e10cSrcweir 						delete pStdDlg;
609*cdf0e10cSrcweir 						delete pPresDlg;
610*cdf0e10cSrcweir 					}
611*cdf0e10cSrcweir 					return; // Abbruch
612*cdf0e10cSrcweir 				}
613*cdf0e10cSrcweir 				delete pStdDlg;
614*cdf0e10cSrcweir 				delete pPresDlg;
615*cdf0e10cSrcweir 			}
616*cdf0e10cSrcweir 		}
617*cdf0e10cSrcweir 		break;
618*cdf0e10cSrcweir 
619*cdf0e10cSrcweir 		case SID_STYLE_NEW_BY_EXAMPLE:
620*cdf0e10cSrcweir 		{
621*cdf0e10cSrcweir 			if( pStyleSheet )
622*cdf0e10cSrcweir 			{
623*cdf0e10cSrcweir 				nRetMask = pStyleSheet->GetMask();
624*cdf0e10cSrcweir 				SfxItemSet aCoreSet( mpDoc->GetPool() );
625*cdf0e10cSrcweir 				mpView->GetAttributes( aCoreSet, sal_True );
626*cdf0e10cSrcweir 
627*cdf0e10cSrcweir 				// wenn das Objekt eine Vorlage hatte, wird diese Parent
628*cdf0e10cSrcweir 				// der neuen Vorlage
629*cdf0e10cSrcweir 				SfxStyleSheet* pOldStyle = mpView->GetStyleSheet();
630*cdf0e10cSrcweir 
631*cdf0e10cSrcweir 				// Wenn pOldStyle == pStyleSheet -> Rekursion
632*cdf0e10cSrcweir 				if( pOldStyle != pStyleSheet )
633*cdf0e10cSrcweir 				{
634*cdf0e10cSrcweir 					if (pOldStyle)
635*cdf0e10cSrcweir 					{
636*cdf0e10cSrcweir 						pStyleSheet->SetParent(pOldStyle->GetName());
637*cdf0e10cSrcweir 					}
638*cdf0e10cSrcweir 
639*cdf0e10cSrcweir 					SfxItemSet* pStyleSet = &pStyleSheet->GetItemSet();
640*cdf0e10cSrcweir 					pStyleSet->Put(aCoreSet);
641*cdf0e10cSrcweir 
642*cdf0e10cSrcweir 					// Vorlage anwenden (Aber nicht, wenn gerade ein Text
643*cdf0e10cSrcweir 					// editiert wird, denn dazu muesste die Edit Engine
644*cdf0e10cSrcweir 					// Vorlagen auf Zeichenebene beherrschen.)
645*cdf0e10cSrcweir 					if (!mpView->GetTextEditObject())
646*cdf0e10cSrcweir 					{
647*cdf0e10cSrcweir 						mpView->SetStyleSheet( (SfxStyleSheet*) pStyleSheet);
648*cdf0e10cSrcweir 					}
649*cdf0e10cSrcweir 
650*cdf0e10cSrcweir 					( (SfxStyleSheet*) pStyleSheet )->Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
651*cdf0e10cSrcweir 					mpDoc->SetChanged(sal_True);
652*cdf0e10cSrcweir 
653*cdf0e10cSrcweir 					mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_STYLE_FAMILY2 );
654*cdf0e10cSrcweir 				}
655*cdf0e10cSrcweir 			}
656*cdf0e10cSrcweir 		}
657*cdf0e10cSrcweir 		break;
658*cdf0e10cSrcweir 
659*cdf0e10cSrcweir 		case SID_STYLE_UPDATE_BY_EXAMPLE:
660*cdf0e10cSrcweir 		{
661*cdf0e10cSrcweir 			if ((mpView->AreObjectsMarked() && mpView->GetMarkedObjectList().GetMarkCount() == 1) ||
662*cdf0e10cSrcweir 				 mpView->ISA(OutlineView))
663*cdf0e10cSrcweir 			{
664*cdf0e10cSrcweir 				pStyleSheet = mpView->GetStyleSheet();
665*cdf0e10cSrcweir 
666*cdf0e10cSrcweir 				if( pStyleSheet )
667*cdf0e10cSrcweir 				{
668*cdf0e10cSrcweir 					nRetMask = pStyleSheet->GetMask();
669*cdf0e10cSrcweir 					SfxItemSet aCoreSet( mpDoc->GetPool() );
670*cdf0e10cSrcweir 					mpView->GetAttributes( aCoreSet );
671*cdf0e10cSrcweir 
672*cdf0e10cSrcweir 					SfxItemSet* pStyleSet = &pStyleSheet->GetItemSet();
673*cdf0e10cSrcweir 					pStyleSet->Put( aCoreSet );
674*cdf0e10cSrcweir 
675*cdf0e10cSrcweir 					mpView->SetStyleSheet( (SfxStyleSheet*) pStyleSheet);
676*cdf0e10cSrcweir 
677*cdf0e10cSrcweir 					( (SfxStyleSheet*) pStyleSheet )->Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
678*cdf0e10cSrcweir 					mpDoc->SetChanged(sal_True);
679*cdf0e10cSrcweir 					mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_STYLE_FAMILY2 );
680*cdf0e10cSrcweir 				}
681*cdf0e10cSrcweir 			}
682*cdf0e10cSrcweir 		}
683*cdf0e10cSrcweir 		break;
684*cdf0e10cSrcweir 
685*cdf0e10cSrcweir 	}
686*cdf0e10cSrcweir 	if( nRetMask != 0xffff )
687*cdf0e10cSrcweir 		rReq.SetReturnValue( SfxUInt16Item( nSId, nRetMask ) );
688*cdf0e10cSrcweir }
689*cdf0e10cSrcweir 
690*cdf0e10cSrcweir void FuTemplate::Activate()
691*cdf0e10cSrcweir {
692*cdf0e10cSrcweir }
693*cdf0e10cSrcweir 
694*cdf0e10cSrcweir void FuTemplate::Deactivate()
695*cdf0e10cSrcweir {
696*cdf0e10cSrcweir }
697*cdf0e10cSrcweir 
698*cdf0e10cSrcweir } // end of namespace sd
699