android: Update app-specific/MIME type icons
[LibreOffice.git] / sd / source / ui / func / fuarea.cxx
blob8dd7543e3ba06924b0ae7a3ba1c692292691de26
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #include <fuarea.hxx>
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>
29 #include <View.hxx>
30 #include <svx/svxdlg.hxx>
32 namespace sd {
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);
43 return xFunc;
46 void FuArea::DoExecute( SfxRequest& rReq )
48 rReq.Ignore ();
50 const SfxItemSet* pArgs = rReq.GetArgs();
51 if (pArgs)
52 return;
54 SfxItemSet aNewAttr( mpDoc->GetPool() );
55 mpView->GetAttributes( aNewAttr );
57 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
58 bool bHasSlideBackground = mpViewShell->GetDoc()->GetDocumentType() == DocumentType::Impress;
59 VclPtr<AbstractSvxAreaTabDialog> pDlg(
60 pFact->CreateSvxAreaTabDialog(mpViewShell->GetFrameWeld(), &aNewAttr, mpDoc, true, bHasSlideBackground));
62 pDlg->StartExecuteAsync([pDlg, pView = this->mpView, pViewShell = this->mpViewShell](sal_Int32 nResult){
63 if (nResult == RET_OK)
65 pView->SetAttributes (*(pDlg->GetOutputItemSet ()));
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 };
79 pViewShell->GetViewFrame()->GetBindings().Invalidate( SidArray );
82 // deferred until the dialog ends
83 pViewShell->Cancel();
85 pDlg->disposeOnce();
86 });
89 void FuArea::Activate()
93 void FuArea::Deactivate()
97 } // end of namespace sd
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */