diff options
Diffstat (limited to 'chart2/source/controller/main/SelectionHelper.cxx')
-rw-r--r-- | chart2/source/controller/main/SelectionHelper.cxx | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/chart2/source/controller/main/SelectionHelper.cxx b/chart2/source/controller/main/SelectionHelper.cxx index 433a157ba828..de2ad664abe5 100644 --- a/chart2/source/controller/main/SelectionHelper.cxx +++ b/chart2/source/controller/main/SelectionHelper.cxx @@ -19,12 +19,9 @@ #include <SelectionHelper.hxx> #include <ObjectIdentifier.hxx> -#include <DiagramHelper.hxx> #include <Diagram.hxx> -#include <ChartModelHelper.hxx> #include <ChartModel.hxx> -#include <com/sun/star/frame/XModel.hpp> #include <svx/svdpage.hxx> #include <svx/svditer.hxx> #include <svx/obj3d.hxx> @@ -315,6 +312,11 @@ bool Selection::isDragableObjectSelected() const return m_aSelectedOID.isDragableObject(); } +bool Selection::isTitleObjectSelected() const +{ + return m_aSelectedOID.getObjectType() == OBJECTTYPE_TITLE; +} + bool Selection::isAdditionalShapeSelected() const { return m_aSelectedOID.isAdditionalShape(); @@ -433,8 +435,7 @@ OUString SelectionHelper::getHitObjectCID( if( aRet == aWallCID ) { - OUString aDiagramCID = ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM, OUString::number( 0 ) ); - aRet = aDiagramCID; + aRet = ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_DIAGRAM, OUString::number( 0 ) ); } } } @@ -443,13 +444,13 @@ OUString SelectionHelper::getHitObjectCID( // \\- solar mutex } -bool SelectionHelper::isRotateableObject( const OUString& rCID +bool SelectionHelper::isRotateableObject( std::u16string_view rCID , const rtl::Reference<::chart::ChartModel>& xChartModel ) { if( !ObjectIdentifier::isRotateableObject( rCID ) ) return false; - sal_Int32 nDimensionCount = DiagramHelper::getDimension( ChartModelHelper::findDiagram( xChartModel ) ); + sal_Int32 nDimensionCount = xChartModel->getFirstChartDiagram()->getDimension(); return nDimensionCount == 3; } @@ -466,7 +467,7 @@ SelectionHelper::~SelectionHelper() bool SelectionHelper::getFrameDragSingles() { //true == green == surrounding handles - return dynamic_cast<const E3dObject*>( m_pSelectedObj) == nullptr; + return DynCastE3dObject( m_pSelectedObj) == nullptr; } SdrObject* SelectionHelper::getMarkHandlesObject( SdrObject* pObj ) @@ -533,7 +534,7 @@ E3dScene* SelectionHelper::getSceneToRotate( SdrObject* pObj ) if(pObj) { - pRotateable = dynamic_cast<E3dObject*>(pObj); + pRotateable = DynCastE3dObject(pObj); if( !pRotateable ) { SolarMutexGuard aSolarGuard; @@ -543,8 +544,7 @@ E3dScene* SelectionHelper::getSceneToRotate( SdrObject* pObj ) SdrObjListIter aIterator(pSubList, SdrIterMode::DeepWithGroups); while( aIterator.IsMore() && !pRotateable ) { - SdrObject* pSubObj = aIterator.Next(); - pRotateable = dynamic_cast<E3dObject*>(pSubObj); + pRotateable = DynCastE3dObject(aIterator.Next()); } } } @@ -598,7 +598,7 @@ bool SelectionHelper::getMarkHandles( SdrHdlList& rHdlList ) for( sal_uInt32 nM = 0; nM < aPolygon.count(); nM++) { const ::basegfx::B2DPoint aPoint(aPolygon.getB2DPoint(nM)); - rHdlList.AddHdl(std::make_unique<SdrHdl>(Point(basegfx::fround(aPoint.getX()), basegfx::fround(aPoint.getY())), SdrHdlKind::Poly)); + rHdlList.AddHdl(std::make_unique<SdrHdl>(Point(basegfx::fround<tools::Long>(aPoint.getX()), basegfx::fround<tools::Long>(aPoint.getY())), SdrHdlKind::Poly)); } } return true; |