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 /chart2 | |
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 'chart2')
-rw-r--r-- | chart2/source/controller/main/ChartController_Window.cxx | 2 | ||||
-rw-r--r-- | chart2/source/controller/main/DrawCommandDispatch.cxx | 4 | ||||
-rw-r--r-- | chart2/source/controller/main/DrawCommandDispatch.hxx | 3 |
3 files changed, 5 insertions, 4 deletions
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index c8c46ba7541f..51ebcbf9b567 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -1985,7 +1985,7 @@ void ChartController::impl_SetMousePointer( const MouseEvent & rEvent ) ( !m_pDrawViewWrapper->IsMarkedHit( aMousePos ) || !m_aSelection.isDragableObjectSelected() ) ) { PointerStyle ePointerStyle = PointerStyle::DrawRect; - SdrObjKind eKind = static_cast< SdrObjKind >( m_pDrawViewWrapper->GetCurrentObjIdentifier() ); + SdrObjKind eKind = m_pDrawViewWrapper->GetCurrentObjIdentifier(); switch ( eKind ) { case OBJ_LINE: diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx b/chart2/source/controller/main/DrawCommandDispatch.cxx index 00f5b2c51f73..5f2e1a73923d 100644 --- a/chart2/source/controller/main/DrawCommandDispatch.cxx +++ b/chart2/source/controller/main/DrawCommandDispatch.cxx @@ -347,7 +347,7 @@ void DrawCommandDispatch::execute( const OUString& rCommand, const Sequence< bea SolarMutexGuard aGuard; m_pChartController->setDrawMode( eDrawMode ); - setInsertObj( sal::static_int_cast< sal_uInt16 >( eKind ) ); + setInsertObj(eKind); if ( bCreate ) { pDrawViewWrapper->SetCreateMode(); @@ -397,7 +397,7 @@ void DrawCommandDispatch::describeSupportedFeatures() implDescribeSupportedFeature( ".uno:StarShapes", COMMAND_ID_DRAWTBX_CS_STAR, CommandGroup::INSERT ); } -void DrawCommandDispatch::setInsertObj( sal_uInt16 eObj ) +void DrawCommandDispatch::setInsertObj(SdrObjKind eObj) { DrawViewWrapper* pDrawViewWrapper = ( m_pChartController ? m_pChartController->GetDrawViewWrapper() : nullptr ); if ( pDrawViewWrapper ) diff --git a/chart2/source/controller/main/DrawCommandDispatch.hxx b/chart2/source/controller/main/DrawCommandDispatch.hxx index 121808d231b6..febfa8338d40 100644 --- a/chart2/source/controller/main/DrawCommandDispatch.hxx +++ b/chart2/source/controller/main/DrawCommandDispatch.hxx @@ -18,6 +18,7 @@ */ #pragma once +#include <svx/svdobjkind.hxx> #include "FeatureCommandDispatchBase.hxx" class SfxItemSet; @@ -58,7 +59,7 @@ protected: virtual void describeSupportedFeatures() override; private: - void setInsertObj( sal_uInt16 eObj ); + void setInsertObj(SdrObjKind eObj); SdrObject* createDefaultObject( const sal_uInt16 nID ); bool parseCommandURL( const OUString& rCommandURL, sal_uInt16* pnFeatureId, OUString* pBaseCommand, OUString* pCustomShapeType ); |