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: fuline.cxx,v $
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"
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"
49 #ifndef SD_WINDOW_SHELL_HXX
52 #include "drawdoc.hxx"
54 #include <svx/svxdlg.hxx>
55 #include <svx/dialogs.hrc>
59 TYPEINIT1( FuLine
, FuPoor
);
61 /*************************************************************************
65 \************************************************************************/
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
);
84 void FuLine::DoExecute( SfxRequest
& rReq
)
86 BOOL bHasMarked
= mpView
->AreObjectsMarked();
88 const SfxItemSet
* pArgs
= rReq
.GetArgs();
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
[] = {
115 mpViewShell
->GetViewFrame()->GetBindings().Invalidate( SidArray
);
124 void FuLine::Activate()
128 void FuLine::Deactivate()
133 } // end of namespace sd