summaryrefslogtreecommitdiff
path: root/include/svx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-12-30 20:33:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-01-07 14:22:07 +0100
commit8295a3344704ce9a18489933c499a50c403f1a3d (patch)
tree92a10017311909e3010624b39acddfcf7d3eba00 /include/svx
parent8accfa30343195b5d7cfd111301677a6a9b6a21b (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 'include/svx')
-rw-r--r--include/svx/fmtools.hxx4
-rw-r--r--include/svx/sidebar/SelectionAnalyzer.hxx13
-rw-r--r--include/svx/svdedxv.hxx2
-rw-r--r--include/svx/svdobjkind.hxx219
-rw-r--r--include/svx/svdopath.hxx8
-rw-r--r--include/svx/svdotext.hxx8
-rw-r--r--include/svx/unoapi.hxx3
-rw-r--r--include/svx/unopage.hxx2
-rw-r--r--include/svx/unoprov.hxx15
-rw-r--r--include/svx/unoshape.hxx4
10 files changed, 140 insertions, 138 deletions
diff --git a/include/svx/fmtools.hxx b/include/svx/fmtools.hxx
index 869023f06f7f..10f52d474977 100644
--- a/include/svx/fmtools.hxx
+++ b/include/svx/fmtools.hxx
@@ -43,7 +43,7 @@ namespace com::sun::star::sdbc { class SQLException; }
namespace com::sun::star::sdbc { class XRowSet; }
namespace com::sun::star::sdb { class SQLContext; }
namespace com::sun::star::sdb { struct SQLErrorEvent; }
-
+enum class SdrObjKind : sal_uInt16;
// common types
@@ -160,7 +160,7 @@ public:
void dispose();
};
-sal_Int16 getControlTypeByObject(const css::uno::Reference< css::lang::XServiceInfo>& _rxObject);
+SdrObjKind getControlTypeByObject(const css::uno::Reference< css::lang::XServiceInfo>& _rxObject);
// get the object type (OBJ_FM_...) from the services the object supports
diff --git a/include/svx/sidebar/SelectionAnalyzer.hxx b/include/svx/sidebar/SelectionAnalyzer.hxx
index a7b8cba99d4c..349db88513b5 100644
--- a/include/svx/sidebar/SelectionAnalyzer.hxx
+++ b/include/svx/sidebar/SelectionAnalyzer.hxx
@@ -25,6 +25,7 @@
class SdrMarkList;
class SdrObject;
enum class SdrInventor : sal_uInt32;
+enum class SdrObjKind : sal_uInt16;
namespace svx::sidebar {
@@ -52,20 +53,20 @@ public:
private:
static vcl::EnumContext::Context GetContextForObjectId_SC (
- const sal_uInt16 nObjectId);
+ const SdrObjKind nObjectId);
static vcl::EnumContext::Context GetContextForObjectId_SD (
- const sal_uInt16 nObjectId,
+ const SdrObjKind nObjectId,
const ViewType eViewType);
static SdrInventor GetInventorTypeFromMark (
const SdrMarkList& rMarkList);
- static sal_uInt16 GetObjectTypeFromMark (
+ static SdrObjKind GetObjectTypeFromMark (
const SdrMarkList& rMarkList);
- static sal_uInt16 GetObjectTypeFromGroup (
+ static SdrObjKind GetObjectTypeFromGroup (
const SdrObject* pObj);
static bool IsShapeType (
- const sal_uInt16 nType);
+ const SdrObjKind nType);
static bool IsTextObjType (
- const sal_uInt16 nType);
+ const SdrObjKind nType);
};
} // end of namespace svx::sidebar
diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx
index ed8f0c08939a..cbdecfea5298 100644
--- a/include/svx/svdedxv.hxx
+++ b/include/svx/svdedxv.hxx
@@ -298,7 +298,7 @@ public:
const rtl::Reference< sdr::SelectionController >& getSelectionController() const { return mxSelectionController; }
/** returns true if the shape identified by its inventor and identifier supports format paint brush operation */
- static bool SupportsFormatPaintbrush( SdrInventor nObjectInventor, sal_uInt16 nObjectIdentifier );
+ static bool SupportsFormatPaintbrush( SdrInventor nObjectInventor, SdrObjKind nObjectIdentifier );
/** returns a format paint brush set from the current selection */
void TakeFormatPaintBrush( std::shared_ptr< SfxItemSet >& rFormatSet );
diff --git a/include/svx/svdobjkind.hxx b/include/svx/svdobjkind.hxx
index 827b35e3b339..187fd0d6ffb5 100644
--- a/include/svx/svdobjkind.hxx
+++ b/include/svx/svdobjkind.hxx
@@ -21,127 +21,134 @@
#include <com/sun/star/form/FormComponentType.hpp>
-enum SdrObjKind
+enum class SdrObjKind : sal_uInt16
{
- OBJ_NONE = 0, /// abstract object (SdrObject)
- OBJ_GRUP = 1, /// object group
- OBJ_LINE = 2, /// line
- OBJ_RECT = 3, /// rectangle (round corners optional)
- OBJ_CIRC = 4, /// circle, ellipse
- OBJ_SECT = 5, /// circle section
- OBJ_CARC = 6, /// circle arc
- OBJ_CCUT = 7, /// circle cut
- OBJ_POLY = 8, /// polygon, PolyPolygon
- OBJ_PLIN = 9, /// PolyLine
- OBJ_PATHLINE = 10, /// open Bezier-curve
- OBJ_PATHFILL = 11, /// closed Bezier-curve
- OBJ_FREELINE = 12, /// open free-hand line
- OBJ_FREEFILL = 13, /// closed free-hand line
- OBJ_SPLNLINE = 14, /// natural cubic Spline (ni)
- OBJ_SPLNFILL = 15, /// periodic cubic Spline (ni)
- OBJ_TEXT = 16, /// text object
- OBJ_TITLETEXT = 20, /// TitleText, special text object for StarDraw
- OBJ_OUTLINETEXT = 21, /// OutlineText, special text object for StarDraw
- OBJ_GRAF = 22, /// foreign graphic (StarView Graphic)
- OBJ_OLE2 = 23, /// OLE object
- OBJ_EDGE = 24, /// connector object
- OBJ_CAPTION = 25, /// caption object
- OBJ_PATHPOLY = 26, /// Polygon/PolyPolygon represented by SdrPathObj
- OBJ_PATHPLIN = 27, /// Polyline represented by SdrPathObj
- OBJ_PAGE = 28, /// object that represents a SdrPage
- OBJ_MEASURE = 29, /// measurement object
- OBJ_FRAME = 31, /// continuously activated OLE (PlugIn-Frame or similar)
- OBJ_UNO = 32, /// Universal Network Object packed into SvDraw object
- OBJ_CUSTOMSHAPE = 33, /// custom shape
- OBJ_MEDIA = 34, /// media shape
- OBJ_TABLE = 35, /// table
+ NONE = 0, /// abstract object (SdrObject)
+ Group = 1, /// object group
+ Line = 2, /// line
+ Rectangle = 3, /// rectangle (round corners optional)
+ CircleOrEllipse = 4, /// circle, ellipse
+ CircleSection = 5, /// circle section
+ CircleArc = 6, /// circle arc
+ CircleCut = 7, /// circle cut
+ Polygon = 8, /// polygon, PolyPolygon
+ PolyLine = 9, /// PolyLine
+ PathLine = 10, /// open Bezier-curve
+ PathFill = 11, /// closed Bezier-curve
+ FreehandLine = 12, /// open free-hand line
+ FreehandFill = 13, /// closed free-hand line
+ SplineLine = 14, /// natural cubic Spline (ni)
+ SplineFill = 15, /// periodic cubic Spline (ni)
+ Text = 16, /// text object
+ TitleText = 20, /// TitleText, special text object for StarDraw
+ OutlineText = 21, /// OutlineText, special text object for StarDraw
+ Graphic = 22, /// foreign graphic (StarView Graphic)
+ OLE2 = 23, /// OLE object
+ Edge = 24, /// connector object
+ Caption = 25, /// caption object
+ PathPoly = 26, /// Polygon/PolyPolygon represented by SdrPathObj
+ PathPolyLine = 27, /// Polyline represented by SdrPathObj
+ Page = 28, /// object that represents a SdrPage
+ Measure = 29, /// measurement object
+ OLEPluginFrame = 31, /// continuously activated OLE (PlugIn-Frame or similar)
+ UNO = 32, /// Universal Network Object packed into SvDraw object
+ CustomShape = 33, /// custom shape
+ Media = 34, /// media shape
+ Table = 35, /// table
- OBJ_OLE2_APPLET = 100,
- OBJ_OLE2_PLUGIN = 101,
+ OLE2Applet = 100,
+ OLE2Plugin = 101,
// engine3d, arbitrarily place at 200
- E3D_SCENE_ID = 202,
+ E3D_Scene = 202,
// E3D_OBJECT_ID should not be used, it's only a helper class for E3DScene and E3DCompoundObject
- E3D_OBJECT_ID = 203,
- E3D_CUBEOBJ_ID = 204,
- E3D_SPHEREOBJ_ID = 205,
- E3D_EXTRUDEOBJ_ID = 206,
- E3D_LATHEOBJ_ID = 207,
- E3D_COMPOUNDOBJ_ID = 208,
- E3D_POLYGONOBJ_ID = 209,
+ E3D_Object = 203,
+ E3D_Cube = 204,
+ E3D_Sphere = 205,
+ E3D_Extrusion = 206,
+ E3D_Lathe = 207,
+ E3D_CompoundObject = 208,
+ E3D_Polygon = 209,
+ E3D_INVENTOR_FIRST = E3D_Scene,
+ E3D_INVENTOR_LAST = E3D_Polygon,
// for form components, arbitrarily place at 300
- OBJ_FM_CONTROL = 300 + css::form::FormComponentType::CONTROL,
- OBJ_FM_EDIT = 300 + css::form::FormComponentType::TEXTFIELD,
- OBJ_FM_BUTTON = 300 + css::form::FormComponentType::COMMANDBUTTON,
- OBJ_FM_FIXEDTEXT = 300 + css::form::FormComponentType::FIXEDTEXT,
- OBJ_FM_LISTBOX = 300 + css::form::FormComponentType::LISTBOX,
- OBJ_FM_CHECKBOX = 300 + css::form::FormComponentType::CHECKBOX,
- OBJ_FM_COMBOBOX = 300 + css::form::FormComponentType::COMBOBOX,
- OBJ_FM_RADIOBUTTON = 300 + css::form::FormComponentType::RADIOBUTTON,
- OBJ_FM_GROUPBOX = 300 + css::form::FormComponentType::GROUPBOX,
- OBJ_FM_GRID = 300 + css::form::FormComponentType::GRIDCONTROL,
- OBJ_FM_IMAGEBUTTON = 300 + css::form::FormComponentType::IMAGEBUTTON,
- OBJ_FM_FILECONTROL = 300 + css::form::FormComponentType::FILECONTROL,
- OBJ_FM_DATEFIELD = 300 + css::form::FormComponentType::DATEFIELD,
- OBJ_FM_TIMEFIELD = 300 + css::form::FormComponentType::TIMEFIELD,
- OBJ_FM_NUMERICFIELD = 300 + css::form::FormComponentType::NUMERICFIELD,
- OBJ_FM_CURRENCYFIELD = 300 + css::form::FormComponentType::CURRENCYFIELD,
- OBJ_FM_PATTERNFIELD = 300 + css::form::FormComponentType::PATTERNFIELD,
- OBJ_FM_HIDDEN = 300 + css::form::FormComponentType::HIDDENCONTROL,
- OBJ_FM_IMAGECONTROL = 300 + css::form::FormComponentType::IMAGECONTROL,
- OBJ_FM_FORMATTEDFIELD = 300 + css::form::FormComponentType::PATTERNFIELD + 1,
- OBJ_FM_SCROLLBAR = 300 + css::form::FormComponentType::PATTERNFIELD + 2,
- OBJ_FM_SPINBUTTON = 300 + css::form::FormComponentType::PATTERNFIELD + 3,
- OBJ_FM_NAVIGATIONBAR = 300 + css::form::FormComponentType::PATTERNFIELD + 4,
+ FormControl = 300 + css::form::FormComponentType::CONTROL,
+ FormEdit = 300 + css::form::FormComponentType::TEXTFIELD,
+ FormButton = 300 + css::form::FormComponentType::COMMANDBUTTON,
+ FormFixedText = 300 + css::form::FormComponentType::FIXEDTEXT,
+ FormListbox = 300 + css::form::FormComponentType::LISTBOX,
+ FormCheckbox = 300 + css::form::FormComponentType::CHECKBOX,
+ FormCombobox = 300 + css::form::FormComponentType::COMBOBOX,
+ FormRadioButton = 300 + css::form::FormComponentType::RADIOBUTTON,
+ FormGroupBox = 300 + css::form::FormComponentType::GROUPBOX,
+ FormGrid = 300 + css::form::FormComponentType::GRIDCONTROL,
+ FormImageButton = 300 + css::form::FormComponentType::IMAGEBUTTON,
+ FormFileControl = 300 + css::form::FormComponentType::FILECONTROL,
+ FormDateField = 300 + css::form::FormComponentType::DATEFIELD,
+ FormTimeField = 300 + css::form::FormComponentType::TIMEFIELD,
+ FormNumericField = 300 + css::form::FormComponentType::NUMERICFIELD,
+ FormCurrencyField = 300 + css::form::FormComponentType::CURRENCYFIELD,
+ FormPatternField = 300 + css::form::FormComponentType::PATTERNFIELD,
+ FormHidden = 300 + css::form::FormComponentType::HIDDENCONTROL,
+ FormImageControl = 300 + css::form::FormComponentType::IMAGECONTROL,
+ FormFormattedField = 300 + css::form::FormComponentType::PATTERNFIELD + 1,
+ FormScrollbar = 300 + css::form::FormComponentType::PATTERNFIELD + 2,
+ FormSpinButton = 300 + css::form::FormComponentType::PATTERNFIELD + 3,
+ FormNavigationBar = 300 + css::form::FormComponentType::PATTERNFIELD + 4,
// basctl, arbitrarily place at 400
- OBJ_DLG_CONTROL = 401,
- OBJ_DLG_DIALOG = 402,
- OBJ_DLG_PUSHBUTTON = 403,
- OBJ_DLG_RADIOBUTTON = 404,
- OBJ_DLG_CHECKBOX = 405,
- OBJ_DLG_LISTBOX = 406,
- OBJ_DLG_COMBOBOX = 407,
- OBJ_DLG_GROUPBOX = 408,
- OBJ_DLG_EDIT = 409,
- OBJ_DLG_FIXEDTEXT = 410,
- OBJ_DLG_IMAGECONTROL = 411,
- OBJ_DLG_PROGRESSBAR = 412,
- OBJ_DLG_HSCROLLBAR = 413,
- OBJ_DLG_VSCROLLBAR = 414,
- OBJ_DLG_HFIXEDLINE = 415,
- OBJ_DLG_VFIXEDLINE = 416,
- OBJ_DLG_DATEFIELD = 417,
- OBJ_DLG_TIMEFIELD = 418,
- OBJ_DLG_NUMERICFIELD = 419,
- OBJ_DLG_CURRENCYFIELD = 420,
- OBJ_DLG_FORMATTEDFIELD = 421,
- OBJ_DLG_PATTERNFIELD = 422,
- OBJ_DLG_FILECONTROL = 423,
- OBJ_DLG_TREECONTROL = 424,
- OBJ_DLG_SPINBUTTON = 425,
- OBJ_DLG_GRIDCONTROL = 426,
- OBJ_DLG_HYPERLINKCONTROL = 427,
+ BasicDialogControl = 401,
+ BasicDialogDialog = 402,
+ BasicDialogPushButton = 403,
+ BasicDialogRadioButton = 404,
+ BasicDialogCheckbox = 405,
+ BasicDialogListbox = 406,
+ BasicDialogCombobox = 407,
+ BasicDialogGroupBox = 408,
+ BasicDialogEdit = 409,
+ BasicDialogFixedText = 410,
+ BasicDialogImageControl = 411,
+ BasicDialogProgressbar = 412,
+ BasicDialogHorizontalScrollbar = 413,
+ BasicDialogVerticalScrollbar = 414,
+ BasicDialogHorizontalFixedLine = 415,
+ BasicDialogVerticalFixedLine = 416,
+ BasicDialogDateField = 417,
+ BasicDialogTimeField = 418,
+ BasicDialogNumericField = 419,
+ BasicDialogCurencyField = 420,
+ BasicDialogFormattedField = 421,
+ BasicDialogPatternField = 422,
+ BasicDialogFileControl = 423,
+ BasicDialogTreeControl = 424,
+ BasicDialogSpinButton = 425,
+ BasicDialogGridControl = 426,
+ BasicDialogHyperlinkControl = 427,
- OBJ_DLG_FORMRADIO = 428,
- OBJ_DLG_FORMCHECK = 429,
- OBJ_DLG_FORMLIST = 430,
- OBJ_DLG_FORMCOMBO = 431,
- OBJ_DLG_FORMSPIN = 432,
- OBJ_DLG_FORMVSCROLL = 433,
- OBJ_DLG_FORMHSCROLL = 434,
+ BasicDialogFormRadio = 428,
+ BasicDialogFormCheck = 429,
+ BasicDialogFormList = 430,
+ BasicDialogFormCombo = 431,
+ BasicDialogFormSpin = 432,
+ BasicDialogFormVerticalScroll = 433,
+ BasicDialogFormHorizontalScroll = 434,
// reportdesign, arbitrarily place at 500
- OBJ_RD_FIXEDTEXT = 501,
- OBJ_RD_IMAGECONTROL = 502,
- OBJ_RD_FORMATTEDFIELD = 503,
- OBJ_RD_HFIXEDLINE = 504,
- OBJ_RD_VFIXEDLINE = 505,
- OBJ_RD_SUBREPORT = 506,
+ ReportDesignFixedText = 501,
+ ReportDesignImageControl = 502,
+ ReportDesignFormattedField = 503,
+ ReportDesignHorizontalFixedLine = 504,
+ ReportDesignVerticalFixedLine = 505,
+ ReportDesignSubReport = 506,
// writer, arbitrarily place at 600
SwFlyDrawObjIdentifier = 601
};
+inline constexpr bool IsInventorE3D(SdrObjKind e)
+{
+ return e >= SdrObjKind::E3D_INVENTOR_FIRST && e <= SdrObjKind::E3D_INVENTOR_LAST;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/svdopath.hxx b/include/svx/svdopath.hxx
index fc7280670c97..dd854468bb3f 100644
--- a/include/svx/svdopath.hxx
+++ b/include/svx/svdopath.hxx
@@ -143,10 +143,10 @@ public:
void NbcSetPathPoly(const basegfx::B2DPolyPolygon& rPathPoly);
// special functions for Bezier-polygon handling
- bool IsClosed() const { return meKind==OBJ_POLY || meKind==OBJ_PATHPOLY || meKind==OBJ_PATHFILL || meKind==OBJ_FREEFILL || meKind==OBJ_SPLNFILL; }
- bool IsLine() const { return meKind==OBJ_PLIN || meKind==OBJ_PATHPLIN || meKind==OBJ_PATHLINE || meKind==OBJ_FREELINE || meKind==OBJ_SPLNLINE || meKind==OBJ_LINE; }
- bool IsBezier() const { return meKind==OBJ_PATHLINE || meKind==OBJ_PATHFILL; }
- bool IsSpline() const { return meKind==OBJ_SPLNLINE || meKind==OBJ_SPLNFILL; }
+ bool IsClosed() const { return meKind==SdrObjKind::Polygon || meKind==SdrObjKind::PathPoly || meKind==SdrObjKind::PathFill || meKind==SdrObjKind::FreehandFill || meKind==SdrObjKind::SplineFill; }
+ bool IsLine() const { return meKind==SdrObjKind::PolyLine || meKind==SdrObjKind::PathPolyLine || meKind==SdrObjKind::PathLine || meKind==SdrObjKind::FreehandLine || meKind==SdrObjKind::SplineLine || meKind==SdrObjKind::Line; }
+ bool IsBezier() const { return meKind==SdrObjKind::PathLine || meKind==SdrObjKind::PathFill; }
+ bool IsSpline() const { return meKind==SdrObjKind::SplineLine || meKind==SdrObjKind::SplineFill; }
// close/open path
// if opening, move end point by "nOpenDistance"
diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index d192552d16ad..03c828db7493 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -184,9 +184,9 @@ protected:
SdrOutliner* mpEditingOutliner;
// Possible values for eTextKind are:
- // OBJ_TEXT regular text frame
- // OBJ_TITLETEXT TitleText for presentations
- // OBJ_OUTLINETEXT OutlineText for presentations
+ // SdrObjKind::Text regular text frame
+ // SdrObjKind::TitleText TitleText for presentations
+ // SdrObjKind::OutlineText OutlineText for presentations
// eTextKind only has meaning when bTextFrame=sal_True, since otherwise
// we're dealing with a labeled graphical object
SdrObjKind meTextKind;
@@ -332,7 +332,7 @@ public:
virtual bool NbcAdjustTextFrameWidthAndHeight(bool bHgt = true, bool bWdt = true);
virtual bool AdjustTextFrameWidthAndHeight();
bool IsTextFrame() const { return mbTextFrame; }
- bool IsOutlText() const { return mbTextFrame && (meTextKind==OBJ_OUTLINETEXT || meTextKind==OBJ_TITLETEXT); }
+ bool IsOutlText() const { return mbTextFrame && (meTextKind==SdrObjKind::OutlineText || meTextKind==SdrObjKind::TitleText); }
/// returns true if the PPT autofit of text into shape bounds is enabled. implies IsFitToSize()==false!
bool IsAutoFit() const;
/// returns true if the old feature for fitting shape content should into shape is enabled. implies IsAutoFit()==false!
diff --git a/include/svx/unoapi.hxx b/include/svx/unoapi.hxx
index 3c9e04d46af1..3107a483579d 100644
--- a/include/svx/unoapi.hxx
+++ b/include/svx/unoapi.hxx
@@ -34,6 +34,7 @@ class SdrPage;
class SvxNumBulletItem;
class SfxItemPool;
enum class SdrInventor : sal_uInt32;
+enum class SdrObjKind : sal_uInt16;
/**
* Creates a StarOffice API wrapper with the given type and inventor
@@ -41,7 +42,7 @@ enum class SdrInventor : sal_uInt32;
*
* @throws css::uno::RuntimeException
*/
-SVXCORE_DLLPUBLIC rtl::Reference<SvxShape> CreateSvxShapeByTypeAndInventor(sal_uInt16 nType, SdrInventor nInventor, OUString const & referer);
+SVXCORE_DLLPUBLIC rtl::Reference<SvxShape> CreateSvxShapeByTypeAndInventor(SdrObjKind nType, SdrInventor nInventor, OUString const & referer);
/** Returns a StarOffice API wrapper for the given SdrObject */
SVXCORE_DLLPUBLIC css::uno::Reference< css::drawing::XShape > GetXShapeForSdrObject( SdrObject* pObj ) noexcept;
diff --git a/include/svx/unopage.hxx b/include/svx/unopage.hxx
index 4b00244a7b17..e69eb7ec8995 100644
--- a/include/svx/unopage.hxx
+++ b/include/svx/unopage.hxx
@@ -88,7 +88,7 @@ class SVXCORE_DLLPUBLIC SvxDrawPage : protected cppu::BaseMutex,
virtual SdrObject *CreateSdrObject_( const css::uno::Reference< css::drawing::XShape >& xShape );
/// @throws css::uno::RuntimeException
- static rtl::Reference<SvxShape> CreateShapeByTypeAndInventor( sal_uInt16 nType, SdrInventor nInventor, SdrObject *pObj, SvxDrawPage *pPage = nullptr, OUString const & referer = OUString() );
+ static rtl::Reference<SvxShape> CreateShapeByTypeAndInventor( SdrObjKind nType, SdrInventor nInventor, SdrObject *pObj, SvxDrawPage *pPage = nullptr, OUString const & referer = OUString() );
// The following method is called if a SvxShape object is to be created.
// Derived classes can create a derivation or an SvxShape aggregating object.
diff --git a/include/svx/unoprov.hxx b/include/svx/unoprov.hxx
index 0b03c7732bbc..f7ee83979f0d 100644
--- a/include/svx/unoprov.hxx
+++ b/include/svx/unoprov.hxx
@@ -27,22 +27,21 @@
#include <editeng/unoipset.hxx>
#include <rtl/ref.hxx>
#include <memory>
-
+#include <optional>
class SvxItemPropertySet;
class SfxItemPool;
+enum class SdrObjKind : sal_uInt16;
/**
* class UHashMap
*/
-
-#define UHASHMAP_NOTFOUND sal::static_int_cast< sal_uInt32 >(~0)
class UHashMap
{
UHashMap() = delete;
public:
- static sal_uInt32 getId( const OUString& rCompareString );
- static OUString getNameFromId (sal_uInt32 nId);
+ static std::optional<SdrObjKind> getId( const OUString& rCompareString );
+ static OUString getNameFromId (SdrObjKind nId);
static css::uno::Sequence< OUString > getServiceNames();
};
@@ -93,12 +92,6 @@ public:
};
/**
- * Globals
- */
-
-#define E3D_INVENTOR_FLAG (0x80000000)
-
-/**
* class SvxPropertySetInfoPool
*/
diff --git a/include/svx/unoshape.hxx b/include/svx/unoshape.hxx
index 20cbf28f6d89..a6ebdeed682d 100644
--- a/include/svx/unoshape.hxx
+++ b/include/svx/unoshape.hxx
@@ -210,8 +210,8 @@ public:
svx::PropertyChangeNotifier& getShapePropertyChangeNotifier();
- void setShapeKind( sal_uInt32 nKind );
- sal_uInt32 getShapeKind() const;
+ void setShapeKind( SdrObjKind nKind );
+ SdrObjKind getShapeKind() const;
// styles need this
static bool SetFillAttribute( sal_uInt16 nWID, const OUString& rName, SfxItemSet& rSet, SdrModel const * pModel );