xref: /trunk/main/sd/source/ui/func/fuarea.cxx (revision 64b14621)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sd.hxx"
26 
27 
28 #include "fuarea.hxx"
29 
30 #include <svx/svxids.hrc>
31 #include <svx/tabarea.hxx>
32 #include <vcl/msgbox.hxx>
33 #include <svl/intitem.hxx>
34 #include <svl/stritem.hxx>
35 #include <sfx2/request.hxx>
36 #include <sfx2/viewfrm.hxx>
37 #include <sfx2/bindings.hxx>
38 #include "ViewShell.hxx"
39 
40 #include "drawdoc.hxx"
41 #include "View.hxx"
42 #include "Window.hxx"
43 #include "app.hrc"
44 #include <svx/svxdlg.hxx>
45 #include <svx/dialogs.hrc>
46 
47 namespace sd {
48 TYPEINIT1( FuArea, FuPoor );
49 
50 /*************************************************************************
51 |*
52 |* Konstruktor
53 |*
54 \************************************************************************/
55 
FuArea(ViewShell * pViewSh,::sd::Window * pWin,::sd::View * _pView,SdDrawDocument * pDoc,SfxRequest & rReq)56 FuArea::FuArea( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* _pView, SdDrawDocument* pDoc, SfxRequest& rReq)
57 : FuPoor(pViewSh, pWin, _pView, pDoc, rReq)
58 {
59 }
60 
Create(ViewShell * pViewSh,::sd::Window * pWin,::sd::View * _pView,SdDrawDocument * pDoc,SfxRequest & rReq)61 FunctionReference FuArea::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* _pView, SdDrawDocument* pDoc, SfxRequest& rReq )
62 {
63 	FunctionReference xFunc( new FuArea( pViewSh, pWin, _pView, pDoc, rReq ) );
64 	xFunc->DoExecute(rReq);
65 	return xFunc;
66 }
67 
DoExecute(SfxRequest & rReq)68 void FuArea::DoExecute( SfxRequest& rReq )
69 {
70 	const SfxItemSet* pArgs = rReq.GetArgs();
71 
72 	if( !pArgs )
73 	{
74 		SfxItemSet aNewAttr( mpDoc->GetPool() );
75 		mpView->GetAttributes( aNewAttr );
76 
77 		SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
78 		AbstractSvxAreaTabDialog * pDlg = pFact ? pFact->CreateSvxAreaTabDialog( NULL,
79 																		&aNewAttr,
80 																		mpDoc,
81 																		true) : 0;
82 		if( pDlg && (pDlg->Execute() == RET_OK) )
83 		{
84 			mpView->SetAttributes (*(pDlg->GetOutputItemSet ()));
85 		}
86 
87 		// Attribute wurden geaendert, Listboxes in Objectbars muessen aktualisiert werden
88 		static sal_uInt16 SidArray[] = {
89 						SID_ATTR_FILL_STYLE,
90 						SID_ATTR_FILL_COLOR,
91 						SID_ATTR_FILL_GRADIENT,
92 						SID_ATTR_FILL_HATCH,
93 						SID_ATTR_FILL_BITMAP,
94                         SID_ATTR_FILL_TRANSPARENCE,
95                         SID_ATTR_FILL_FLOATTRANSPARENCE,
96 						0 };
97 
98 		mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArray );
99 
100 		delete pDlg;
101 	}
102 
103 	rReq.Ignore ();
104 
105 }
106 
Activate()107 void FuArea::Activate()
108 {
109 }
110 
Deactivate()111 void FuArea::Deactivate()
112 {
113 }
114 
115 } // end of namespace sd
116