1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
22 #include <svx/svxids.hrc>
23 #include <sfx2/request.hxx>
24 #include <sfx2/viewfrm.hxx>
25 #include <sfx2/bindings.hxx>
26 #include <ViewShell.hxx>
28 #include <drawdoc.hxx>
30 #include <svx/svxdlg.hxx>
34 FuArea::FuArea( ViewShell
* pViewSh
, ::sd::Window
* pWin
, ::sd::View
* _pView
, SdDrawDocument
* pDoc
, SfxRequest
& rReq
)
35 : FuPoor(pViewSh
, pWin
, _pView
, pDoc
, rReq
)
39 rtl::Reference
<FuPoor
> FuArea::Create( ViewShell
* pViewSh
, ::sd::Window
* pWin
, ::sd::View
* _pView
, SdDrawDocument
* pDoc
, SfxRequest
& rReq
)
41 rtl::Reference
<FuPoor
> xFunc( new FuArea( pViewSh
, pWin
, _pView
, pDoc
, rReq
) );
42 xFunc
->DoExecute(rReq
);
46 void FuArea::DoExecute( SfxRequest
& rReq
)
50 const SfxItemSet
* pArgs
= rReq
.GetArgs();
54 SfxItemSet
aNewAttr( mpDoc
->GetPool() );
55 mpView
->GetAttributes( aNewAttr
);
57 SvxAbstractDialogFactory
* pFact
= SvxAbstractDialogFactory::Create();
58 VclPtr
<AbstractSvxAreaTabDialog
> pDlg(pFact
->CreateSvxAreaTabDialog(mpViewShell
->GetFrameWeld(), &aNewAttr
, mpDoc
, true));
60 pDlg
->StartExecuteAsync([pDlg
, this](sal_Int32 nResult
){
61 if (nResult
== RET_OK
)
63 mpView
->SetAttributes (*(pDlg
->GetOutputItemSet ()));
65 // attributes changed, update Listboxes in Objectbars
66 static const sal_uInt16 SidArray
[] = {
69 SID_ATTR_FILL_GRADIENT
,
72 SID_ATTR_FILL_TRANSPARENCE
,
73 SID_ATTR_FILL_FLOATTRANSPARENCE
,
76 mpViewShell
->GetViewFrame()->GetBindings().Invalidate( SidArray
);
79 // deferred until the dialog ends
80 mpViewShell
->Cancel();
86 void FuArea::Activate()
90 void FuArea::Deactivate()
94 } // end of namespace sd
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */