Update ooo320-m1
[ooovba.git] / sd / source / ui / func / fuolbull.cxx
blobbdaa998557749f3649f28ef3dfa3e6000cbf5a8f
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fuolbull.cxx,v $
10 * $Revision: 1.11.104.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sd.hxx"
35 #include "fuolbull.hxx"
36 #include <vcl/msgbox.hxx>
37 #include <svtools/intitem.hxx>
38 #include <svx/outliner.hxx>
39 #include <svx/eeitem.hxx>
40 #include <sfx2/request.hxx>
41 #include <svtools/intitem.hxx>
43 #include <svx/editdata.hxx>
44 #include <svx/svxids.hrc>
45 #include "OutlineView.hxx"
46 #include "OutlineViewShell.hxx"
47 #include "DrawViewShell.hxx"
48 #ifndef SD_WINDOW_SHELL_HXX
49 #include "Window.hxx"
50 #endif
51 #include "drawdoc.hxx"
52 #include "sdabstdlg.hxx"
54 namespace sd {
56 TYPEINIT1( FuOutlineBullet, FuPoor );
58 /*************************************************************************
60 |* Konstruktor
62 \************************************************************************/
64 FuOutlineBullet::FuOutlineBullet(ViewShell* pViewShell, ::sd::Window* pWindow,
65 ::sd::View* pView, SdDrawDocument* pDoc,
66 SfxRequest& rReq)
67 : FuPoor(pViewShell, pWindow, pView, pDoc, rReq)
71 FunctionReference FuOutlineBullet::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq )
73 FunctionReference xFunc( new FuOutlineBullet( pViewSh, pWin, pView, pDoc, rReq ) );
74 xFunc->DoExecute(rReq);
75 return xFunc;
78 void FuOutlineBullet::DoExecute( SfxRequest& rReq )
80 const SfxItemSet* pArgs = rReq.GetArgs();
82 if( !pArgs )
84 // ItemSet fuer Dialog fuellen
85 SfxItemSet aEditAttr( mpDoc->GetPool() );
86 mpView->GetAttributes( aEditAttr );
88 SfxItemSet aNewAttr( mpViewShell->GetPool(),
89 EE_ITEMS_START, EE_ITEMS_END );
90 aNewAttr.Put( aEditAttr, FALSE );
92 // Dialog hochfahren und ausfuehren
93 SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
94 SfxAbstractTabDialog* pDlg = pFact ? pFact->CreateSdOutlineBulletTabDlg( NULL, &aNewAttr, mpView ) : 0;
95 if( pDlg )
97 USHORT nResult = pDlg->Execute();
99 switch( nResult )
101 case RET_OK:
103 SfxItemSet aSet( *pDlg->GetOutputItemSet() );
105 OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
107 std::auto_ptr< OutlineViewModelChangeGuard > aGuard;
109 if (mpView->ISA(OutlineView))
111 pOLV = static_cast<OutlineView*>(mpView)
112 ->GetViewByWindow(mpViewShell->GetActiveWindow());
114 aGuard.reset( new OutlineViewModelChangeGuard( static_cast<OutlineView&>(*mpView) ) );
117 if( pOLV )
118 pOLV->EnableBullets();
120 rReq.Done( aSet );
121 pArgs = rReq.GetArgs();
123 break;
125 default:
127 delete pDlg;
128 return;
132 delete pDlg;
136 // nicht direkt an pOlView, damit SdDrawView::SetAttributes
137 // Aenderungen auf der Masterpage abfangen und in eine
138 // Vorlage umleiten kann
139 mpView->SetAttributes(*pArgs);
141 /* #i35937#
142 // evtl. Betroffene Felder invalidieren
143 mpViewShell->Invalidate( FN_NUM_BULLET_ON );
149 } // end of namespace sd