bump product version to 5.0.4.1
[LibreOffice.git] / sd / source / ui / func / futempl.cxx
blob8404daaf82e228e0e31b9e43e7100dd6844c99f1
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
21 #include <com/sun/star/beans/XPropertySet.hpp>
22 #include <com/sun/star/container/XNameAccess.hpp>
24 #include "futempl.hxx"
26 #include <editeng/editdata.hxx>
27 #include <editeng/bulletitem.hxx>
28 #include <svx/svxids.hrc>
29 #include <sfx2/bindings.hxx>
30 #include <svl/aeitem.hxx>
31 #include <sfx2/dispatch.hxx>
32 #include <vcl/msgbox.hxx>
33 #include <editeng/eeitem.hxx>
34 #include <sfx2/request.hxx>
35 #include <editeng/numitem.hxx>
36 #include <editeng/editeng.hxx>
37 #include <editeng/lrspitem.hxx>
38 #include <svx/svdopage.hxx>
39 #include <svx/svditer.hxx>
40 #include <svx/sdr/properties/properties.hxx>
42 #include <sfx2/viewfrm.hxx>
43 #include <svx/xlndsit.hxx>
44 #include <svx/xlnstit.hxx>
45 #include <svx/xlnedit.hxx>
46 #include "app.hrc"
47 #include "stlsheet.hxx"
48 #include "sdpage.hxx"
49 #include "stlpool.hxx"
50 #include "sdmod.hxx"
51 #include "View.hxx"
52 #include "Window.hxx"
53 #include "drawview.hxx"
54 #include "drawdoc.hxx"
55 #include "DrawDocShell.hxx"
56 #include "DrawViewShell.hxx"
57 #include "ViewShell.hxx"
58 #include "res_bmp.hrc"
59 #include "glob.hrc"
60 #include "prlayout.hxx"
61 #include "prltempl.hrc"
62 #include <svx/xfillit.hxx>
63 #include "sdresid.hxx"
64 #include "OutlineViewShell.hxx"
65 #include "strings.hrc"
66 #include "helpids.h"
67 #include "sdabstdlg.hxx"
68 #include <boost/scoped_ptr.hpp>
70 using namespace com::sun::star::uno;
71 using namespace com::sun::star::container;
72 using namespace com::sun::star::beans;
73 using namespace com::sun::star::style;
75 namespace sd
78 TYPEINIT1( FuTemplate, FuPoor );
80 FuTemplate::FuTemplate (
81 ViewShell* pViewSh,
82 ::sd::Window* pWin,
83 ::sd::View* pView,
84 SdDrawDocument* pDoc,
85 SfxRequest& rReq )
86 : FuPoor( pViewSh, pWin, pView, pDoc, rReq )
90 rtl::Reference<FuPoor> FuTemplate::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq )
92 rtl::Reference<FuPoor> xFunc( new FuTemplate( pViewSh, pWin, pView, pDoc, rReq ) );
93 xFunc->DoExecute(rReq);
94 return xFunc;
97 void FuTemplate::DoExecute( SfxRequest& rReq )
99 const SfxItemSet* pArgs = rReq.GetArgs();
100 sal_uInt16 nSId = rReq.GetSlot();
102 // get StyleSheet parameter
103 SfxStyleSheetBasePool* pSSPool = mpDoc->GetDocSh()->GetStyleSheetPool();
104 SfxStyleSheetBase* pStyleSheet = NULL;
106 const SfxPoolItem* pItem;
107 sal_uInt16 nFamily = USHRT_MAX;
108 if( pArgs && SfxItemState::SET == pArgs->GetItemState( SID_STYLE_FAMILY,
109 false, &pItem ))
111 nFamily = static_cast<const SfxUInt16Item &>( pArgs->Get( SID_STYLE_FAMILY ) ).GetValue();
113 else if( pArgs && SfxItemState::SET == pArgs->GetItemState( SID_STYLE_FAMILYNAME,
114 false, &pItem ))
116 OUString sFamily = static_cast<const SfxStringItem &>( pArgs->Get( SID_STYLE_FAMILYNAME ) ).GetValue();
117 if (sFamily == "graphics")
118 nFamily = SD_STYLE_FAMILY_GRAPHICS;
119 else
120 nFamily = SD_STYLE_FAMILY_PSEUDO;
123 OUString aStyleName;
124 sal_uInt16 nRetMask = SFXSTYLEBIT_ALL;
126 switch( nSId )
128 case SID_STYLE_APPLY:
129 case SID_STYLE_EDIT:
130 case SID_STYLE_DELETE:
131 case SID_STYLE_HIDE:
132 case SID_STYLE_SHOW:
133 case SID_STYLE_FAMILY:
134 case SID_STYLE_NEW_BY_EXAMPLE:
136 SFX_REQUEST_ARG( rReq, pNameItem, SfxStringItem, SID_APPLY_STYLE, false );
137 SFX_REQUEST_ARG( rReq, pFamilyItem, SfxStringItem, SID_STYLE_FAMILYNAME, false );
138 if ( pFamilyItem && pNameItem )
142 Reference< XStyleFamiliesSupplier > xModel(mpDoc->GetDocSh()->GetModel(), UNO_QUERY_THROW );
143 Reference< XNameAccess > xCont( xModel->getStyleFamilies() );
144 Reference< XNameAccess > xStyles( xCont->getByName(pFamilyItem->GetValue()), UNO_QUERY_THROW );
145 Reference< XPropertySet > xInfo( xStyles->getByName( pNameItem->GetValue() ), UNO_QUERY_THROW );
147 OUString aUIName;
148 xInfo->getPropertyValue( "DisplayName" ) >>= aUIName;
149 if ( !aUIName.isEmpty() )
150 rReq.AppendItem( SfxStringItem( nSId, aUIName ) );
152 catch( Exception& )
157 if (pArgs && pArgs->GetItemState(nSId) == SfxItemState::SET)
158 aStyleName = static_cast<const SfxStringItem &>( pArgs->Get( nSId ) ).GetValue();
162 switch( nSId )
164 case SID_STYLE_NEW:
166 SfxStyleSheetBase *p = pSSPool->Find(aStyleName, (SfxStyleFamily) nFamily, SFXSTYLEBIT_ALL );
167 if(p)
169 pSSPool->Remove(p);
170 p = 0;
172 pStyleSheet = &pSSPool->Make( aStyleName, (SfxStyleFamily) nFamily, SFXSTYLEBIT_USERDEF );
174 if (pArgs && pArgs->GetItemState(SID_STYLE_REFERENCE) == SfxItemState::SET)
176 OUString aParentName(static_cast<const SfxStringItem&>( pArgs->Get(SID_STYLE_REFERENCE)).GetValue());
177 pStyleSheet->SetParent(aParentName);
179 else
181 pStyleSheet->SetParent(SD_RESSTR(STR_STANDARD_STYLESHEET_NAME));
184 break;
186 case SID_STYLE_NEW_BY_EXAMPLE:
188 // at the moment, the dialog to enter the name of the template is still opened
189 SfxStyleSheetBase *p = pSSPool->Find(aStyleName, (SfxStyleFamily) nFamily, SFXSTYLEBIT_ALL );
190 if(p)
192 pSSPool->Remove(p);
193 p = 0;
195 pStyleSheet = &pSSPool->Make( aStyleName, (SfxStyleFamily) nFamily, SFXSTYLEBIT_USERDEF );
196 pStyleSheet->SetParent(SD_RESSTR(STR_STANDARD_STYLESHEET_NAME));
198 break;
200 case SID_STYLE_EDIT:
201 pStyleSheet = pSSPool->Find( aStyleName, (SfxStyleFamily) nFamily);
202 break;
204 case SID_STYLE_DELETE:
205 pStyleSheet = pSSPool->Find( aStyleName, (SfxStyleFamily) nFamily);
206 if( pStyleSheet )
208 pSSPool->Remove( pStyleSheet );
209 nRetMask = sal_uInt16(true);
210 mpDoc->SetChanged(true);
212 else
214 nRetMask = sal_uInt16(false);
216 break;
218 case SID_STYLE_HIDE:
219 case SID_STYLE_SHOW:
220 pStyleSheet = pSSPool->Find( aStyleName, (SfxStyleFamily) nFamily);
221 pStyleSheet->SetHidden( nSId == SID_STYLE_HIDE );
222 nRetMask = sal_uInt16(true);
223 break;
225 case SID_STYLE_APPLY:
226 // apply the template to the document
227 pStyleSheet = pSSPool->Find( aStyleName, (SfxStyleFamily) nFamily);
229 // do not set presentation styles, they will be set implicit
230 if ( pStyleSheet && pStyleSheet->GetFamily() != SD_STYLE_FAMILY_PSEUDO )
232 SfxStyleSheet* pOldStyleSheet = mpView->GetStyleSheet();
233 OUString aStr;
235 if( // if the object had no style sheet, allow all
236 !pOldStyleSheet ||
238 // allow if old and new style sheet has same family
239 pStyleSheet->GetFamily() == pOldStyleSheet->GetFamily() ||
241 // allow if old was background objects and new is graphics
242 (pStyleSheet->GetFamily() == SD_STYLE_FAMILY_GRAPHICS && pOldStyleSheet->GetHelpId( aStr ) == HID_PSEUDOSHEET_BACKGROUNDOBJECTS) ||
244 // allow if old was presentation and we are a drawing document
245 (pOldStyleSheet->GetFamily() == SD_STYLE_FAMILY_MASTERPAGE && mpDoc->GetDocumentType() == DOCUMENT_TYPE_DRAW) )
247 mpView->SetStyleSheet( static_cast<SfxStyleSheet*>(pStyleSheet));
248 mpDoc->SetChanged(true);
249 mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_STYLE_FAMILY2 );
252 break;
254 case SID_STYLE_WATERCAN:
256 if( !SD_MOD()->GetWaterCan() )
258 if (pArgs && pArgs->GetItemState( nSId ) == SfxItemState::SET)
260 aStyleName = static_cast<const SfxStringItem &>( pArgs->Get( nSId ) ).GetValue();
261 SD_MOD()->SetWaterCan( true );
262 pStyleSheet = pSSPool->Find( aStyleName, (SfxStyleFamily) nFamily);
264 // no presentation object templates, they are only allowed implicitly
265 if( pStyleSheet && pStyleSheet->GetFamily() != SD_STYLE_FAMILY_PSEUDO )
267 static_cast<SdStyleSheetPool*>( pSSPool )->SetActualStyleSheet( pStyleSheet );
269 // we switch explicitly into selection mode
270 mpViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_OBJECT_SELECT,
271 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD );
274 else
275 SD_MOD()->SetWaterCan( false );
277 else
279 SD_MOD()->SetWaterCan( false );
280 // we have to re-enable to tools-bar
281 mpViewShell->Invalidate();
284 break;
286 default:
287 break;
290 switch( nSId )
292 case SID_STYLE_NEW:
293 case SID_STYLE_EDIT:
295 PresentationObjects ePO = PO_OUTLINE_1;
297 if( pStyleSheet )
299 boost::scoped_ptr<SfxAbstractTabDialog> pStdDlg;
300 boost::scoped_ptr<SfxAbstractTabDialog> pPresDlg;
301 SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
302 bool bOldDocInOtherLanguage = false;
303 SfxItemSet aOriSet( pStyleSheet->GetItemSet() );
305 SfxStyleFamily eFamily = pStyleSheet->GetFamily();
307 if (eFamily == SD_STYLE_FAMILY_GRAPHICS)
309 pStdDlg.reset(pFact ? pFact->CreateSdTabTemplateDlg( 0, mpDoc->GetDocSh(), *pStyleSheet, mpDoc, mpView ) : 0);
311 else if (eFamily == SD_STYLE_FAMILY_PSEUDO)
313 OUString aName(pStyleSheet->GetName());
314 sal_uInt16 nDlgId = 0;
316 if (aName == SD_RESSTR(STR_PSEUDOSHEET_TITLE))
318 nDlgId = TAB_PRES_LAYOUT_TEMPLATE;
319 ePO = PO_TITLE;
321 else if (aName == SD_RESSTR(STR_PSEUDOSHEET_SUBTITLE))
323 nDlgId = TAB_PRES_LAYOUT_TEMPLATE;
324 ePO = PO_SUBTITLE;
326 else if (aName ==
327 SD_RESSTR(STR_PSEUDOSHEET_BACKGROUND))
329 nDlgId = TAB_PRES_LAYOUT_TEMPLATE_BACKGROUND;
330 ePO = PO_BACKGROUND;
332 else if (aName ==
333 SD_RESSTR(STR_PSEUDOSHEET_BACKGROUNDOBJECTS))
335 nDlgId = TAB_PRES_LAYOUT_TEMPLATE;
336 ePO = PO_BACKGROUNDOBJECTS;
338 else if (aName ==
339 SD_RESSTR(STR_PSEUDOSHEET_NOTES))
341 nDlgId = TAB_PRES_LAYOUT_TEMPLATE;
342 ePO = PO_NOTES;
344 else if(aName.indexOf(SD_RESSTR(STR_PSEUDOSHEET_OUTLINE)) != -1)
346 nDlgId = TAB_PRES_LAYOUT_TEMPLATE;
348 OUString aOutlineStr(SD_RESSTR(STR_PSEUDOSHEET_OUTLINE));
349 // determine number, mind the blank between name and number
350 OUString aNumStr(aName.copy(aOutlineStr.getLength() + 1));
351 sal_uInt16 nLevel = (sal_uInt16)aNumStr.toInt32();
352 switch (nLevel)
354 case 1: ePO = PO_OUTLINE_1; break;
355 case 2: ePO = PO_OUTLINE_2; break;
356 case 3: ePO = PO_OUTLINE_3; break;
357 case 4: ePO = PO_OUTLINE_4; break;
358 case 5: ePO = PO_OUTLINE_5; break;
359 case 6: ePO = PO_OUTLINE_6; break;
360 case 7: ePO = PO_OUTLINE_7; break;
361 case 8: ePO = PO_OUTLINE_8; break;
362 case 9: ePO = PO_OUTLINE_9; break;
365 else
367 OSL_FAIL("StyleSheet from older version with different language");
368 bOldDocInOtherLanguage = true;
371 if( !bOldDocInOtherLanguage )
373 pPresDlg.reset(pFact ? pFact->CreateSdPresLayoutTemplateDlg( mpDocSh, NULL, SdResId(nDlgId), *pStyleSheet, ePO, pSSPool ) : 0);
376 else if (eFamily == SD_STYLE_FAMILY_CELL)
380 sal_uInt16 nResult = RET_CANCEL;
381 const SfxItemSet* pOutSet = NULL;
382 if (pStdDlg)
384 nResult = pStdDlg->Execute();
385 pOutSet = pStdDlg->GetOutputItemSet();
387 else if( pPresDlg )
389 nResult = pPresDlg->Execute();
390 pOutSet = pPresDlg->GetOutputItemSet();
393 switch( nResult )
395 case RET_OK:
397 nRetMask = pStyleSheet->GetMask();
399 if (eFamily == SD_STYLE_FAMILY_PSEUDO)
401 SfxItemSet aTempSet(*pOutSet);
402 static_cast<SdStyleSheet*>(pStyleSheet)->AdjustToFontHeight(aTempSet);
404 /* Special treatment: reset the INVALIDS to
405 NULL-Pointer (otherwise INVALIDs or pointer point
406 to DefaultItems in the template; both would
407 prevent the attribute inheritance) */
408 aTempSet.ClearInvalidItems();
410 // EE_PARA_NUMBULLET item is only valid in first outline template
411 if( (ePO >= PO_OUTLINE_2) && (ePO <= PO_OUTLINE_9) )
413 if (aTempSet.GetItemState(EE_PARA_NUMBULLET) == SfxItemState::SET)
415 SvxNumRule aRule(*static_cast<const SvxNumBulletItem*>(aTempSet.GetItem(EE_PARA_NUMBULLET))->GetNumRule());
417 OUString sStyleName(SD_RESSTR(STR_PSEUDOSHEET_OUTLINE) + " 1");
418 SfxStyleSheetBase* pFirstStyleSheet = pSSPool->Find( sStyleName, SD_STYLE_FAMILY_PSEUDO);
420 if(pFirstStyleSheet)
422 pFirstStyleSheet->GetItemSet().Put( SvxNumBulletItem( aRule, EE_PARA_NUMBULLET ));
423 SdStyleSheet* pRealSheet = static_cast<SdStyleSheet*>(pFirstStyleSheet)->GetRealStyleSheet();
424 pRealSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
427 aTempSet.ClearItem( EE_PARA_NUMBULLET );
431 pStyleSheet->GetItemSet().Put(aTempSet);
432 SdStyleSheet::BroadcastSdStyleSheetChange(pStyleSheet, ePO, pSSPool);
435 SfxItemSet& rAttr = pStyleSheet->GetItemSet();
437 sdr::properties::CleanupFillProperties( rAttr );
439 // check for unique names of named items for xml
440 if( rAttr.GetItemState( XATTR_FILLBITMAP ) == SfxItemState::SET )
442 const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_FILLBITMAP );
443 SfxPoolItem* pNewItem = static_cast<const XFillBitmapItem*>(pOldItem)->checkForUniqueItem( mpDoc );
444 if( pNewItem )
446 rAttr.Put( *pNewItem );
447 delete pNewItem;
450 if( rAttr.GetItemState( XATTR_LINEDASH ) == SfxItemState::SET )
452 const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_LINEDASH );
453 SfxPoolItem* pNewItem = static_cast<const XLineDashItem*>(pOldItem)->checkForUniqueItem( mpDoc );
454 if( pNewItem )
456 rAttr.Put( *pNewItem );
457 delete pNewItem;
460 if( rAttr.GetItemState( XATTR_LINESTART ) == SfxItemState::SET )
462 const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_LINESTART );
463 SfxPoolItem* pNewItem = static_cast<const XLineStartItem*>(pOldItem)->checkForUniqueItem( mpDoc );
464 if( pNewItem )
466 rAttr.Put( *pNewItem );
467 delete pNewItem;
470 if( rAttr.GetItemState( XATTR_LINEEND ) == SfxItemState::SET )
472 const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_LINEEND );
473 SfxPoolItem* pNewItem = static_cast<const XLineEndItem*>(pOldItem)->checkForUniqueItem( mpDoc );
474 if( pNewItem )
476 rAttr.Put( *pNewItem );
477 delete pNewItem;
480 if( rAttr.GetItemState( XATTR_FILLGRADIENT ) == SfxItemState::SET )
482 const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_FILLGRADIENT );
483 SfxPoolItem* pNewItem = static_cast<const XFillGradientItem*>(pOldItem)->checkForUniqueItem( mpDoc );
484 if( pNewItem )
486 rAttr.Put( *pNewItem );
487 delete pNewItem;
490 if( rAttr.GetItemState( XATTR_FILLFLOATTRANSPARENCE ) == SfxItemState::SET )
492 const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_FILLFLOATTRANSPARENCE );
493 SfxPoolItem* pNewItem = static_cast<const XFillFloatTransparenceItem*>(pOldItem)->checkForUniqueItem( mpDoc );
494 if( pNewItem )
496 rAttr.Put( *pNewItem );
497 delete pNewItem;
500 if( rAttr.GetItemState( XATTR_FILLHATCH ) == SfxItemState::SET )
502 const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_FILLHATCH );
503 SfxPoolItem* pNewItem = static_cast<const XFillHatchItem*>(pOldItem)->checkForUniqueItem( mpDoc );
504 if( pNewItem )
506 rAttr.Put( *pNewItem );
507 delete pNewItem;
511 static_cast<SfxStyleSheet*>( pStyleSheet )->Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
513 DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >( mpViewShell );
514 if( pDrawViewShell )
516 PageKind ePageKind = pDrawViewShell->GetPageKind();
517 if( ePageKind == PK_NOTES || ePageKind == PK_HANDOUT )
519 SdPage* pPage = mpViewShell->GetActualPage();
521 if(pDrawViewShell->GetEditMode() == EM_MASTERPAGE)
523 pPage = static_cast<SdPage*>((&(pPage->TRG_GetMasterPage())));
526 if( pPage )
528 SdrObjListIter aIter( *pPage );
529 while( aIter.IsMore() )
531 SdrObject* pObj = aIter.Next();
532 if( pObj->ISA(SdrPageObj) )
534 // repaint only
535 pObj->ActionChanged();
536 // pObj->SendRepaintBroadcast();
543 if( mpDoc->GetOnlineSpell() )
545 const SfxPoolItem* pTempItem;
546 if( SfxItemState::SET == rAttr.GetItemState(EE_CHAR_LANGUAGE, false, &pTempItem ) ||
547 SfxItemState::SET == rAttr.GetItemState(EE_CHAR_LANGUAGE_CJK, false, &pTempItem ) ||
548 SfxItemState::SET == rAttr.GetItemState(EE_CHAR_LANGUAGE_CTL, false, &pTempItem ) )
550 mpDoc->StopOnlineSpelling();
551 mpDoc->StartOnlineSpelling();
555 mpDoc->SetChanged(true);
557 break;
559 default:
561 if( nSId == SID_STYLE_NEW )
562 pSSPool->Remove( pStyleSheet );
564 return; // Cancel
568 break;
570 case SID_STYLE_NEW_BY_EXAMPLE:
572 if( pStyleSheet )
574 nRetMask = pStyleSheet->GetMask();
575 SfxItemSet aCoreSet( mpDoc->GetPool() );
576 mpView->GetAttributes( aCoreSet, true );
578 // if the object had a template, this becomes parent of the new template
579 SfxStyleSheet* pOldStyle = mpView->GetStyleSheet();
581 // if pOldStyle == pStyleSheet -> recursion
582 if( pOldStyle != pStyleSheet )
584 if (pOldStyle)
586 pStyleSheet->SetParent(pOldStyle->GetName());
589 SfxItemSet* pStyleSet = &pStyleSheet->GetItemSet();
590 pStyleSet->Put(aCoreSet);
592 /* apply template (but not when somebody is editing a text.
593 To do this, the edit engine had to be capable to use
594 templates on a character level. */
595 if (!mpView->GetTextEditObject())
597 mpView->SetStyleSheet( static_cast<SfxStyleSheet*>(pStyleSheet));
600 static_cast<SfxStyleSheet*>( pStyleSheet )->Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
601 mpDoc->SetChanged(true);
603 mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_STYLE_FAMILY2 );
607 break;
609 case SID_STYLE_UPDATE_BY_EXAMPLE:
611 if ((mpView->AreObjectsMarked() && mpView->GetMarkedObjectList().GetMarkCount() == 1) ||
612 mpView->ISA(OutlineView))
614 pStyleSheet = mpView->GetStyleSheet();
616 if( pStyleSheet )
618 nRetMask = pStyleSheet->GetMask();
619 SfxItemSet aCoreSet( mpDoc->GetPool() );
620 mpView->GetAttributes( aCoreSet );
622 SfxItemSet* pStyleSet = &pStyleSheet->GetItemSet();
623 pStyleSet->Put( aCoreSet );
625 mpView->SetStyleSheet( static_cast<SfxStyleSheet*>(pStyleSheet));
627 static_cast<SfxStyleSheet*>( pStyleSheet )->Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
628 mpDoc->SetChanged(true);
629 mpViewShell->GetViewFrame()->GetBindings().Invalidate( SID_STYLE_FAMILY2 );
633 break;
636 if( nRetMask != SFXSTYLEBIT_ALL )
637 rReq.SetReturnValue( SfxUInt16Item( nSId, nRetMask ) );
640 void FuTemplate::Activate()
644 void FuTemplate::Deactivate()
648 } // end of namespace sd
650 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */