31 #include <svx/dialogs.hrc>
65 sal_uInt16 nResult = pDlg->Execute();
74 for (
auto pObj : vMarkedObjs)
93 aNewAttr, pView, RID_SVXPAGE_MEASURE));
94 if (pDlg->Execute() ==
RET_OK)
106 case SID_ATTRIBUTES_AREA:
116 pDlg->StartExecuteAsync([bChanged, bHasMarked, pDoc, pDlg, pSh, pView,
this](
118 pDoc->SetChanged(
false);
129 static sal_uInt16 aInval[] =
133 SID_ATTR_FILL_TRANSPARENCE,
134 SID_ATTR_FILL_FLOATTRANSPARENCE,
137 SfxBindings &rBnd = GetView().GetViewFrame()->GetBindings();
139 rBnd.
Update(SID_ATTR_FILL_STYLE);
140 rBnd.
Update(SID_ATTR_FILL_COLOR);
141 rBnd.
Update(SID_ATTR_FILL_TRANSPARENCE);
142 rBnd.
Update(SID_ATTR_FILL_FLOATTRANSPARENCE);
145 if (pDoc->IsChanged())
155 case SID_ATTRIBUTES_LINE:
171 pDlg->StartExecuteAsync([bChanged, bHasMarked, pDoc, pDlg, pSh, pView,
this](
173 pDoc->SetChanged(
false);
184 static sal_uInt16 aInval[] =
192 SID_ATTR_LINE_TRANSPARENCE,
198 GetView().GetViewFrame()->GetBindings().Invalidate(aInval);
201 if (pDoc->IsChanged())
223 void lcl_convertStringArguments(sal_uInt16 nSlot,
const std::unique_ptr<SfxItemSet>& pArgs)
228 if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_COLOR_STR,
false, &pItem))
232 if (sColor ==
"transparent")
235 aColor =
Color(ColorTransparency, sColor.toInt32(16));
239 case SID_ATTR_LINE_COLOR:
242 pArgs->Put(aLineColorItem);
246 case SID_ATTR_FILL_COLOR:
249 pArgs->Put(aFillColorItem);
254 else if (
const SvxDoubleItem* pWidthItem = pArgs->GetItemIfSet(SID_ATTR_LINE_WIDTH_ARG,
false))
256 double fValue = pWidthItem->GetValue();
259 int nValue = fValue * nPow;
264 if (
const SfxStringItem* pJSON = pArgs->GetItemIfSet(SID_FILL_GRADIENT_JSON,
false))
281 GetView().NoRotate();
287 std::unique_ptr<SfxItemSet> pNewArgs = pArgs->
Clone();
288 lcl_convertStringArguments(rReq.
GetSlot(), pNewArgs);
299 case SID_ATTR_FILL_STYLE:
300 case SID_ATTR_FILL_COLOR:
301 case SID_ATTR_FILL_GRADIENT:
302 case SID_ATTR_FILL_HATCH:
303 case SID_ATTR_FILL_BITMAP:
304 case SID_ATTR_FILL_TRANSPARENCE:
305 case SID_ATTR_FILL_FLOATTRANSPARENCE:
306 pDis->
Execute(SID_ATTRIBUTES_AREA);
308 case SID_ATTR_LINE_STYLE:
309 case SID_ATTR_LINE_DASH:
310 case SID_ATTR_LINE_WIDTH:
311 case SID_ATTR_LINE_COLOR:
312 case SID_ATTR_LINE_TRANSPARENCE:
313 case SID_ATTR_LINE_JOINT:
314 case SID_ATTR_LINE_CAP:
315 pDis->
Execute(SID_ATTRIBUTES_LINE);
341 if (!pFillFloatTranspItem || pFillFloatTranspItem->
IsEnabled())
347 if (!pFillTranspItem)
351 sal_uInt16 nTranspPercent = pFillTranspItem->GetValue();
353 sal_uInt16 nIntensity = 100 - std::min<sal_uInt16>
354 (std::max<sal_uInt16>(nTranspPercent, 0), 100);
366 bool bDisable =
Disable( rSet );
375 >= SfxItemState::DEFAULT
382 >= SfxItemState::DEFAULT
387 rSet.
Put(aSet,
false);
SfxViewFrame * GetViewFrame() const
size_t GetMarkCount() const
virtual const SfxItemSet * GetOutputItemSet() const =0
static XGradient fromJSON(const OUString &rJSON)
static bool hasTextFrame(const SdrObject *pObj)
Returns true if the SdrObject has a SwTextFrame otherwise false.
SfxDispatcher * GetDispatcher()
bool AreObjectsMarked() const
static SvxAbstractDialogFactory * Create()
constexpr::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
void GetDrawAttrState(SfxItemSet &rSet)
void Done(bool bRemove=false)
SdrMark * GetMark(size_t nNum) const
void ExecDrawAttrArgs(SfxRequest const &rReq)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXTCOLUMNS_SPACING(SDRATTR_TEXTCOLUMNS_FIRST+1)
const SfxItemSet * GetArgs() const
void Invalidate(sal_uInt16 nId)
Used by the UI to modify the document model.
void SetAttrToMarked(const SfxItemSet &rAttr, bool bReplaceAll)
void MergeRange(sal_uInt16 nFrom, sal_uInt16 nTo)
const SwView & GetView() const
virtual VclPtr< SfxAbstractDialog > CreateSfxDialog(weld::Window *pParent, const SfxItemSet &rAttr, const SdrView *pView, sal_uInt32 nResId)=0
const SfxItemSet & GetDefaultAttr() const
virtual void SetChanged(bool bFlg=true)
const OUStringLiteral sColor
void SetEndIntens(sal_uInt16 nNewIntens)
SdrObject * GetMarkedSdrObj() const
static void updateTextBoxMargin(SdrObject *pObj)
Copy shape attributes to the text frame.
constexpr TypedWhichId< XFillTransparenceItem > XATTR_FILLTRANSPARENCE(XATTR_FILL_FIRST+5)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const XGradient & GetGradientValue() const
void SetGradientValue(const XGradient &rNew)
const SdrMarkList & GetMarkedObjectList() const
bool SetAttributes(const SfxItemSet &rSet, bool bReplaceAll=false)
#define FN_DRAWTEXT_ATTR_DLG
void SetDefaultAttr(const SfxItemSet &rAttr, bool bReplaceAll)
std::unique_ptr< SfxPoolItem > CloneSetWhich(sal_uInt16 nNewWhich) const
virtual VclPtr< SfxAbstractTabDialog > CreateTextTabDialog(weld::Window *pParent, const SfxItemSet *pAttrSet, SdrView *pView)=0
void SetStartIntens(sal_uInt16 nNewIntens)
weld::Window * GetFrameWeld() const
void Update(sal_uInt16 nId)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
sal_uInt16 GetSlot() const
void ExecDrawDlg(SfxRequest &rReq)
constexpr TypedWhichId< XFillFloatTransparenceItem > XATTR_FILLFLOATTRANSPARENCE(XATTR_FILL_FIRST+11)
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 GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr=false) const
constexpr TypedWhichId< SfxInt16Item > SDRATTR_TEXTCOLUMNS_NUMBER(SDRATTR_TEXTCOLUMNS_FIRST+0)
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)
::std::vector< SdrObject * > GetMarkedObjects() const
static void lcl_unifyFillTransparencyItems(const SfxItemSet &rSet)
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
SdrModel * GetModel() const
virtual VclPtr< SfxAbstractTabDialog > CreateSvxLineTabDialog(weld::Window *pParent, const SfxItemSet *pAttr, SdrModel *pModel, const SdrObject *pObj, bool bHasObj)=0
void EndAction(const bool bIdleEnd=false)