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/engine3d | |
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/engine3d')
-rw-r--r-- | svx/source/engine3d/cube3d.cxx | 2 | ||||
-rw-r--r-- | svx/source/engine3d/extrud3d.cxx | 4 | ||||
-rw-r--r-- | svx/source/engine3d/lathe3d.cxx | 4 | ||||
-rw-r--r-- | svx/source/engine3d/obj3d.cxx | 4 | ||||
-rw-r--r-- | svx/source/engine3d/objfac3d.cxx | 14 | ||||
-rw-r--r-- | svx/source/engine3d/polygn3d.cxx | 2 | ||||
-rw-r--r-- | svx/source/engine3d/scene3d.cxx | 2 | ||||
-rw-r--r-- | svx/source/engine3d/sphere3d.cxx | 2 |
8 files changed, 17 insertions, 17 deletions
diff --git a/svx/source/engine3d/cube3d.cxx b/svx/source/engine3d/cube3d.cxx index c68462860c35..adc9a86fbbe6 100644 --- a/svx/source/engine3d/cube3d.cxx +++ b/svx/source/engine3d/cube3d.cxx @@ -86,7 +86,7 @@ void E3dCubeObj::SetDefaultAttributes(const E3dDefaultAttributes& rDefault) SdrObjKind E3dCubeObj::GetObjIdentifier() const { - return E3D_CUBEOBJ_ID; + return SdrObjKind::E3D_Cube; } // Convert the object into a group object consisting of 6 polygons diff --git a/svx/source/engine3d/extrud3d.cxx b/svx/source/engine3d/extrud3d.cxx index d0cb345755a3..166d426c43f4 100644 --- a/svx/source/engine3d/extrud3d.cxx +++ b/svx/source/engine3d/extrud3d.cxx @@ -109,7 +109,7 @@ void E3dExtrudeObj::SetDefaultAttributes(const E3dDefaultAttributes& rDefault) SdrObjKind E3dExtrudeObj::GetObjIdentifier() const { - return E3D_EXTRUDEOBJ_ID; + return SdrObjKind::E3D_Extrusion; } E3dExtrudeObj* E3dExtrudeObj::CloneSdrObject(SdrModel& rTargetModel) const @@ -205,7 +205,7 @@ std::unique_ptr<SdrAttrObj,SdrObjectFreeOp> E3dExtrudeObj::GetBreakObj() { // create PathObj basegfx::B2DPolyPolygon aPoly = TransformToScreenCoor(aBackSide); - std::unique_ptr<SdrPathObj,SdrObjectFreeOp> pPathObj(new SdrPathObj(getSdrModelFromSdrObject(), OBJ_PLIN, aPoly)); + std::unique_ptr<SdrPathObj,SdrObjectFreeOp> pPathObj(new SdrPathObj(getSdrModelFromSdrObject(), SdrObjKind::PolyLine, aPoly)); SfxItemSet aSet(GetObjectItemSet()); aSet.Put(XLineStyleItem(css::drawing::LineStyle_SOLID)); diff --git a/svx/source/engine3d/lathe3d.cxx b/svx/source/engine3d/lathe3d.cxx index e811d0eebfeb..4880193f8159 100644 --- a/svx/source/engine3d/lathe3d.cxx +++ b/svx/source/engine3d/lathe3d.cxx @@ -114,7 +114,7 @@ void E3dLatheObj::SetDefaultAttributes(const E3dDefaultAttributes& rDefault) SdrObjKind E3dLatheObj::GetObjIdentifier() const { - return E3D_LATHEOBJ_ID; + return SdrObjKind::E3D_Lathe; } E3dLatheObj* E3dLatheObj::CloneSdrObject(SdrModel& rTargetModel) const @@ -186,7 +186,7 @@ std::unique_ptr<SdrAttrObj,SdrObjectFreeOp> E3dLatheObj::GetBreakObj() // create PathObj basegfx::B3DPolyPolygon aLathePoly3D(basegfx::utils::createB3DPolyPolygonFromB2DPolyPolygon(maPolyPoly2D)); basegfx::B2DPolyPolygon aTransPoly(TransformToScreenCoor(aLathePoly3D)); - std::unique_ptr<SdrPathObj,SdrObjectFreeOp> pPathObj(new SdrPathObj(getSdrModelFromSdrObject(), OBJ_PLIN, aTransPoly)); + std::unique_ptr<SdrPathObj,SdrObjectFreeOp> pPathObj(new SdrPathObj(getSdrModelFromSdrObject(), SdrObjKind::PolyLine, aTransPoly)); // Set Attribute SfxItemSet aSet(GetObjectItemSet()); diff --git a/svx/source/engine3d/obj3d.cxx b/svx/source/engine3d/obj3d.cxx index eed5b878033c..2863504b3607 100644 --- a/svx/source/engine3d/obj3d.cxx +++ b/svx/source/engine3d/obj3d.cxx @@ -108,7 +108,7 @@ SdrInventor E3dObject::GetObjInventor() const SdrObjKind E3dObject::GetObjIdentifier() const { - return E3D_OBJECT_ID; + return SdrObjKind::E3D_Object; } // Determine the capabilities of the object @@ -545,7 +545,7 @@ void E3dCompoundObject::AddToHdlList(SdrHdlList& rHdlList) const SdrObjKind E3dCompoundObject::GetObjIdentifier() const { - return E3D_COMPOUNDOBJ_ID; + return SdrObjKind::E3D_CompoundObject; } void E3dCompoundObject::RecalcSnapRect() diff --git a/svx/source/engine3d/objfac3d.cxx b/svx/source/engine3d/objfac3d.cxx index db626f649463..160406c17405 100644 --- a/svx/source/engine3d/objfac3d.cxx +++ b/svx/source/engine3d/objfac3d.cxx @@ -50,19 +50,19 @@ IMPL_STATIC_LINK( E3dObjFactory, MakeObject, SdrObjCreatorParams, aParams, SdrOb { switch ( aParams.nObjIdentifier ) { - case E3D_SCENE_ID: + case SdrObjKind::E3D_Scene: return new E3dScene(aParams.rSdrModel); - case E3D_POLYGONOBJ_ID : + case SdrObjKind::E3D_Polygon : return new E3dPolygonObj(aParams.rSdrModel); - case E3D_CUBEOBJ_ID : + case SdrObjKind::E3D_Cube : return new E3dCubeObj(aParams.rSdrModel); - case E3D_SPHEREOBJ_ID: + case SdrObjKind::E3D_Sphere: return new E3dSphereObj(aParams.rSdrModel); - case E3D_EXTRUDEOBJ_ID: + case SdrObjKind::E3D_Extrusion: return new E3dExtrudeObj(aParams.rSdrModel); - case E3D_LATHEOBJ_ID: + case SdrObjKind::E3D_Lathe: return new E3dLatheObj(aParams.rSdrModel); - case E3D_COMPOUNDOBJ_ID: + case SdrObjKind::E3D_CompoundObject: return new E3dCompoundObject(aParams.rSdrModel); default: break; diff --git a/svx/source/engine3d/polygn3d.cxx b/svx/source/engine3d/polygn3d.cxx index 22aecb44105a..e7a5623bf01d 100644 --- a/svx/source/engine3d/polygn3d.cxx +++ b/svx/source/engine3d/polygn3d.cxx @@ -177,7 +177,7 @@ void E3dPolygonObj::CreateDefaultTexture() E3dPolygonObj::~E3dPolygonObj() {} -SdrObjKind E3dPolygonObj::GetObjIdentifier() const { return E3D_POLYGONOBJ_ID; } +SdrObjKind E3dPolygonObj::GetObjIdentifier() const { return SdrObjKind::E3D_Polygon; } void E3dPolygonObj::SetPolyPolygon3D(const basegfx::B3DPolyPolygon& rNewPolyPoly3D) { diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx index 0a7253139330..79cb56665918 100644 --- a/svx/source/engine3d/scene3d.cxx +++ b/svx/source/engine3d/scene3d.cxx @@ -295,7 +295,7 @@ sal_uInt32 E3dScene::RemapOrdNum(sal_uInt32 nNewOrdNum) const SdrObjKind E3dScene::GetObjIdentifier() const { - return E3D_SCENE_ID; + return SdrObjKind::E3D_Scene; } void E3dScene::SetBoundRectDirty() diff --git a/svx/source/engine3d/sphere3d.cxx b/svx/source/engine3d/sphere3d.cxx index 7cc16a82ff65..6b56d2d44dbe 100644 --- a/svx/source/engine3d/sphere3d.cxx +++ b/svx/source/engine3d/sphere3d.cxx @@ -90,7 +90,7 @@ void E3dSphereObj::SetDefaultAttributes(const E3dDefaultAttributes& rDefault) SdrObjKind E3dSphereObj::GetObjIdentifier() const { - return E3D_SPHEREOBJ_ID; + return SdrObjKind::E3D_Sphere; } // Convert the object into a group object consisting of n polygons |