Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include "fuolbull.hxx"
30 : : #include <vcl/msgbox.hxx>
31 : : #include <svl/intitem.hxx>
32 : : #include <editeng/outliner.hxx>
33 : : #include <editeng/eeitem.hxx>
34 : : #include <sfx2/request.hxx>
35 : :
36 : : #include <editeng/editdata.hxx>
37 : : #include <svx/svxids.hrc>
38 : : #include "OutlineView.hxx"
39 : : #include "OutlineViewShell.hxx"
40 : : #include "DrawViewShell.hxx"
41 : : #include "Window.hxx"
42 : : #include "drawdoc.hxx"
43 : : #include "sdabstdlg.hxx"
44 : :
45 : : namespace sd {
46 : :
47 [ # # ][ # # ]: 0 : TYPEINIT1( FuOutlineBullet, FuPoor );
48 : :
49 : : /*************************************************************************
50 : : |*
51 : : |* Konstruktor
52 : : |*
53 : : \************************************************************************/
54 : :
55 : 0 : FuOutlineBullet::FuOutlineBullet(ViewShell* pViewShell, ::sd::Window* pWindow,
56 : : ::sd::View* pView, SdDrawDocument* pDoc,
57 : : SfxRequest& rReq)
58 : 0 : : FuPoor(pViewShell, pWindow, pView, pDoc, rReq)
59 : : {
60 : 0 : }
61 : :
62 : 0 : FunctionReference FuOutlineBullet::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq )
63 : : {
64 [ # # ][ # # ]: 0 : FunctionReference xFunc( new FuOutlineBullet( pViewSh, pWin, pView, pDoc, rReq ) );
65 [ # # ]: 0 : xFunc->DoExecute(rReq);
66 : 0 : return xFunc;
67 : : }
68 : :
69 : 0 : void FuOutlineBullet::DoExecute( SfxRequest& rReq )
70 : : {
71 : 0 : const SfxItemSet* pArgs = rReq.GetArgs();
72 : :
73 [ # # ]: 0 : if( !pArgs )
74 : : {
75 : : // ItemSet fuer Dialog fuellen
76 [ # # ]: 0 : SfxItemSet aEditAttr( mpDoc->GetPool() );
77 [ # # ]: 0 : mpView->GetAttributes( aEditAttr );
78 : :
79 : 0 : SfxItemSet aNewAttr( mpViewShell->GetPool(),
80 [ # # ]: 0 : EE_ITEMS_START, EE_ITEMS_END );
81 [ # # ]: 0 : aNewAttr.Put( aEditAttr, sal_False );
82 : :
83 : : // Dialog hochfahren und ausfuehren
84 [ # # ]: 0 : SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
85 [ # # ][ # # ]: 0 : SfxAbstractTabDialog* pDlg = pFact ? pFact->CreateSdOutlineBulletTabDlg( NULL, &aNewAttr, mpView ) : 0;
86 [ # # ]: 0 : if( pDlg )
87 : : {
88 [ # # ]: 0 : sal_uInt16 nResult = pDlg->Execute();
89 : :
90 [ # # ]: 0 : switch( nResult )
91 : : {
92 : : case RET_OK:
93 : : {
94 [ # # ][ # # ]: 0 : SfxItemSet aSet( *pDlg->GetOutputItemSet() );
95 : :
96 : 0 : OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
97 : :
98 : : SAL_WNODEPRECATED_DECLARATIONS_PUSH
99 : 0 : std::auto_ptr< OutlineViewModelChangeGuard > aGuard;
100 : : SAL_WNODEPRECATED_DECLARATIONS_POP
101 : :
102 [ # # ][ # # ]: 0 : if (mpView->ISA(OutlineView))
[ # # ]
103 : : {
104 : : pOLV = static_cast<OutlineView*>(mpView)
105 [ # # ][ # # ]: 0 : ->GetViewByWindow(mpViewShell->GetActiveWindow());
106 : :
107 [ # # ][ # # ]: 0 : aGuard.reset( new OutlineViewModelChangeGuard( static_cast<OutlineView&>(*mpView) ) );
108 : : }
109 : :
110 [ # # ]: 0 : if( pOLV )
111 [ # # ]: 0 : pOLV->EnableBullets();
112 : :
113 [ # # ]: 0 : rReq.Done( aSet );
114 [ # # ][ # # ]: 0 : pArgs = rReq.GetArgs();
115 : : }
116 : 0 : break;
117 : :
118 : : default:
119 : : {
120 [ # # ][ # # ]: 0 : delete pDlg;
121 : 0 : return;
122 : : }
123 : : }
124 : :
125 [ # # ][ # # ]: 0 : delete pDlg;
126 [ # # ][ # # ]: 0 : }
[ # # ][ # # ]
127 : : }
128 : :
129 : : // nicht direkt an pOlView, damit SdDrawView::SetAttributes
130 : : // Aenderungen auf der Masterpage abfangen und in eine
131 : : // Vorlage umleiten kann
132 : 0 : mpView->SetAttributes(*pArgs);
133 : :
134 : : /* #i35937#
135 : : // evtl. Betroffene Felder invalidieren
136 : : mpViewShell->Invalidate( FN_NUM_BULLET_ON );
137 : : */
138 : : }
139 : :
140 : :
141 : :
142 : : } // end of namespace sd
143 : :
144 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|