diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-12-30 20:33:52 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-07 14:22:07 +0100 |
commit | 8295a3344704ce9a18489933c499a50c403f1a3d (patch) | |
tree | 92a10017311909e3010624b39acddfcf7d3eba00 /svx/source/sdr | |
parent | 8accfa30343195b5d7cfd111301677a6a9b6a21b (diff) |
remove E3D_INVENTOR_FLAG and convert SdrObjKind to scoped enum
We don't need E3D_INVENTOR_FLAG, we can just check if the SdrObjKind is
in the right range.
Which exposes some dodgy code in DrawViewShell::GetMenuStateSel
SfxItemState::DEFAULT == rSet.GetItemState( OBJ_TITLETEXT ) ||
SfxItemState::DEFAULT == rSet.GetItemState( OBJ_OUTLINETEXT ) ||
which has been there ever since
commit f47a9d9db3d06927380bb79b04bb6d4721a92d2b
Date: Mon Sep 18 16:07:07 2000 +0000
initial import
just remove that.
In SwFEShell::ImpEndCreate() move some logic around to avoid
using an out-of-range SdrObjKind value
Change-Id: I4620bfe61aca8f7415503debe3c84bfe5f4368a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127763
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/sdr')
4 files changed, 10 insertions, 10 deletions
diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx index 020e17be2d76..6428e5a66520 100644 --- a/svx/source/sdr/contact/viewcontactofgraphic.cxx +++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx @@ -241,7 +241,7 @@ namespace sdr::contact // needed and can be deleted. // create temp RectObj as TextObj and set needed attributes - SdrRectObj* pRectObj(new SdrRectObj(GetGrafObject().getSdrModelFromSdrObject(), OBJ_TEXT)); + SdrRectObj* pRectObj(new SdrRectObj(GetGrafObject().getSdrModelFromSdrObject(), SdrObjKind::Text)); pRectObj->NbcSetText(aDraftText); pRectObj->SetMergedItem(SvxColorItem(COL_LIGHTRED, EE_CHAR_COLOR)); diff --git a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx index c05905cbfc20..042d2160a0cf 100644 --- a/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrcircobj.cxx @@ -61,12 +61,12 @@ namespace sdr::contact aObjectRange.getMinX(), aObjectRange.getMinY())); // create primitive data - const sal_uInt16 nIdentifier(GetCircObj().GetObjIdentifier()); + const SdrObjKind nIdentifier(GetCircObj().GetObjIdentifier()); // always create primitives to allow the decomposition of SdrEllipsePrimitive2D // or SdrEllipseSegmentPrimitive2D to create needed invisible elements for HitTest // and/or BoundRect - if(OBJ_CIRC == nIdentifier) + if(SdrObjKind::CircleOrEllipse == nIdentifier) { const drawinglayer::primitive2d::Primitive2DReference xReference( new drawinglayer::primitive2d::SdrEllipsePrimitive2D( @@ -81,8 +81,8 @@ namespace sdr::contact const auto nNewEnd(rItemSet.Get(SDRATTR_CIRCENDANGLE).GetValue()); const double fStart(toRadians((36000_deg100 - nNewEnd) % 36000_deg100)); const double fEnd(toRadians((36000_deg100 - nNewStart) % 36000_deg100)); - const bool bCloseSegment(OBJ_CARC != nIdentifier); - const bool bCloseUsingCenter(OBJ_SECT == nIdentifier); + const bool bCloseSegment(SdrObjKind::CircleArc != nIdentifier); + const bool bCloseUsingCenter(SdrObjKind::CircleSection == nIdentifier); const drawinglayer::primitive2d::Primitive2DReference xReference( new drawinglayer::primitive2d::SdrEllipseSegmentPrimitive2D( diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx index 96acb10e96f2..f87906240338 100644 --- a/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx @@ -97,7 +97,7 @@ bool ViewObjectContactOfSdrObj::isPrimitiveVisible(const DisplayInfo& rDisplayIn if(bHideOle || bHideChart || bHideDraw || bHideFormControl) { - if(OBJ_OLE2 == rObject.GetObjIdentifier()) + if(SdrObjKind::OLE2 == rObject.GetObjIdentifier()) { if(static_cast<const SdrOle2Obj&>(rObject).IsChart()) { @@ -116,7 +116,7 @@ bool ViewObjectContactOfSdrObj::isPrimitiveVisible(const DisplayInfo& rDisplayIn } } } - else if(OBJ_GRAF == rObject.GetObjIdentifier()) + else if(SdrObjKind::Graphic == rObject.GetObjIdentifier()) { // graphic handled like OLE if(bHideOle) diff --git a/svx/source/sdr/properties/textproperties.cxx b/svx/source/sdr/properties/textproperties.cxx index 75bbb9a89e37..d361080e2062 100644 --- a/svx/source/sdr/properties/textproperties.cxx +++ b/svx/source/sdr/properties/textproperties.cxx @@ -280,7 +280,7 @@ namespace sdr::properties if(GetStyleSheet()) { - if((OBJ_OUTLINETEXT == rObj.GetTextKind()) && (SdrInventor::Default == rObj.GetObjInventor())) + if((SdrObjKind::OutlineText == rObj.GetTextKind()) && (SdrInventor::Default == rObj.GetObjInventor())) { OUString aNewStyleSheetName(GetStyleSheet()->GetName()); aNewStyleSheetName = aNewStyleSheetName.copy(0, aNewStyleSheetName.getLength() - 1); @@ -361,9 +361,9 @@ namespace sdr::properties if( rObj.GetObjInventor() == SdrInventor::Default ) { - const sal_uInt16 nSdrObjKind = rObj.GetObjIdentifier(); + const SdrObjKind nSdrObjKind = rObj.GetObjIdentifier(); - if( nSdrObjKind == OBJ_TITLETEXT || nSdrObjKind == OBJ_OUTLINETEXT ) + if( nSdrObjKind == SdrObjKind::TitleText || nSdrObjKind == SdrObjKind::OutlineText ) return; // no defaults for presentation objects } |