1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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
51 #include "drawdoc.hxx"
52 #include "sdabstdlg.hxx"
56 TYPEINIT1( FuOutlineBullet
, FuPoor
);
58 /*************************************************************************
62 \************************************************************************/
64 FuOutlineBullet::FuOutlineBullet(ViewShell
* pViewShell
, ::sd::Window
* pWindow
,
65 ::sd::View
* pView
, SdDrawDocument
* pDoc
,
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
);
78 void FuOutlineBullet::DoExecute( SfxRequest
& rReq
)
80 const SfxItemSet
* pArgs
= rReq
.GetArgs();
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;
97 USHORT nResult
= pDlg
->Execute();
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
) ) );
118 pOLV
->EnableBullets();
121 pArgs
= rReq
.GetArgs();
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
);
142 // evtl. Betroffene Felder invalidieren
143 mpViewShell->Invalidate( FN_NUM_BULLET_ON );
149 } // end of namespace sd