diff options
author | Armin Le Grand <Armin.Le.Grand@me.com> | 2019-04-10 11:56:52 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2019-05-05 18:45:18 +0200 |
commit | 253d84da26c39e502b2da3af971251877ee45ce5 (patch) | |
tree | cf56122d9612017eac3784270cae73880e09b261 /sw/source/uibase/shells/drwbassh.cxx | |
parent | WIP: Moved usage of SID_BASICIDE_ARG_SBX completely (diff) | |
download | core-253d84da26c39e502b2da3af971251877ee45ce5.tar.gz core-253d84da26c39e502b2da3af971251877ee45ce5.zip |
WIP: Replaced SID_ATTR_TRANSFORM_ANCHOR with Item
by implementing Item::TransformAnchor and using it
type-safe. This is an example of a direct derive
from an existing (simple) Item (CntInt16) and thus
re-using the same ItemAdministrator.
Slightly adapted implementations and tests
Change-Id: I1a0222f04f59130bb51e29e3871d0bf7766b84ee
Diffstat (limited to 'sw/source/uibase/shells/drwbassh.cxx')
-rw-r--r-- | sw/source/uibase/shells/drwbassh.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx index a354fd3b8c18..b236d48fcc7c 100644 --- a/sw/source/uibase/shells/drwbassh.cxx +++ b/sw/source/uibase/shells/drwbassh.cxx @@ -63,7 +63,7 @@ #include <fmtfollowtextflow.hxx> // I2TM -#include <item/simple/CntInt16.hxx> +#include <svx/item/TransformAnchor.hxx> // ~I2TM using namespace ::com::sun::star; @@ -218,8 +218,9 @@ void SwDrawBaseShell::Execute(SfxRequest const &rReq) pSdrView->GetAttributes( aSet ); // I2TM - aSet.slotSet().SetSlot(SID_ATTR_TRANSFORM_ANCHOR, Item::CntInt16::Create(static_cast<sal_Int16>(nAnchor))); + aSet.itemSet().SetItem(Item::TransformAnchor::Create(nAnchor)); // ~I2TM + bool bRTL; bool bVertL2R; aSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_IN_VERTICAL_TEXT, pSh->IsFrameVertical(true, bRTL, bVertL2R))); @@ -268,16 +269,16 @@ void SwDrawBaseShell::Execute(SfxRequest const &rReq) bool bSingleSelection = rMarkList.GetMarkCount() == 1; // I2TM - if(const auto Slot(pOutSet->slotSet().GetSlot<const Item::CntInt16>(SID_ATTR_TRANSFORM_ANCHOR)); Slot) + if(const auto Item(pOutSet->itemSet().GetStateAndItem<const Item::TransformAnchor>()); Item.HasItem()) { if(!bSingleSelection) { - pSh->ChgAnchor(static_cast<RndStdIds>(Slot->GetValue()), false, bPosCorr); + pSh->ChgAnchor(Item.GetItem()->GetAnchorType(), false, bPosCorr); } else { SwFormatAnchor aAnchor(pFrameFormat->GetAnchor()); - aAnchor.SetType(static_cast<RndStdIds>(Slot->GetValue())); + aAnchor.SetType(Item.GetItem()->GetAnchorType()); aFrameAttrSet.Put( aAnchor ); } } |