/src/libreoffice/sd/source/ui/func/fuarea.cxx
Line | Count | Source |
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 | | |
32 | | namespace sd { |
33 | | |
34 | | FuArea::FuArea( ViewShell& rViewSh, ::sd::Window* pWin, ::sd::View* _pView, SdDrawDocument& rDoc, SfxRequest& rReq) |
35 | 0 | : FuPoor(rViewSh, pWin, _pView, rDoc, rReq) |
36 | 0 | { |
37 | 0 | } |
38 | | |
39 | | rtl::Reference<FuPoor> FuArea::Create( ViewShell& rViewSh, ::sd::Window* pWin, ::sd::View* _pView, SdDrawDocument& rDoc, SfxRequest& rReq ) |
40 | 0 | { |
41 | 0 | rtl::Reference<FuPoor> xFunc( new FuArea( rViewSh, pWin, _pView, rDoc, rReq ) ); |
42 | 0 | xFunc->DoExecute(rReq); |
43 | 0 | return xFunc; |
44 | 0 | } |
45 | | |
46 | | void FuArea::DoExecute( SfxRequest& rReq ) |
47 | 0 | { |
48 | 0 | rReq.Ignore (); |
49 | |
|
50 | 0 | const SfxItemSet* pArgs = rReq.GetArgs(); |
51 | 0 | if (pArgs) |
52 | 0 | return; |
53 | | |
54 | 0 | SfxItemSet aNewAttr( mrDoc.GetPool() ); |
55 | 0 | mpView->GetAttributes( aNewAttr ); |
56 | |
|
57 | 0 | SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); |
58 | 0 | bool bHasSlideBackground = mrViewShell.GetDoc()->GetDocumentType() == DocumentType::Impress; |
59 | 0 | VclPtr<AbstractSvxAreaTabDialog> pDlg( |
60 | 0 | pFact->CreateSvxAreaTabDialog(mrViewShell.GetFrameWeld(), &aNewAttr, &mrDoc, true, bHasSlideBackground)); |
61 | |
|
62 | 0 | pDlg->StartExecuteAsync([pDlg, pView = this->mpView, pViewShell = &this->mrViewShell](sal_Int32 nResult){ |
63 | 0 | if (nResult == RET_OK) |
64 | 0 | { |
65 | 0 | pView->SetAttributes (*(pDlg->GetOutputItemSet ())); |
66 | | |
67 | | // attributes changed, update Listboxes in Objectbars |
68 | 0 | static const sal_uInt16 SidArray[] = { |
69 | 0 | SID_ATTR_FILL_STYLE, |
70 | 0 | SID_ATTR_FILL_COLOR, |
71 | 0 | SID_ATTR_FILL_GRADIENT, |
72 | 0 | SID_ATTR_FILL_HATCH, |
73 | 0 | SID_ATTR_FILL_BITMAP, |
74 | 0 | SID_ATTR_FILL_TRANSPARENCE, |
75 | 0 | SID_ATTR_FILL_FLOATTRANSPARENCE, |
76 | 0 | SID_ATTR_FILL_USE_SLIDE_BACKGROUND, |
77 | 0 | 0 }; |
78 | |
|
79 | 0 | pViewShell->GetViewFrame()->GetBindings().Invalidate( SidArray ); |
80 | 0 | } |
81 | | |
82 | | // deferred until the dialog ends |
83 | 0 | pViewShell->Cancel(); |
84 | |
|
85 | 0 | pDlg->disposeOnce(); |
86 | 0 | }); |
87 | 0 | } |
88 | | |
89 | | void FuArea::Activate() |
90 | 0 | { |
91 | 0 | } |
92 | | |
93 | | void FuArea::Deactivate() |
94 | 0 | { |
95 | 0 | } |
96 | | |
97 | | } // end of namespace sd |
98 | | |
99 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |