33#include <osl/diagnose.h>
42OUString lcl_getObjectName(
SdrObject const * pObj )
49void impl_selectObject(
SdrObject* pObjectToSelect, DrawViewWrapper& rDrawViewWrapper )
55 SelectionHelper aSelectionHelper( pObjectToSelect );
56 SdrObject* pMarkObj = aSelectionHelper.getObjectToMark();
57 rDrawViewWrapper.setMarkHandleProvider(&aSelectionHelper);
58 rDrawViewWrapper.MarkObject(pMarkObj);
59 rDrawViewWrapper.setMarkHandleProvider(
nullptr);
140 if( !pDrawViewWrapper )
157 impl_selectObject( pObjectToSelect, *pDrawViewWrapper );
161 ,
bool bIsRightMouse,
bool bWaitingForDoubleClick )
163 if( !pDrawViewWrapper )
167 bool bAllowMultiClickSelectionChange = !bIsRightMouse && !bWaitingForDoubleClick;
199 bool bSameObjectAsLastSelected = ( aLastSelectedObject ==
m_aSelectedOID );
200 if( bSameObjectAsLastSelected )
220 if( bAllowMultiClickSelectionChange )
295 switch( eObjectType )
324 ,
bool bGivenObjectMayBeResult )
330 if( bGivenObjectMayBeResult )
331 aName = lcl_getObjectName( pObj );
342 aName = lcl_getObjectName( pObj );
357 ,
bool bGivenObjectMayBeResult )
369 ,
const OUString& rNameOfSelectedObject
372 if(rNameOfSelectedObject.isEmpty())
384 bool bGetDiagramInsteadOf_Wall )
390 aRet = lcl_getObjectName( pNewObj );
393 while( pNewObj && aRet.match(
"HandlesOnly") )
397 aRet = lcl_getObjectName( pNewObj );
408 if( aRet.isEmpty() && !pNewObj )
414 if( !aRet.isEmpty() )
416 if( aRet == aPageCID )
429 else if( bGetDiagramInsteadOf_Wall )
433 if( aRet == aWallCID )
451 sal_Int32 nDimensionCount = xChartModel->getFirstChartDiagram()->getDimension();
453 return nDimensionCount == 3;
457 : m_pSelectedObj( pSelectedObj ), m_pMarkObj(nullptr)
475 OUString
aName( lcl_getObjectName( pObj ) );
476 if(
aName.match(
"MarkHandles") ||
aName.match(
"HandlesOnly") )
478 if( !
aName.isEmpty() )
487 while (aIterator.
IsMore())
512 while (aIterator.
IsMore())
543 while( aIterator.
IsMore() && !pRotateable )
592 const ::basegfx::B2DPolyPolygon& rPolyPolygon = pPathObj->GetPathPoly();
593 for( sal_uInt32 nN = 0; nN < rPolyPolygon.count(); nN++)
595 const ::basegfx::B2DPolygon& aPolygon(rPolyPolygon.getB2DPolygon(nN));
596 for( sal_uInt32 nM = 0; nM < aPolygon.count(); nM++)
598 const ::basegfx::B2DPoint aPoint(aPolygon.getB2DPoint(nM));
620 OUString
aName( lcl_getObjectName( pObj ) );
632 while (aIterator.
IsMore())
637 OUString aSubName( lcl_getObjectName( pSubObj ) );
644 rHdlList.
AddHdl(std::make_unique<SdrHdl>(aPos,SdrHdlKind::Poly));
virtual E3dScene * getRootE3dSceneFromE3dObject() const
void AddHdl(std::unique_ptr< SdrHdl > pHdl)
virtual SdrObject * getSdrObjectFromSdrObjList() const
void SetMarkProtect(bool bProt)
virtual css::uno::Reference< css::drawing::XShape > getUnoShape()
virtual SdrObjList * GetSubList() const
virtual const tools::Rectangle & GetCurrentBoundRect() const
SdrObjList * getParentSdrObjListFromSdrObject() const
virtual const OUString & GetName() const
SdrObject * getHitObject(const Point &rPnt) const
static SdrObject * getSdrObject(const css::uno::Reference< css::drawing::XShape > &xShape)
SdrObject * getNamedSdrObject(const OUString &rName) const
static bool IsObjectHit(SdrObject const *pObj, const Point &rPnt)
bool isAutoGeneratedObject() const
static OUString createClassifiedIdentifierForParticle(std::u16string_view rParticle)
static bool areSiblings(std::u16string_view rCID1, std::u16string_view rCID2)
static bool isDragableObject(std::u16string_view rClassifiedIdentifier)
static OUString createParticleForLegend(const rtl::Reference<::chart::ChartModel > &xChartModel)
static bool isCID(std::u16string_view rName)
bool isDragableObject() const
static bool isMultiClickObject(std::u16string_view rClassifiedIdentifier)
const OUString & getObjectCID() const
static bool isRotateableObject(std::u16string_view rClassifiedIdentifier)
static ObjectType getObjectType(std::u16string_view rCID)
static OUString createClassifiedIdentifier(enum ObjectType eObjectType, std::u16string_view rParticleID)
bool isAdditionalShape() const
const css::uno::Reference< css::drawing::XShape > & getAdditionalShape() const
ObjectType getObjectType() const
static OUString getHitObjectCID(const Point &rMPos, DrawViewWrapper const &rDrawViewWrapper, bool bGetDiagramInsteadOf_Wall=false)
static SdrObject * getMarkHandlesObject(SdrObject *pObj)
SdrObject * m_pSelectedObj
static bool findNamedParent(SdrObject *&pInOutObject, OUString &rOutName, bool bGivenObjectMayBeResult)
static bool isRotateableObject(std::u16string_view rCID, const rtl::Reference<::chart::ChartModel > &xChartModel)
virtual ~SelectionHelper()
SelectionHelper(SdrObject *pSelectedObj)
virtual bool getMarkHandles(SdrHdlList &rHdlList) override
static E3dScene * getSceneToRotate(SdrObject *pObj)
SdrObject * getObjectToMark()
static bool isDragableObjectHitTwice(const Point &rMPos, const OUString &rNameOfSelectedObject, const DrawViewWrapper &rDrawViewWrapper)
virtual bool getFrameDragSingles() override
void remindSelectionBeforeMouseDown()
void resetPossibleSelectionAfterSingleClickWasEnsured()
bool isDragableObjectSelected() const
bool hasSelection() const
bool isRotateableObjectSelected(const rtl::Reference<::chart::ChartModel > &xChartModel) const
ObjectIdentifier m_aSelectedOID_selectOnlyIfNoDoubleClickIsFollowing
bool isAdditionalShapeSelected() const
ObjectIdentifier m_aSelectedOID
OUString const & getSelectedCID() const
bool maybeSwitchSelectionAfterSingleClickWasEnsured()
ObjectIdentifier m_aSelectedOID_beforeMouseDown
void adaptSelectionToNewPos(const Point &rMousePos, DrawViewWrapper const *pDrawViewWrapper, bool bIsRightMouse, bool bWaitingForDoubleClick)
bool isSelectionDifferentFromBeforeMouseDown() const
bool isResizeableObjectSelected() const
void applySelection(DrawViewWrapper *pDrawViewWrapper)
bool setSelection(const OUString &rCID)
css::uno::Reference< css::drawing::XShape > const & getSelectedAdditionalShape() const
B2IRange fround(const B2DRange &rRange)
@ OBJECTTYPE_LEGEND_ENTRY
@ OBJECTTYPE_AXIS_UNITLABEL
@ OBJECTTYPE_DIAGRAM_WALL
SVXCORE_DLLPUBLIC E3dObject * DynCastE3dObject(SdrObject *)