21 #include <svx/dialogs.hrc>
37 #include <strings.hrc>
39 #include <document.hxx>
40 #include <drawview.hxx>
47 #define ShellClass_ScDrawShell
48 #include <scslots.hxx>
54 #include <com/sun/star/util/XModifiable.hpp>
66 void lcl_convertStringArguments(sal_uInt16 nSlot,
const std::unique_ptr<SfxItemSet>& pArgs)
71 if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_LINE_WIDTH_ARG,
false, &pItem))
76 int nValue = fValue * nPow;
81 else if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_COLOR_STR,
false, &pItem))
85 if (sColor ==
"transparent")
92 case SID_ATTR_LINE_COLOR:
95 pArgs->Put(aLineColorItem);
99 case SID_ATTR_FILL_COLOR:
102 pArgs->Put(aFillColorItem);
106 case SID_ATTR_SHADOW_COLOR:
114 if (SfxItemState::SET == pArgs->GetItemState(SID_FILL_GRADIENT_JSON,
false, &pItem))
130 SfxVisibilityFlags::Standard | SfxVisibilityFlags::Server,
131 ToolbarId::Draw_Objectbar);
156 css::uno::Reference< css::util::XModifiable > xModif( pShell->
GetModel(), css::uno::UNO_QUERY );
158 xModif->setModified(
true );
165 rBindings.
Invalidate(SID_ATTR_TRANSFORM_WIDTH);
166 rBindings.
Invalidate(SID_ATTR_TRANSFORM_HEIGHT);
167 rBindings.
Invalidate(SID_ATTR_TRANSFORM_POS_X);
168 rBindings.
Invalidate(SID_ATTR_TRANSFORM_POS_Y);
169 rBindings.
Invalidate(SID_ATTR_TRANSFORM_ANGLE);
170 rBindings.
Invalidate(SID_ATTR_TRANSFORM_ROT_X);
171 rBindings.
Invalidate(SID_ATTR_TRANSFORM_ROT_Y);
172 rBindings.
Invalidate(SID_ATTR_TRANSFORM_AUTOWIDTH);
173 rBindings.
Invalidate(SID_ATTR_TRANSFORM_AUTOHEIGHT);
178 sal_uInt16 nSlot = rReq.
GetSlot();
186 if ( nMarkCount > 0 )
191 case SID_ASSIGNMACRO:
193 if ( pSingleSelectedObj )
198 case SID_TEXT_STANDARD:
205 case SID_ATTR_LINE_STYLE:
206 case SID_ATTR_LINEEND_STYLE:
207 case SID_ATTR_LINE_START:
208 case SID_ATTR_LINE_END:
209 case SID_ATTR_LINE_DASH:
210 case SID_ATTR_LINE_WIDTH:
211 case SID_ATTR_LINE_COLOR:
212 case SID_ATTR_LINE_TRANSPARENCE:
213 case SID_ATTR_LINE_JOINT:
214 case SID_ATTR_LINE_CAP:
215 case SID_ATTR_FILL_STYLE:
216 case SID_ATTR_FILL_COLOR:
217 case SID_ATTR_FILL_GRADIENT:
218 case SID_ATTR_FILL_HATCH:
219 case SID_ATTR_FILL_BITMAP:
220 case SID_ATTR_FILL_TRANSPARENCE:
221 case SID_ATTR_FILL_FLOATTRANSPARENCE:
224 case SID_ATTR_FILL_SHADOW:
225 case SID_ATTR_SHADOW_TRANSPARENCE:
226 case SID_ATTR_SHADOW_COLOR:
227 case SID_ATTR_SHADOW_XDISTANCE:
228 case SID_ATTR_SHADOW_YDISTANCE:
235 case SID_ATTR_LINE_STYLE:
236 case SID_ATTR_LINE_DASH:
237 case SID_ATTR_LINE_WIDTH:
238 case SID_ATTR_LINE_COLOR:
239 case SID_ATTR_LINE_TRANSPARENCE:
240 case SID_ATTR_LINE_JOINT:
241 case SID_ATTR_LINE_CAP:
245 case SID_ATTR_FILL_STYLE:
246 case SID_ATTR_FILL_COLOR:
247 case SID_ATTR_FILL_GRADIENT:
248 case SID_ATTR_FILL_HATCH:
249 case SID_ATTR_FILL_BITMAP:
250 case SID_ATTR_FILL_TRANSPARENCE:
251 case SID_ATTR_FILL_FLOATTRANSPARENCE:
254 case SID_ATTR_FILL_SHADOW:
255 case SID_ATTR_SHADOW_TRANSPARENCE:
256 case SID_ATTR_SHADOW_COLOR:
257 case SID_ATTR_SHADOW_XDISTANCE:
258 case SID_ATTR_SHADOW_YDISTANCE:
272 std::unique_ptr<SfxItemSet> pNewArgs = rReq.
GetArgs()->
Clone();
273 lcl_convertStringArguments( rReq.
GetSlot(), pNewArgs );
282 case SID_ATTRIBUTES_LINE:
286 case SID_ATTRIBUTES_AREA:
290 case SID_MEASURE_DLG:
294 case SID_DRAWTEXT_ATTR_DLG:
298 case SID_DRAW_HLINK_EDIT:
299 if ( pSingleSelectedObj )
303 case SID_DRAW_HLINK_DELETE:
304 if ( pSingleSelectedObj )
308 case SID_OPEN_HYPERLINK:
309 if ( nMarkCount == 1 )
321 if ( pInfo && !pInfo->
GetHlink().isEmpty() )
326 case SID_ATTR_TRANSFORM:
334 if( rMarkList.
GetMark(0) != nullptr )
337 std::shared_ptr<SfxRequest> pRequest = std::make_shared<SfxRequest>(rReq);
350 const sal_uInt16* pRange = pDlg->
GetInputRanges( *aNewAttr.GetPool() );
351 SfxItemSet aCombSet( *aNewAttr.GetPool(), pRange );
352 aCombSet.Put( aNewAttr );
353 aCombSet.Put( aNewGeoAttr );
356 pDlg->StartExecuteAsync([pDlg, pRequest, pView,
this](
375 pDlg->StartExecuteAsync([pDlg, pRequest, pView,
this](
398 case SID_ATTR_GLOW_COLOR:
399 case SID_ATTR_GLOW_RADIUS:
400 case SID_ATTR_GLOW_TRANSPARENCY:
401 case SID_ATTR_SOFTEDGE_RADIUS:
419 const OUString& sMacro = pInfo->
GetMacro();
420 aTab.
Insert(SvMacroItemId::OnClick,
SvxMacro(sMacro, OUString()));
426 pItemSet->Put ( aItem );
429 aNamesItem.
AddEvent(
ScResId(RID_SCSTR_ONCLICK), OUString(), SvMacroItemId::OnClick );
430 pItemSet->Put( aNamesItem );
432 css::uno::Reference < css::frame::XFrame >
xFrame;
438 if ( pMacroDlg->Execute() !=
RET_OK )
441 const SfxItemSet* pOutSet = pMacroDlg->GetOutputItemSet();
443 if( SfxItemState::SET != pOutSet->
GetItemState( SID_ATTR_MACROITEM,
false, &pItem ))
447 const SvxMacro* pMacro =
static_cast<const SvxMacroItem*
>(pItem)->GetMacroTable().Get( SvMacroItemId::OnClick );
473 std::shared_ptr<SfxRequest> pRequest = std::make_shared<SfxRequest>(rReq);
489 pDlg->StartExecuteAsync([=](sal_Int32 nResult){
509 std::shared_ptr<SfxRequest> pRequest = std::make_shared<SfxRequest>(rReq);
521 pDlg->StartExecuteAsync([=](sal_Int32 nResult){
549 sal_uInt16 nResult = pDlg->Execute();
576 sal_uInt16 nResult = pDlg->Execute();
SfxViewFrame * GetViewFrame() const
SvxMacro & Insert(SvMacroItemId nEvent, const SvxMacro &rMacro)
size_t GetMarkCount() const
#define SFX_IMPL_INTERFACE(Class, SuperClass)
static SfxInterface * GetStaticInterface()
const OUString & GetMacro() const
virtual const SfxItemSet * GetOutputItemSet() const =0
static XGradient fromJSON(const OUString &rJSON)
bool AreObjectsMarked() const
static SvxAbstractDialogFactory * Create()
void RegisterObjectBar(sal_uInt16, SfxVisibilityFlags nFlags, ToolbarId eId)
static ScMacroInfo * GetMacroInfo(SdrObject *pObj, bool bCreate=false)
constexpr::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
Reference< XFrame > xFrame
void SetGeoAttrToMarked(const SfxItemSet &rAttr)
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
virtual VclPtr< SfxAbstractDialog > CreateEventConfigDialog(weld::Widget *pParent, const SfxItemSet &rAttr, const css::uno::Reference< css::frame::XFrame > &rFrame)=0
static void OpenURL(const OUString &rURL, const OUString &rTarget, bool bIgnoreSettings=false)
Open the specified URL.
void Done(bool bRemove=false)
SdrMark * GetMark(size_t nNum) const
ScDocument & GetDocument() const
css::uno::Reference< css::frame::XModel > GetModel() const
void MergeAttrFromMarked(SfxItemSet &rAttr, bool bOnlyHardAttr) const
const SfxItemSet * GetArgs() const
void Invalidate(sal_uInt16 nId)
void RegisterPopupMenu(const OUString &)
virtual SdrObjKind GetObjIdentifier() const
virtual SdrObjList * GetSubList() const
virtual const sal_uInt16 * GetInputRanges(const SfxItemPool &)=0
SfxApplication * SfxGetpApp()
SfxItemSet GetGeoAttrFromMarked() const
virtual void SetInputSet(const SfxItemSet *pInSet)=0
weld::Window * GetFrameWeld() const
void SetAttrToMarked(const SfxItemSet &rAttr, bool bReplaceAll)
static void lcl_invalidateTransformAttr(const ScTabViewShell *pViewShell)
SfxFrame & GetFrame() const
constexpr TypedWhichId< XColorItem > SDRATTR_SHADOWCOLOR(SDRATTR_SHADOW_FIRST+1)
virtual VclPtr< SfxAbstractDialog > CreateSfxDialog(weld::Window *pParent, const SfxItemSet &rAttr, const SdrView *pView, sal_uInt32 nResId)=0
const SfxItemSet & GetDefaultAttr() const
void RegisterChildWindow(sal_uInt16, bool bContext=false)
ScDrawView * GetScDrawView()
SfxItemPool & GetPool() const
ScTabViewShell * GetViewShell() const
SdrObject * GetMarkedSdrObj() const
SdrObject * PickObj(const Point &rPnt, short nTol, SdrPageView *&rpPV, SdrSearchOptions nOptions, SdrObject **ppRootObj, bool *pbHitPassDirect=nullptr) const
SC_DLLPUBLIC ScDrawLayer * GetDrawLayer()
void AddEvent(const OUString &, const OUString &, SvMacroItemId)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void SetHlinkForObject(SdrObject *pObj, const OUString &rHlnk)
SfxBindings & GetBindings()
void SetHlink(const OUString &rHlink)
const OUString & GetValue() const
const SdrMarkList & GetMarkedObjectList() const
bool SetAttributes(const SfxItemSet &rSet, bool bReplaceAll=false)
void SetMacro(const OUString &rMacro)
static void lcl_setModified(const SfxObjectShell *pShell)
OUString ScResId(const char *pId)
ScGridWindow * GetActiveWin()
bool IsGroupObject() const
void SetDefaultAttr(const SfxItemSet &rAttr, bool bReplaceAll)
weld::Window * GetDialogParent()
void ExecuteAreaDlg(const SfxRequest &rReq)
SfxViewShell * GetViewShell() const
static void InitInterface_Impl()
SfxInterface initializer.
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
#define SFX_OBJECTBAR_OBJECT
static void StateDisableItems(SfxItemSet &rSet)
Point PixelToLogic(const Point &rDevicePt) const
virtual VclPtr< SfxAbstractTabDialog > CreateTextTabDialog(weld::Window *pParent, const SfxItemSet *pAttrSet, SdrView *pView)=0
sal_uInt16 GetSlot() const
void ExecuteTextAttrDlg(SfxRequest &rReq)
void DisableItem(sal_uInt16 nWhich)
virtual std::unique_ptr< SfxItemSet > Clone(bool bItems=true, SfxItemPool *pToPool=nullptr) const
virtual VclPtr< AbstractSvxAreaTabDialog > CreateSvxAreaTabDialog(weld::Window *pParent, const SfxItemSet *pAttr, SdrModel *pModel, bool bShadow)=0
void SetMacroTable(const SvxMacroTableDtor &rTbl)
void ExecDrawAttr(SfxRequest &rReq)
void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr=false) const
SfxDispatcher & GetDispatcher()
const OUString & GetHlink() const
const SfxItemPool & GetItemPool() const
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
void ExecuteLineDlg(const SfxRequest &rReq)
sal_uInt16 getHitTolLog() const
void ExecuteMacroAssign(SdrObject *pObj, weld::Window *pWin)
const OUString & GetMacName() const
virtual SfxObjectShell * GetObjectShell()
virtual VclPtr< SfxAbstractTabDialog > CreateSvxLineTabDialog(weld::Window *pParent, const SfxItemSet *pAttr, SdrModel *pModel, const SdrObject *pObj, bool bHasObj)=0
void ExecuteMeasureDlg(SfxRequest &rReq)