35#include <osl/diagnose.h>
38#include <com/sun/star/form/FormButtonType.hpp>
39#include <com/sun/star/beans/XPropertySet.hpp>
40#include <com/sun/star/beans/XPropertySetInfo.hpp>
43#include <drawview.hxx>
76 const uno::Reference<awt::XControlModel>& xControlModel = pUnoCtrl->
GetUnoControlModel();
77 OSL_ENSURE( xControlModel.is(),
"UNO-Control without model" );
78 if( !xControlModel.is() )
81 uno::Reference< beans::XPropertySet > xPropSet( xControlModel, uno::UNO_QUERY );
82 uno::Reference< beans::XPropertySetInfo > xInfo = xPropSet->getPropertySetInfo();
84 OUString sPropButtonType(
"ButtonType" );
86 if(xInfo->hasPropertyByName( sPropButtonType ))
88 uno::Any aAny = xPropSet->getPropertyValue( sPropButtonType );
89 form::FormButtonType eTmp;
90 if ( (aAny >>= eTmp) && eTmp == form::FormButtonType_URL )
94 OUString sPropLabel(
"Label" );
95 if(xInfo->hasPropertyByName( sPropLabel ))
97 aAny = xPropSet->getPropertyValue( sPropLabel );
98 if ( (aAny >>= sTmp) && !sTmp.isEmpty() )
104 OUString sPropTargetURL(
"TargetURL" );
105 if(xInfo->hasPropertyByName( sPropTargetURL ))
107 aAny = xPropSet->getPropertyValue( sPropTargetURL );
108 if ( (aAny >>= sTmp) && !sTmp.isEmpty() )
114 OUString sPropTargetFrame(
"TargetFrame" );
115 if(xInfo->hasPropertyByName( sPropTargetFrame ))
117 aAny = xPropSet->getPropertyValue( sPropTargetFrame );
118 if ( (aAny >>= sTmp) && !sTmp.isEmpty() )
136 sal_uInt16 nSlot = rReq.
GetSlot();
139 case SID_HYPERLINK_SETLINK:
143 if ( pReqArgs->
GetItemState( SID_HYPERLINK_SETLINK,
true, &pItem ) == SfxItemState::SET )
146 const OUString& rName = pHyper->
GetName();
147 const OUString& rURL = pHyper->
GetURL();
160 if (pUnoCtrl && SdrInventor::FmForm == pUnoCtrl->
GetObjInventor())
162 const uno::Reference<awt::XControlModel>& xControlModel =
164 OSL_ENSURE( xControlModel.is(),
"UNO-Control without model" );
165 if( !xControlModel.is() )
168 uno::Reference< beans::XPropertySet > xPropSet( xControlModel, uno::UNO_QUERY );
169 uno::Reference< beans::XPropertySetInfo > xInfo = xPropSet->getPropertySetInfo();
171 OUString sPropTargetURL(
"TargetURL" );
174 if (xInfo->hasPropertyByName( sPropTargetURL ))
177 OUString sPropButtonType(
"ButtonType");
178 OUString sPropTargetFrame(
"TargetFrame" );
179 OUString sPropLabel(
"Label" );
181 if ( xInfo->hasPropertyByName( sPropLabel ) )
183 xPropSet->setPropertyValue( sPropLabel,
uno::Any(rName) );
187 xPropSet->setPropertyValue( sPropTargetURL,
uno::Any(aTmp) );
189 if( !
rTarget.isEmpty() && xInfo->hasPropertyByName( sPropTargetFrame ) )
194 if ( xInfo->hasPropertyByName( sPropButtonType ) )
196 xPropSet->setPropertyValue( sPropButtonType,
uno::Any(form::FormButtonType_URL) );
215 InsertURL( rName, rURL,
rTarget,
static_cast<sal_uInt16
>(
eMode) );
222 OSL_FAIL(
"wrong slot");
233 sal_uInt16 nSlotId = rReq.
GetSlot();
237 case SID_OBJECT_HEAVEN:
242 case SID_OBJECT_HELL:
250 case SID_FRAME_TO_TOP:
253 case SID_FRAME_TO_BOTTOM:
269 case SID_ENTER_GROUP:
272 case SID_LEAVE_GROUP:
276 case SID_REGENERATE_DIAGRAM:
277 case SID_EDIT_DIAGRAM:
288 if(SID_REGENERATE_DIAGRAM == nSlotId)
310 case SID_MIRROR_HORIZONTAL:
311 case SID_FLIP_HORIZONTAL:
313 rBindings.
Invalidate( SID_ATTR_TRANSFORM_ANGLE );
315 case SID_MIRROR_VERTICAL:
316 case SID_FLIP_VERTICAL:
318 rBindings.
Invalidate( SID_ATTR_TRANSFORM_ANGLE );
321 case SID_OBJECT_ALIGN_LEFT:
322 case SID_ALIGN_ANY_LEFT:
326 case SID_OBJECT_ALIGN_CENTER:
327 case SID_ALIGN_ANY_HCENTER:
331 case SID_OBJECT_ALIGN_RIGHT:
332 case SID_ALIGN_ANY_RIGHT:
336 case SID_OBJECT_ALIGN_UP:
337 case SID_ALIGN_ANY_TOP:
341 case SID_OBJECT_ALIGN_MIDDLE:
342 case SID_ALIGN_ANY_VCENTER:
346 case SID_OBJECT_ALIGN_DOWN:
347 case SID_ALIGN_ANY_BOTTOM:
353 case SID_DELETE_CONTENTS:
375 case SID_ANCHOR_PAGE:
379 rBindings.
Invalidate( SID_ANCHOR_CELL_RESIZE );
382 case SID_ANCHOR_CELL:
386 rBindings.
Invalidate( SID_ANCHOR_CELL_RESIZE );
389 case SID_ANCHOR_CELL_RESIZE:
393 rBindings.
Invalidate( SID_ANCHOR_CELL_RESIZE );
396 case SID_ANCHOR_TOGGLE:
411 rBindings.
Invalidate( SID_ANCHOR_CELL_RESIZE );
414 case SID_OBJECT_ROTATE:
418 eMode = SdrDragMode::Move;
420 eMode = SdrDragMode::Rotate;
431 case SID_OBJECT_MIRROR:
435 eMode = SdrDragMode::Move;
437 eMode = SdrDragMode::Mirror;
448 case SID_BEZIER_EDIT:
453 if (bOld && pView->
GetDragMode() != SdrDragMode::Move)
480 case SID_ORIGINALSIZE:
484 case SID_FITCELLSIZE:
488 case SID_ENABLE_HYPHENATION:
502 case SID_RENAME_OBJECT:
508 OSL_ENSURE(pSelected,
"ScDrawShell::ExecDrawFunc: nMarkCount, but no object (!)");
520 if(
RET_OK == pDlg->Execute())
523 pDlg->GetName(
aName);
530 if (SdrObjKind::Graphic == nObjType &&
aName.isEmpty())
545 if(SdrObjKind::OLE2 == nObjType)
547 const OUString aPersistName =
static_cast<SdrOle2Obj*
>(pSelected)->GetPersistName();
549 if(!aPersistName.isEmpty())
552 std::make_unique<ScUndoRenameObject>(pDocSh, aPersistName, pSelected->
GetName(),
aName));
570 case SID_TITLE_DESCRIPTION_OBJECT:
575 OSL_ENSURE(pSelected,
"ScDrawShell::ExecDrawFunc: nMarkCount, but no object (!)");
579 OUString aTitle(pSelected->
GetTitle());
586 pWin ? pWin->
GetFrameWeld() :
nullptr, aTitle, aDescription, isDecorative));
588 if(
RET_OK == pDlg->Execute())
593 pDlg->GetTitle(aTitle);
594 pDlg->GetDescription(aDescription);
595 pDlg->IsDecorative(isDecorative);
609 case SID_EXTRUSION_TOGGLE:
610 case SID_EXTRUSION_TILT_DOWN:
611 case SID_EXTRUSION_TILT_UP:
612 case SID_EXTRUSION_TILT_LEFT:
613 case SID_EXTRUSION_TILT_RIGHT:
614 case SID_EXTRUSION_3D_COLOR:
615 case SID_EXTRUSION_DEPTH:
616 case SID_EXTRUSION_DIRECTION:
617 case SID_EXTRUSION_PROJECTION:
618 case SID_EXTRUSION_LIGHTING_DIRECTION:
619 case SID_EXTRUSION_LIGHTING_INTENSITY:
620 case SID_EXTRUSION_SURFACE:
621 case SID_EXTRUSION_DEPTH_FLOATER:
622 case SID_EXTRUSION_DIRECTION_FLOATER:
623 case SID_EXTRUSION_LIGHTING_FLOATER:
624 case SID_EXTRUSION_SURFACE_FLOATER:
625 case SID_EXTRUSION_DEPTH_DIALOG:
630 case SID_FONTWORK_SHAPE:
631 case SID_FONTWORK_SHAPE_TYPE:
632 case SID_FONTWORK_ALIGNMENT:
633 case SID_FONTWORK_SAME_LETTER_HEIGHTS:
634 case SID_FONTWORK_CHARACTER_SPACING:
635 case SID_FONTWORK_KERN_CHARACTER_PAIRS:
636 case SID_FONTWORK_CHARACTER_SPACING_FLOATER:
637 case SID_FONTWORK_ALIGNMENT_FLOATER:
638 case SID_FONTWORK_CHARACTER_SPACING_DIALOG:
651 rDialog.GetName(
aName );
654 if ( !
aName.isEmpty() && pModel )
695 if( pArgs && pArgs->
Count() >= 1 )
696 bLock = pArgs->
Get(SID_FORMATPAINTBRUSH).GetValue();
713 if ( !bHasPaintBrush && !bSelection )
static OUString GetAbsURL(std::u16string_view rTheBaseURIRef, OUString const &rTheRelURIRef, EncodeMechanism eEncodeMechanism=EncodeMechanism::WasEncoded, DecodeMechanism eDecodeMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
void SetDocumentModified()
const ScDocument & GetDocument() const
void SetDrawModified()
SetDrawModified - without Formula update.
virtual SfxUndoManager * GetUndoManager() override
SC_DLLPUBLIC ScDrawLayer * GetDrawLayer()
void SetChartListenerCollectionNeedsUpdate(bool bFlg)
ScDocument * GetDocument() const
OUString GetNewGraphicName(tools::Long *pnCounter=nullptr) const
SdrObject * GetNamedObject(std::u16string_view rName, SdrObjKind nId, SCTAB &rFoundTab) const
void StateFormatPaintbrush(SfxItemSet &rSet)
ScDrawView * GetDrawView()
ScViewData & GetViewData()
void GetHLinkState(SfxItemSet &rSet)
void ExecFormText(const SfxRequest &rReq)
void ExecuteHLink(const SfxRequest &rReq)
void ExecDrawFunc(SfxRequest &rReq)
void ExecFormatPaintbrush(const SfxRequest &rReq)
void SetCellAnchored(bool bResizeWithCell)
SdrEndTextEditKind ScEndTextEdit()
virtual void DeleteMarked() override
void SetMarkedToLayer(SdrLayerID nLayerNo)
void SetMarkedOriginalSize()
ScAnchorType GetAnchorType() const
void ResetBrushDocument()
ScDrawView * GetScDrawView()
void SetDrawBrushSet(std::unique_ptr< SfxItemSet > pNew, bool bLock)
bool HasPaintBrush() const
ScDocument & GetDocument() const
ScDocShell * GetDocShell() const
ScGridWindow * GetActiveWin()
ScTabViewShell * GetViewShell() const
ScDBFunc * GetView() const
SfxBindings & GetBindings()
ScDrawView * GetScDrawView()
SfxItemSet GetAttrFromMarked(bool bOnlyHardAttr) const
void MirrorAllMarkedVertical()
void MirrorAllMarkedHorizontal()
void AlignMarkedObjects(SdrHorAlign eHor, SdrVertAlign eVert)
bool IsAlignPossible() const
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
void SetFrameDragSingles(bool bOn=true)
void SetDragMode(SdrDragMode eMode)
bool IsFrameDragSingles() const
const SdrMarkList & GetMarkedObjectList() const
bool AreObjectsMarked() const
SdrObject * GetMarkedObjectByIndex(size_t nNum) const
size_t GetMarkedObjectCount() const
SdrDragMode GetDragMode() const
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
SdrObject * GetMarkedSdrObj() const
virtual bool IsTextEdit() const final override
const OUString & getHyperlink() const
virtual OUString GetTitle() const
virtual void SetTitle(const OUString &rStr)
virtual const std::shared_ptr< svx::diagram::IDiagramHelper > & getDiagramHelper() const
virtual void SetDescription(const OUString &rStr)
virtual SdrInventor GetObjInventor() const
virtual OUString GetDescription() const
virtual const OUString & GetName() const
virtual SdrObjKind GetObjIdentifier() const
virtual SdrLayerID GetLayer() const
virtual void SetDecorative(bool isDecorative)
virtual void SetName(const OUString &rStr, const bool bSetChanged=true)
virtual bool IsDecorative() const
void setHyperlink(const OUString &sHyperlink)
SdrPageView * GetSdrPageView() const
const css::uno::Reference< css::awt::XControlModel > & GetUnoControlModel() const
bool SetAttributes(const SfxItemSet &rSet, bool bReplaceAll=false)
void Invalidate(sal_uInt16 nId)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void DisableItem(sal_uInt16 nWhich)
OUString GetBaseURL(bool bForSaving=false)
SfxMedium * GetMedium() const
sal_uInt16 GetSlot() const
const SfxItemSet * GetArgs() const
const T * GetArg(sal_uInt16 nSlotId) const
void Done(bool bRemove=false)
SfxItemPool & GetPool() const
SfxViewShell * GetViewShell() const
virtual void AddUndoAction(std::unique_ptr< SfxUndoAction > pAction, bool bTryMerg=false)
void ToggleChildWindow(sal_uInt16)
void SetChildWindow(sal_uInt16 nId, bool bVisible, bool bSetFocus=true)
SfxViewFrame & GetViewFrame() const
virtual VclPtr< AbstractSvxObjectTitleDescDialog > CreateSvxObjectTitleDescDialog(weld::Window *pParent, const OUString &rTitle, const OUString &rDescription, bool isDecorative)=0
virtual VclPtr< AbstractSvxObjectNameDialog > CreateSvxObjectNameDialog(weld::Window *pParent, const OUString &rName)=0
static SvxAbstractDialogFactory * Create()
SvxLinkInsertMode GetInsertMode() const
const OUString & GetName() const
const OUString & GetURL() const
void SetName(const OUString &rName)
void SetInsertMode(SvxLinkInsertMode eNew)
void SetURL(const OUString &rURL)
const OUString & GetTargetFrame() const
void SetTargetFrame(const OUString &rTarget)
virtual VclPtr< AbstractDiagramDialog > CreateDiagramDialog(weld::Window *pParent, SdrObjGroup &rDiagram)=0
static VclAbstractDialogFactory * Create()
static void execute(SdrView *pSdrView, SfxRequest const &rReq, SfxBindings &rBindings)
static void execute(SdrView &rSdrView, SfxRequest const &rReq, SfxBindings &rBindings)
weld::Window * GetFrameWeld() const
IMPL_LINK(ScDrawShell, NameObjectHdl, AbstractSvxObjectNameDialog &, rDialog, bool)
sal_uInt16 ScGetFontWorkId()
constexpr TypedWhichId< SfxBoolItem > EE_PARA_HYPHENATE(EE_PARA_START+6)
constexpr SdrLayerID SC_LAYER_FRONT(0)
constexpr SdrLayerID SC_LAYER_INTERN(2)
constexpr SdrLayerID SC_LAYER_BACK(1)
#define LINK(Instance, Class, Member)
SC_DLLPUBLIC void PasteFromClipboard(ScViewData &rViewData, ScTabViewShell *pTabViewShell, bool bShowDialog)