Update ooo320-m1
[ooovba.git] / sd / source / ui / func / fuline.cxx
blob641f04441fef1ac92a912dfe39c300bd140ae935
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: fuline.cxx,v $
10 * $Revision: 1.13 $
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 "fuline.hxx"
37 #include <svx/svxids.hrc>
38 #include <svx/tabline.hxx>
39 #include <svx/xenum.hxx>
40 #include <vcl/msgbox.hxx>
41 #include <svtools/intitem.hxx>
42 #include <svtools/stritem.hxx>
43 #include <sfx2/request.hxx>
44 #include <svx/xdef.hxx>
45 #include <sfx2/bindings.hxx>
46 #include <sfx2/viewfrm.hxx>
47 #include "ViewShell.hxx"
48 #include "View.hxx"
49 #ifndef SD_WINDOW_SHELL_HXX
50 #include "Window.hxx"
51 #endif
52 #include "drawdoc.hxx"
53 #include "app.hrc"
54 #include <svx/svxdlg.hxx>
55 #include <svx/dialogs.hrc>
57 namespace sd {
59 TYPEINIT1( FuLine, FuPoor );
61 /*************************************************************************
63 |* Konstruktor
65 \************************************************************************/
67 FuLine::FuLine (
68 ViewShell* pViewSh,
69 ::sd::Window* pWin,
70 ::sd::View* pView,
71 SdDrawDocument* pDoc,
72 SfxRequest& rReq)
73 : FuPoor(pViewSh, pWin, pView, pDoc, rReq)
77 FunctionReference FuLine::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq )
79 FunctionReference xFunc( new FuLine( pViewSh, pWin, pView, pDoc, rReq ) );
80 xFunc->DoExecute(rReq);
81 return xFunc;
84 void FuLine::DoExecute( SfxRequest& rReq )
86 BOOL bHasMarked = mpView->AreObjectsMarked();
88 const SfxItemSet* pArgs = rReq.GetArgs();
90 if( !pArgs )
92 const SdrObject* pObj = NULL;
93 const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
94 if( rMarkList.GetMarkCount() == 1 )
95 pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
97 SfxItemSet* pNewAttr = new SfxItemSet( mpDoc->GetPool() );
98 mpView->GetAttributes( *pNewAttr );
100 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
101 SfxAbstractTabDialog * pDlg = pFact ? pFact->CreateSvxLineTabDialog(NULL,pNewAttr,mpDoc,RID_SVXDLG_LINE,pObj,bHasMarked) : 0;
102 if( pDlg && (pDlg->Execute() == RET_OK) )
104 mpView->SetAttributes (*(pDlg->GetOutputItemSet ()));
107 // Attribute wurden geaendert, Listboxes in Objectbars muessen aktualisiert werden
108 static USHORT SidArray[] = {
109 SID_ATTR_LINE_STYLE,
110 SID_ATTR_LINE_DASH,
111 SID_ATTR_LINE_WIDTH,
112 SID_ATTR_LINE_COLOR,
113 0 };
115 mpViewShell->GetViewFrame()->GetBindings().Invalidate( SidArray );
117 delete pDlg;
118 delete pNewAttr;
121 rReq.Ignore ();
124 void FuLine::Activate()
128 void FuLine::Deactivate()
133 } // end of namespace sd