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>
71 void lcl_convertStringArguments(sal_uInt16 nSlot,
SfxItemSet& rArgs)
77 double fValue = pWidthItem->GetValue();
80 int nValue = fValue * nPow;
87 OUString
sColor = pColorItem->GetValue();
89 if (sColor ==
"transparent")
96 case SID_ATTR_LINE_COLOR:
99 rArgs.
Put(aLineColorItem);
103 case SID_ATTR_FILL_COLOR:
106 rArgs.
Put(aFillColorItem);
110 case SID_ATTR_SHADOW_COLOR:
130 SfxVisibilityFlags::Standard | SfxVisibilityFlags::Server,
131 ToolbarId::Draw_Objectbar);
133 GetStaticInterface()->RegisterPopupMenu(
"draw");
135 GetStaticInterface()->RegisterChildWindow(SvxFontWorkChildWindow::GetChildWindowId());
157 css::uno::Reference< css::util::XModifiable > xModif( pShell->
GetModel(), css::uno::UNO_QUERY );
159 xModif->setModified(
true );
166 rBindings.
Invalidate(SID_ATTR_TRANSFORM_WIDTH);
167 rBindings.
Invalidate(SID_ATTR_TRANSFORM_HEIGHT);
168 rBindings.
Invalidate(SID_ATTR_TRANSFORM_POS_X);
169 rBindings.
Invalidate(SID_ATTR_TRANSFORM_POS_Y);
170 rBindings.
Invalidate(SID_ATTR_TRANSFORM_ANGLE);
171 rBindings.
Invalidate(SID_ATTR_TRANSFORM_ROT_X);
172 rBindings.
Invalidate(SID_ATTR_TRANSFORM_ROT_Y);
173 rBindings.
Invalidate(SID_ATTR_TRANSFORM_AUTOWIDTH);
174 rBindings.
Invalidate(SID_ATTR_TRANSFORM_AUTOHEIGHT);
179 sal_uInt16 nSlot = rReq.
GetSlot();
181 ScDrawView* pView = rViewData.GetScDrawView();
182 SdrModel* pDoc = rViewData.GetDocument().GetDrawLayer();
187 if ( nMarkCount > 0 )
192 case SID_ASSIGNMACRO:
194 if ( pSingleSelectedObj )
195 ExecuteMacroAssign(pSingleSelectedObj, pWin ? pWin->
GetFrameWeld() :
nullptr);
199 case SID_TEXT_STANDARD:
205 case SID_MOVE_SHAPE_HANDLE:
208 if (pArgs && pArgs->
Count () >= 3)
220 pView->
MoveShapeHandle(handleNum,
Point(bNegateX ? -static_cast<tools::Long>(newPosX) : newPosX, newPosY), OrdNum ? OrdNum->GetValue() : -1);
225 case SID_ATTR_LINE_STYLE:
226 case SID_ATTR_LINEEND_STYLE:
227 case SID_ATTR_LINE_START:
228 case SID_ATTR_LINE_END:
229 case SID_ATTR_LINE_DASH:
230 case SID_ATTR_LINE_WIDTH:
231 case SID_ATTR_LINE_COLOR:
232 case SID_ATTR_LINE_TRANSPARENCE:
233 case SID_ATTR_LINE_JOINT:
234 case SID_ATTR_LINE_CAP:
235 case SID_ATTR_FILL_STYLE:
236 case SID_ATTR_FILL_COLOR:
237 case SID_ATTR_FILL_GRADIENT:
238 case SID_ATTR_FILL_HATCH:
239 case SID_ATTR_FILL_BITMAP:
240 case SID_ATTR_FILL_TRANSPARENCE:
241 case SID_ATTR_FILL_FLOATTRANSPARENCE:
244 case SID_ATTR_FILL_SHADOW:
245 case SID_ATTR_SHADOW_TRANSPARENCE:
246 case SID_ATTR_SHADOW_COLOR:
247 case SID_ATTR_SHADOW_XDISTANCE:
248 case SID_ATTR_SHADOW_YDISTANCE:
255 case SID_ATTR_LINE_STYLE:
256 case SID_ATTR_LINE_DASH:
257 case SID_ATTR_LINE_WIDTH:
258 case SID_ATTR_LINE_COLOR:
259 case SID_ATTR_LINE_TRANSPARENCE:
260 case SID_ATTR_LINE_JOINT:
261 case SID_ATTR_LINE_CAP:
262 ExecuteLineDlg( rReq );
265 case SID_ATTR_FILL_STYLE:
266 case SID_ATTR_FILL_COLOR:
267 case SID_ATTR_FILL_GRADIENT:
268 case SID_ATTR_FILL_HATCH:
269 case SID_ATTR_FILL_BITMAP:
270 case SID_ATTR_FILL_TRANSPARENCE:
271 case SID_ATTR_FILL_FLOATTRANSPARENCE:
274 case SID_ATTR_FILL_SHADOW:
275 case SID_ATTR_SHADOW_TRANSPARENCE:
276 case SID_ATTR_SHADOW_COLOR:
277 case SID_ATTR_SHADOW_XDISTANCE:
278 case SID_ATTR_SHADOW_YDISTANCE:
279 ExecuteAreaDlg( rReq );
293 lcl_convertStringArguments( rReq.
GetSlot(), aNewArgs );
302 case SID_ATTRIBUTES_LINE:
303 ExecuteLineDlg( rReq );
306 case SID_ATTRIBUTES_AREA:
307 ExecuteAreaDlg( rReq );
310 case SID_MEASURE_DLG:
311 ExecuteMeasureDlg( rReq );
314 case SID_DRAWTEXT_ATTR_DLG:
315 ExecuteTextAttrDlg( rReq );
318 case SID_EDIT_HYPERLINK:
319 if ( pSingleSelectedObj )
320 rViewData.GetDispatcher().Execute( SID_HYPERLINK_DIALOG );
323 case SID_REMOVE_HYPERLINK:
324 if ( pSingleSelectedObj )
331 case SID_OPEN_HYPERLINK:
332 case SID_COPY_HYPERLINK_LOCATION:
333 if ( nMarkCount == 1 )
346 if (nSlot == SID_OPEN_HYPERLINK)
350 else if (nSlot == SID_COPY_HYPERLINK_LOCATION)
352 uno::Reference<datatransfer::clipboard::XClipboard> xClipboard
353 = GetViewShell()->GetWindow()->GetClipboard();
360 case SID_ATTR_TRANSFORM:
368 if( rMarkList.
GetMark(0) != nullptr )
371 std::shared_ptr<SfxRequest> pRequest = std::make_shared<SfxRequest>(rReq);
385 SfxItemSet aCombSet( *aNewAttr.GetPool(), pRange );
386 aCombSet.
Put( aNewAttr );
387 aCombSet.Put( aNewGeoAttr );
390 pDlg->StartExecuteAsync([pDlg, pRequest, pView,
this](
409 pDlg->StartExecuteAsync([pDlg, pRequest, pView,
this](
432 case SID_ATTR_GLOW_COLOR:
433 case SID_ATTR_GLOW_RADIUS:
434 case SID_ATTR_GLOW_TRANSPARENCY:
435 case SID_ATTR_SOFTEDGE_RADIUS:
436 case SID_ATTR_TEXTCOLUMNS_NUMBER:
437 case SID_ATTR_TEXTCOLUMNS_SPACING:
455 const OUString& sMacro = pInfo->
GetMacro();
456 aTab.
Insert(SvMacroItemId::OnClick,
SvxMacro(sMacro, OUString()));
462 aItemSet.
Put ( aItem );
465 aNamesItem.
AddEvent(
ScResId(RID_SCSTR_ONCLICK), OUString(), SvMacroItemId::OnClick );
466 aItemSet.
Put( aNamesItem );
468 css::uno::Reference < css::frame::XFrame >
xFrame;
470 xFrame = GetViewShell()->GetViewFrame()->GetFrame().GetFrameInterface();
474 if ( pMacroDlg->Execute() !=
RET_OK )
477 const SfxItemSet* pOutSet = pMacroDlg->GetOutputItemSet();
504 ScDrawView* pView = rViewData.GetScDrawView();
509 std::shared_ptr<SfxRequest> pRequest = std::make_shared<SfxRequest>(rReq);
521 rViewData.GetDocument().GetDrawLayer(),
525 pDlg->StartExecuteAsync([=](sal_Int32 nResult){
542 ScDrawView* pView = rViewData.GetScDrawView();
545 std::shared_ptr<SfxRequest> pRequest = std::make_shared<SfxRequest>(rReq);
555 rViewData.GetDocument().GetDrawLayer(),
true));
557 pDlg->StartExecuteAsync([=](sal_Int32 nResult){
574 ScDrawView* pView = rViewData.GetScDrawView();
585 sal_uInt16 nResult = pDlg->Execute();
601 ScDrawView* pView = rViewData.GetScDrawView();
612 sal_uInt16 nResult = pDlg->Execute();
SfxViewFrame * GetViewFrame() const
static void CopyStringTo(const OUString &rContent, const css::uno::Reference< css::datatransfer::clipboard::XClipboard > &rxClipboard, const vcl::ILibreOfficeKitNotifier *pNotifier=nullptr)
SvxMacro & Insert(SvMacroItemId nEvent, const SvxMacro &rMacro)
size_t GetMarkCount() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
#define SFX_IMPL_INTERFACE(Class, SuperClass)
OUString ScResId(TranslateId aId)
SfxItemSet CloneAsValue(bool bItems=true, SfxItemPool *pToPool=nullptr) const
const OUString & GetMacro() const
virtual const SfxItemSet * GetOutputItemSet() const =0
static XGradient fromJSON(const OUString &rJSON)
void setHyperlink(const OUString &sHyperlink)
bool AreObjectsMarked() const
static SvxAbstractDialogFactory * Create()
static ScMacroInfo * GetMacroInfo(SdrObject *pObj, bool bCreate=false)
constexpr::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
Reference< XFrame > xFrame
css::uno::Reference< css::frame::XModel3 > GetModel() const
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.
const OUString & getHyperlink() const
void Done(bool bRemove=false)
SdrMark * GetMark(size_t nNum) const
void MergeAttrFromMarked(SfxItemSet &rAttr, bool bOnlyHardAttr) const
const SfxItemSet * GetArgs() const
void Invalidate(sal_uInt16 nId)
virtual SdrObjKind GetObjIdentifier() const
virtual SdrObjList * GetSubList() const
SfxApplication * SfxGetpApp()
constexpr auto convertTwipToMm100(N n)
SfxItemSet GetGeoAttrFromMarked() const
virtual void SetInputSet(const SfxItemSet *pInSet)=0
weld::Window * GetFrameWeld() const
void SetAttrToMarked(const SfxItemSet &rAttr, bool bReplaceAll)
bool MoveShapeHandle(const sal_uInt32 handleNum, const Point &aEndPoint, const sal_Int32 aObjectOrdNum=-1)
static void lcl_invalidateTransformAttr(const ScTabViewShell *pViewShell)
void SetGeoAttrToMarked(const SfxItemSet &rAttr, bool addPageMargin=false)
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
const OUStringLiteral sColor
SdrObject * GetMarkedSdrObj() const
SdrObject * PickObj(const Point &rPnt, short nTol, SdrPageView *&rpPV, SdrSearchOptions nOptions, SdrObject **ppRootObj, bool *pbHitPassDirect=nullptr) const
void AddEvent(const OUString &, const OUString &, SvMacroItemId)
SfxBindings & GetBindings()
const SdrMarkList & GetMarkedObjectList() const
const T * GetArg(sal_uInt16 nSlotId) const
bool SetAttributes(const SfxItemSet &rSet, bool bReplaceAll=false)
void SetMacro(const OUString &rMacro)
bool IsGroupObject() const
Point PixelToLogic(const Point &rDevicePt) const
void SetDefaultAttr(const SfxItemSet &rAttr, bool bReplaceAll)
void ExecuteAreaDlg(const SfxRequest &rReq)
static void InitInterface_Impl()
SfxInterface initializer.
#define SFX_OBJECTBAR_OBJECT
static void StateDisableItems(SfxItemSet &rSet)
virtual VclPtr< SfxAbstractTabDialog > CreateTextTabDialog(weld::Window *pParent, const SfxItemSet *pAttrSet, SdrView *pView)=0
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
sal_uInt16 GetSlot() const
const SvxMacroTableDtor & GetMacroTable() const
void ExecuteTextAttrDlg(SfxRequest &rReq)
const SvxMacro * Get(SvMacroItemId nEvent) const
void DisableItem(sal_uInt16 nWhich)
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
virtual WhichRangesContainer GetInputRanges(const SfxItemPool &)=0
sal_uInt32 GetValue() const
const SfxItemPool & GetItemPool() const
void ExecuteLineDlg(const SfxRequest &rReq)
sal_uInt16 getHitTolLog() const
void ExecuteMacroAssign(SdrObject *pObj, weld::Window *pWin)
const OUString & GetMacName() const
virtual VclPtr< SfxAbstractTabDialog > CreateSvxLineTabDialog(weld::Window *pParent, const SfxItemSet *pAttr, SdrModel *pModel, const SdrObject *pObj, bool bHasObj)=0
bool m_bDetectedRangeSegmentation false
void ExecuteMeasureDlg(SfxRequest &rReq)