LibreOffice Module sd (master) 1
fuline.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 <fuline.hxx>
21
22#include <svx/svxids.hrc>
23#include <sfx2/request.hxx>
24#include <sfx2/bindings.hxx>
25#include <sfx2/viewfrm.hxx>
26#include <ViewShell.hxx>
27#include <View.hxx>
28#include <drawdoc.hxx>
29#include <svx/svxdlg.hxx>
30
31namespace sd {
32
33
35 ViewShell* pViewSh,
36 ::sd::Window* pWin,
37 ::sd::View* pView,
38 SdDrawDocument* pDoc,
39 SfxRequest& rReq)
40 : FuPoor(pViewSh, pWin, pView, pDoc, rReq)
41{
42}
43
45{
46 rtl::Reference<FuPoor> xFunc( new FuLine( pViewSh, pWin, pView, pDoc, rReq ) );
47 xFunc->DoExecute(rReq);
48 return xFunc;
49}
50
52{
53 rReq.Ignore();
54
55 const SfxItemSet* pArgs = rReq.GetArgs();
56 if (pArgs)
57 return;
58
59 const SdrObject* pObj = nullptr;
60 const SdrMarkList& rMarkList = mpView->GetMarkedObjectList();
61 if( rMarkList.GetMarkCount() == 1 )
62 pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
63
64 SfxItemSet aNewAttr( mpDoc->GetPool() );
65 mpView->GetAttributes( aNewAttr );
66
67 bool bHasMarked = mpView->AreObjectsMarked();
69 VclPtr<SfxAbstractTabDialog> pDlg( pFact->CreateSvxLineTabDialog(mpViewShell->GetFrameWeld(), &aNewAttr, mpDoc, pObj, bHasMarked) );
70
71 pDlg->StartExecuteAsync([pDlg, this](sal_Int32 nResult){
72 if (nResult == RET_OK)
73 {
74 mpView->SetAttributes (*(pDlg->GetOutputItemSet ()));
75
76 // some attributes are changed, we have to update the listboxes in the objectbars
77 static const sal_uInt16 SidArray[] = {
78 SID_ATTR_LINE_STYLE, // ( SID_SVX_START + 169 )
79 SID_ATTR_LINE_DASH, // ( SID_SVX_START + 170 )
80 SID_ATTR_LINE_WIDTH, // ( SID_SVX_START + 171 )
81 SID_ATTR_LINE_COLOR, // ( SID_SVX_START + 172 )
82 SID_ATTR_LINE_START, // ( SID_SVX_START + 173 )
83 SID_ATTR_LINE_END, // ( SID_SVX_START + 174 )
84 SID_ATTR_LINE_TRANSPARENCE, // (SID_SVX_START+1107)
85 SID_ATTR_LINE_JOINT, // (SID_SVX_START+1110)
86 SID_ATTR_LINE_CAP, // (SID_SVX_START+1111)
87 0 };
88
90 }
91
92 // deferred until the dialog ends
94
95 pDlg->disposeOnce();
96 });
97}
98
100{
101}
102
104{
105}
106
107} // end of namespace sd
108
109/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_DLLPRIVATE SfxItemPool & GetPool()
Definition: drawdoc.hxx:237
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
const SdrMarkList & GetMarkedObjectList() const
bool AreObjectsMarked() const
SdrObject * GetMarkedSdrObj() const
void Invalidate(sal_uInt16 nId)
void Ignore()
const SfxItemSet * GetArgs() const
SfxBindings & GetBindings()
virtual VclPtr< SfxAbstractTabDialog > CreateSvxLineTabDialog(weld::Window *pParent, const SfxItemSet *pAttr, SdrModel *pModel, const SdrObject *pObj, bool bHasObj)=0
static SvxAbstractDialogFactory * Create()
virtual void DoExecute(SfxRequest &rReq) override
Definition: fuline.cxx:51
FuLine(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fuline.cxx:34
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
Definition: fuline.cxx:44
virtual void Activate() override
activates the function
Definition: fuline.cxx:99
virtual void Deactivate() override
deactivates the function
Definition: fuline.cxx:103
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
SD_DLLPUBLIC weld::Window * GetFrameWeld() const
Definition: viewshel.cxx:1582
void Cancel()
this method deactivates the current function.
Definition: viewshel.cxx:1442
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
Definition: viewshel.cxx:118
virtual bool SetAttributes(const SfxItemSet &rSet, bool bReplaceAll=false, bool bSlide=false, bool bMaster=false)
Definition: sdview.cxx:509
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