diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-11-05 14:04:04 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-11-06 17:16:09 +0100 |
commit | de78304d92140901d19a6ea17bdc1d568df955c4 (patch) | |
tree | f0494ee90a4d7493e2381bbd17f5c1f337a35f0e /svx/source/unodraw | |
parent | 8c9b8c5970a08c2ef0ccddb7a691f3731d39175a (diff) |
make SdrObject Identifiers SdrObjKind enum members
with unique values so that, e.g.
if (pObj->GetObjIdentifier() == OBJ_LINE)
is only true if pObj is a SdrPathObj and not a E3dScene
Change-Id: I30c91e57eb27141390c644dec42e2a4bee96edf0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105374
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source/unodraw')
-rw-r--r-- | svx/source/unodraw/unopage.cxx | 12 | ||||
-rw-r--r-- | svx/source/unodraw/unoprov.cxx | 2 | ||||
-rw-r--r-- | svx/source/unodraw/unoshap2.cxx | 1 | ||||
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 6 |
4 files changed, 14 insertions, 7 deletions
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx index 0e3ce64a4166..27651bc95e70 100644 --- a/svx/source/unodraw/unopage.cxx +++ b/svx/source/unodraw/unopage.cxx @@ -43,7 +43,7 @@ #include <svx/unopage.hxx> #include "shapeimpl.hxx" #include <svx/dialmgr.hxx> -#include <svx/globl3d.hxx> +#include <svx/svdobjkind.hxx> #include <svx/unoprov.hxx> #include <svx/unoapi.hxx> #include <extrud3d.hxx> @@ -498,7 +498,7 @@ void SAL_CALL SvxDrawPage::ungroup( const Reference< drawing::XShapeGroup >& aGr SdrObject* SvxDrawPage::CreateSdrObject_(const Reference< drawing::XShape > & xShape) { - sal_uInt16 nType = 0; + SdrObjKind nType = OBJ_NONE; SdrInventor nInventor; GetTypeAndInventor( nType, nInventor, xShape->getShapeType() ); @@ -566,7 +566,7 @@ SdrObject* SvxDrawPage::CreateSdrObject_(const Reference< drawing::XShape > & xS return pNewObj; } -void SvxDrawPage::GetTypeAndInventor( sal_uInt16& rType, SdrInventor& rInventor, const OUString& aName ) throw() +void SvxDrawPage::GetTypeAndInventor( SdrObjKind& rType, SdrInventor& rInventor, const OUString& aName ) throw() { sal_uInt32 nTempType = UHashMap::getId( aName ); @@ -589,12 +589,12 @@ void SvxDrawPage::GetTypeAndInventor( sal_uInt16& rType, SdrInventor& rInventor, else if(nTempType & E3D_INVENTOR_FLAG) { rInventor = SdrInventor::E3d; - rType = static_cast<sal_uInt16>(nTempType & ~E3D_INVENTOR_FLAG); + rType = static_cast<SdrObjKind>(nTempType & ~E3D_INVENTOR_FLAG); } else { rInventor = SdrInventor::Default; - rType = static_cast<sal_uInt16>(nTempType); + rType = static_cast<SdrObjKind>(nTempType); switch( rType ) { @@ -603,6 +603,8 @@ void SvxDrawPage::GetTypeAndInventor( sal_uInt16& rType, SdrInventor& rInventor, case OBJ_OLE2_APPLET: rType = OBJ_OLE2; break; + default: + break; } } } diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx index dcb8d61e8334..c6a6ab7ada94 100644 --- a/svx/source/unodraw/unoprov.cxx +++ b/svx/source/unodraw/unoprov.cxx @@ -38,7 +38,7 @@ #include <svx/unoshprp.hxx> #include <svx/svx3ditems.hxx> #include <svx/svxids.hrc> -#include <svx/globl3d.hxx> +#include <svx/svdobjkind.hxx> #include <svx/strings.hrc> #include <strings.hxx> #include <svx/svdobj.hxx> diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index c7b0b6de609b..1ff2d3e03e9d 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -1132,6 +1132,7 @@ drawing::PolygonKind SvxShapePolyPolygon::GetPolygonKind() const case OBJ_PATHFILL: aRetval = drawing::PolygonKind_PATHFILL; break; case OBJ_FREELINE: aRetval = drawing::PolygonKind_FREELINE; break; case OBJ_FREEFILL: aRetval = drawing::PolygonKind_FREEFILL; break; + default: break; } } diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 9fbb60dbc55e..b60c6e686aea 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -43,7 +43,7 @@ #include <svx/xlnstit.hxx> #include <svx/xlnedit.hxx> #include <svx/svdmodel.hxx> -#include <svx/globl3d.hxx> +#include <svx/svdobjkind.hxx> #include <svx/unopage.hxx> #include <svx/unoshape.hxx> #include <svx/unoshtxt.hxx> @@ -1120,6 +1120,8 @@ static bool svx_needLogicRectHack( SdrObject const * pObj ) case OBJ_PATHPLIN: case OBJ_MEASURE: return true; + default: + break; } } return false; @@ -1961,6 +1963,8 @@ uno::Any SvxShape::GetAnyForItem( SfxItemSet const & aSet, const SfxItemProperty case OBJ_SECT: // sector eKind = drawing::CircleKind_SECTION; break; + default: + break; } aAny <<= eKind; } |