39 #include <drawview.hxx>
44 #include <charthelper.hxx>
50 #define SC_MAXDRAGMOVE 3
52 #define SC_MINDRAGMOVE 2
58 :
FuDraw(rViewSh, pWin, pViewP, pDoc, rReq)
70 const bool bSelectionOnly = rMEvt.
IsRight();
105 if(pHdl && (pHdl->
GetKind() != SdrHdlKind::Poly && pHdl->
GetKind() != SdrHdlKind::Circle))
128 bool bAlt = rMEvt.
IsMod2();
137 OUString sURL, sTarget;
159 if ( !pTmpInfo || pTmpInfo->
GetMacro().isEmpty() )
173 else if ( !pInfo->
GetMacro().isEmpty() )
178 uno::Reference< beans::XPropertySet > xProps( pObj->
getUnoShape(), uno::UNO_QUERY );
184 aCaller = xProps->getPropertyValue(
"Name");
186 catch( uno::Exception& ) {}
189 uno::Sequence< sal_Int16 > aOutArgsIndex;
190 uno::Sequence< uno::Any > aOutArgs;
191 uno::Sequence< uno::Any > aInArgs;
193 aInArgs, aRet, aOutArgsIndex, aOutArgs,
true, &aCaller );
204 pView->
PickAnything( rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt ) != SdrHitKind::NONE &&
205 aVEvt.
pObj != nullptr )
211 if ( pIMapObj && !pIMapObj->
GetURL().isEmpty() )
213 sURL = pIMapObj->
GetURL();
246 if( bCaptionClicked )
261 if ( !bWasOleActive )
306 if ( std::abs( aOldPixel.X() - aNewPixel.X() ) >
SC_MAXDRAGMOVE ||
349 ::std::vector< OUString > aExcludedChartNames;
367 for (
size_t i = 0;
i < nMarkCount; ++
i )
381 std::abs(aPnt.X() -
aMDPos.X()) < nDrgLog &&
382 std::abs(aPnt.Y() -
aMDPos.Y()) < nDrgLog)
416 for(
size_t nIdx = 0; !bFound && (nIdx < nCount); ++nIdx )
458 if (eHit != SdrHitKind::NONE && aVEvt.
pObj == pObj)
468 if (static_cast<SdrOle2Obj*>(pObj)->GetObjRef().is())
479 else if ( dynamic_cast<const SdrTextObj*>( pObj) !=
nullptr && dynamic_cast<const SdrUnoObj*>( pObj) ==
nullptr && dynamic_cast<const SdrMediaObj*>( pObj) ==
nullptr )
482 bool bVertical = ( pOPO && pOPO->
IsVertical() );
483 sal_uInt16 nTextSlotId = bVertical ? SID_DRAW_TEXT_VERTICAL : SID_DRAW_TEXT;
486 Execute(nTextSlotId, SfxCallMode::SYNCHRON | SfxCallMode::RECORD);
490 if ( pPoor && pPoor->
GetSlotID() == nTextSlotId )
512 if ( !bReturn && rMEvt.
IsLeft() )
515 Execute(SID_OBJECT_SELECT, SfxCallMode::SLOT | SfxCallMode::RECORD);
517 if ( bCopy && pPage )
520 ScModelObj* pModelObj = ( pDocShell ? comphelper::getUnoTunnelImplementation<ScModelObj>( pDocShell->
GetModel() ) :
nullptr );
525 aProtectedChartRangesVector, aExcludedChartNames );
SfxViewFrame * GetViewFrame() const
void UnmarkAllObj(SdrPageView const *pPV=nullptr)
const OUString & GetTarget() const
static bool IsXScriptURL(const OUString &rScriptURL)
bool IsDrawSelMode() const
ScDocShell * GetDocShell() const
size_t GetMarkCount() const
void ActivateObject(SdrOle2Obj *pObj, tools::Long nVerb)
void SetShiftPressed(bool bShiftPressed)
const OUString & GetMacro() const
bool IsObjectInPlaceActive() const
virtual bool MouseMove(const MouseEvent &rMEvt) override
virtual ~FuSelection() override
bool IsNoteCaptionClicked(const Point &rPos) const
bool AreObjectsMarked() const
static ScMacroInfo * GetMacroInfo(SdrObject *pObj, bool bCreate=false)
bool EndDragObj(bool bCopy=false)
static void OpenURL(const OUString &rURL, const OUString &rTarget, bool bIgnoreSettings=false)
Open the specified URL.
ScSplitPos GetActivePart() const
SdrMark * GetMark(size_t nNum) const
ScDocument & GetDocument() const
static bool ShouldOpenURL()
Whether the URL can be opened according to current security options (Click/Ctrl-Click) ...
static SfxObjectShell * Current()
Base class for all Drawmodule specific functions.
css::uno::Reference< css::frame::XModel > GetModel() const
SdrHitKind PickAnything(const MouseEvent &rMEvt, SdrMouseEventKind nMouseDownOrMoveOrUp, SdrViewEvent &rVEvt) const
virtual SdrObjKind GetObjIdentifier() const
const OUString & GetTargetFrame() const
static void CreateProtectedChartListenersAndNotify(ScDocument &rDoc, const SdrPage *pPage, ScModelObj *pModelObj, SCTAB nTab, const ScRangeListVector &rRangesVector, const ::std::vector< OUString > &rExcludedChartNames, bool bSameDoc=true)
#define SC_MAXDRAGMOVE
fusel,fuconstr,futext - combine them!
sal_uInt16 GetClicks() const
virtual void MovAction(const Point &rPnt) override
FuSelection(ScTabViewShell &rViewSh, vcl::Window *pWin, ScDrawView *pView, SdrModel *pDoc, const SfxRequest &rReq)
virtual css::uno::Reference< css::uno::XInterface > getUnoShape()
sal_uInt16 GetButtons() const
void SetMouseButtonCode(sal_uInt16 nNew)
SfxFrame & GetFrame() const
virtual bool MouseMove(const MouseEvent &rMEvt) override
const SvxURLField * pURLField
ScTabViewShell & rViewShell
bool IsMarkedHit(const Point &rPnt, short nTol=-2) const
void ForceScroll(const Point &aPixPos)
void BegMacroObj(const Point &rPnt, short nTol, SdrObject *pObj, SdrPageView *pPV, vcl::Window *pWin)
static void AddRangesIfProtectedChart(ScRangeListVector &rRangesVector, const ScDocument &rDocument, SdrObject *pObject)
ScViewData & GetViewData()
sal_uInt16 GetSlotID() const
Base class for Text functions.
SdrObject * GetMarkedSdrObj() const
SdrObject * PickObj(const Point &rPnt, short nTol, SdrPageView *&rpPV, SdrSearchOptions nOptions, SdrObject **ppRootObj, bool *pbHitPassDirect=nullptr) const
static void GetChartNames(::std::vector< OUString > &rChartNames, const SdrPage *pPage)
std::optional< Point > getLogicPosition() const
SdrDragMethod * GetDragMethod() const
sal_uInt16 GetCurRefDlgId() const
void FakeButtonUp(ScSplitPos eWhich)
const SdrMarkList & GetMarkedObjectList() const
bool TestDetective(const SdrPageView *pPV, const Point &rPos)
SdrHdl * PickHandle(const Point &rPnt) const
ErrCode CallXScript(const OUString &rScriptURL, const css::uno::Sequence< css::uno::Any > &aParams, css::uno::Any &aRet, css::uno::Sequence< sal_Int16 > &aOutParamIndex, css::uno::Sequence< css::uno::Any > &aOutParam, bool bRaiseError=true, const css::uno::Any *aCaller=nullptr)
virtual void Start() override
bool IsGroupObject() const
void BegMarkObj(const Point &rPnt, bool bUnmark=false)
bool IsNoteCaptionMarked() const
bool IsMouseCaptured() const
Base class for all functions.
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
ScDBFunc * GetView() const
const OUString & GetURL() const
Point PixelToLogic(const Point &rDevicePt) const
Point LogicToPixel(const Point &rLogicPt) const
::std::vector< ScRangeList > ScRangeListVector
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
virtual bool IsAction() const override
void UnlockInternalLayer()
Unlocks the internal layer that contains caption objects of cell notes.
SfxInPlaceClient * GetIPClient() const
static IMapObject * GetHitIMapObject(const SdrObject *pObj, const Point &rWinPoint, const vcl::Window *rCmpWnd=nullptr)
SdrPage * GetPage() const
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
SfxDispatcher & GetDispatcher()
FuPoor * GetDrawFuncPtr()
const Point & GetPosPixel() const
SdrPageView * GetSdrPageView() const
static bool IsNoteCaption(SdrObject *pObj)
Returns true, if the passed object is the caption of a cell note.
void SetInEditMode(SdrObject *pObj=nullptr, const Point *pMousePixel=nullptr, bool bCursorToEnd=false, const KeyEvent *pInitialKey=nullptr)
const OUString & GetHlink() const
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
virtual bool BegDragObj(const Point &rPnt, OutputDevice *pOut, SdrHdl *pHdl, short nMinMov=-3, SdrDragMethod *pForcedMeth=nullptr) override
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
sal_uInt16 getHitTolLog() const
virtual void BckAction() override
virtual OutlinerParaObject * GetOutlinerParaObject() const
const OUString & GetURL() const
void UnMarkAll(SdrPageView const *pPV=nullptr)
VclPtr< vcl::Window > pWindow
SdrHdlKind GetKind() const
virtual void ForcePointer(const MouseEvent *pMEvt)
void ForceMarkedToAnotherPage()
virtual void EndAction() override
static SvxIMapInfo * GetIMapInfo(const SdrObject *pObject)