LibreOffice Module sd (master) 1
fuarea.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include <fuarea.hxx>
21
22#include <svx/svxids.hrc>
23#include <sfx2/request.hxx>
24#include <sfx2/viewfrm.hxx>
25#include <sfx2/bindings.hxx>
26#include <ViewShell.hxx>
27
28#include <drawdoc.hxx>
29#include <View.hxx>
30#include <svx/svxdlg.hxx>
31
32namespace sd {
33
35: FuPoor(pViewSh, pWin, _pView, pDoc, rReq)
36{
37}
38
40{
41 rtl::Reference<FuPoor> xFunc( new FuArea( pViewSh, pWin, _pView, pDoc, rReq ) );
42 xFunc->DoExecute(rReq);
43 return xFunc;
44}
45
47{
48 rReq.Ignore ();
49
50 const SfxItemSet* pArgs = rReq.GetArgs();
51 if (pArgs)
52 return;
53
54 SfxItemSet aNewAttr( mpDoc->GetPool() );
55 mpView->GetAttributes( aNewAttr );
56
58 bool bHasSlideBackground = mpViewShell->GetDoc()->GetDocumentType() == DocumentType::Impress;
60 pFact->CreateSvxAreaTabDialog(mpViewShell->GetFrameWeld(), &aNewAttr, mpDoc, true, bHasSlideBackground));
61
62 pDlg->StartExecuteAsync([pDlg, pView = this->mpView, pViewShell = this->mpViewShell](sal_Int32 nResult){
63 if (nResult == RET_OK)
64 {
65 pView->SetAttributes (*(pDlg->GetOutputItemSet ()));
66
67 // attributes changed, update Listboxes in Objectbars
68 static const sal_uInt16 SidArray[] = {
69 SID_ATTR_FILL_STYLE,
70 SID_ATTR_FILL_COLOR,
71 SID_ATTR_FILL_GRADIENT,
72 SID_ATTR_FILL_HATCH,
73 SID_ATTR_FILL_BITMAP,
74 SID_ATTR_FILL_TRANSPARENCE,
75 SID_ATTR_FILL_FLOATTRANSPARENCE,
76 SID_ATTR_FILL_USE_SLIDE_BACKGROUND,
77 0 };
78
79 pViewShell->GetViewFrame()->GetBindings().Invalidate( SidArray );
80 }
81
82 // deferred until the dialog ends
83 pViewShell->Cancel();
84
85 pDlg->disposeOnce();
86 });
87}
88
90{
91}
92
94{
95}
96
97} // end of namespace sd
98
99/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_DLLPRIVATE SfxItemPool & GetPool()
Definition: drawdoc.hxx:237
SAL_DLLPRIVATE DocumentType GetDocumentType() const
Definition: drawdoc.hxx:251
void Ignore()
const SfxItemSet * GetArgs() const
virtual VclPtr< AbstractSvxAreaTabDialog > CreateSvxAreaTabDialog(weld::Window *pParent, const SfxItemSet *pAttr, SdrModel *pModel, bool bShadow, bool bSlideBackground)=0
static SvxAbstractDialogFactory * Create()
virtual void Activate() override
activates the function
Definition: fuarea.cxx:89
virtual void DoExecute(SfxRequest &rReq) override
Definition: fuarea.cxx:46
virtual void Deactivate() override
deactivates the function
Definition: fuarea.cxx:93
FuArea(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fuarea.cxx:34
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fuarea.cxx:39
Base class for all functions.
Definition: fupoor.hxx:48
SdDrawDocument * mpDoc
Definition: fupoor.hxx:148
ViewShell * mpViewShell
Definition: fupoor.hxx:145
::sd::View * mpView
Definition: fupoor.hxx:144
Base class of the stacked shell hierarchy.
Definition: ViewShell.hxx:92
SdDrawDocument * GetDoc() const
Definition: viewshel.cxx:1412
SD_DLLPUBLIC weld::Window * GetFrameWeld() const
Definition: viewshel.cxx:1582
virtual void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr=false) const
Definition: sdview.cxx:515
An SdWindow contains the actual working area of ViewShell.
Definition: Window.hxx:45
const sal_uInt16 SidArray[]
Definition: fuoltext.cxx:43
RET_OK