the drag functions return values are ignored

Change-Id: Ife694a0d04d80808f227bd8ea7d8545d732d77c2
Reviewed-on: https://gerrit.libreoffice.org/54323
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2018-05-14 15:17:23 +02:00
parent c0ee80f978
commit 5e319087ac
4 changed files with 29 additions and 38 deletions

View File

@@ -338,7 +338,7 @@ public:
void SetObjRect( const SwRect& rRect ); void SetObjRect( const SwRect& rRect );
long BeginDrag( const Point *pPt, bool bProp ); long BeginDrag( const Point *pPt, bool bProp );
long Drag ( const Point *pPt, bool bProp ); void Drag ( const Point *pPt, bool bProp );
void EndDrag (); void EndDrag ();
void BreakDrag(); void BreakDrag();

View File

@@ -717,7 +717,7 @@ long SwFEShell::BeginDrag( const Point* pPt, bool bIsShift)
return 0; return 0;
} }
long SwFEShell::Drag( const Point *pPt, bool ) void SwFEShell::Drag( const Point *pPt, bool )
{ {
OSL_ENSURE( Imp()->HasDrawView(), "Drag without DrawView?" ); OSL_ENSURE( Imp()->HasDrawView(), "Drag without DrawView?" );
if ( Imp()->GetDrawView()->IsDragObj() ) if ( Imp()->GetDrawView()->IsDragObj() )
@@ -726,9 +726,7 @@ long SwFEShell::Drag( const Point *pPt, bool )
Imp()->GetDrawView()->MovDragObj( *pPt ); Imp()->GetDrawView()->MovDragObj( *pPt );
Imp()->GetDrawView()->ShowDragAnchor(); Imp()->GetDrawView()->ShowDragAnchor();
::FrameNotify( this ); ::FrameNotify( this );
return 1;
} }
return 0;
} }
void SwFEShell::EndDrag() void SwFEShell::EndDrag()

View File

@@ -99,11 +99,12 @@ private:
using SwCursorShell::GotoMark; using SwCursorShell::GotoMark;
typedef long (SwWrtShell::*SELECTFUNC)(const Point *, bool bProp ); typedef long (SwWrtShell::*SELECTFUNC)(const Point *, bool bProp );
typedef void (SwWrtShell::*SELECTFUNC2)(const Point *, bool bProp );
SELECTFUNC m_fnDrag; SELECTFUNC2 m_fnDrag;
SELECTFUNC m_fnSetCursor; SELECTFUNC m_fnSetCursor;
SELECTFUNC m_fnEndDrag; SELECTFUNC2 m_fnEndDrag;
SELECTFUNC m_fnKillSel; SELECTFUNC m_fnKillSel;
public: public:
@@ -574,17 +575,17 @@ private:
SAL_DLLPRIVATE long SetCursorKillSel(const Point *, bool bProp ); SAL_DLLPRIVATE long SetCursorKillSel(const Point *, bool bProp );
SAL_DLLPRIVATE long BeginDrag(const Point *, bool bProp ); SAL_DLLPRIVATE void BeginDrag(const Point *, bool bProp );
SAL_DLLPRIVATE long DefaultDrag(const Point *, bool bProp ); SAL_DLLPRIVATE void DefaultDrag(const Point *, bool bProp );
SAL_DLLPRIVATE long DefaultEndDrag(const Point *, bool bProp ); SAL_DLLPRIVATE void DefaultEndDrag(const Point *, bool bProp );
SAL_DLLPRIVATE long ExtSelWrd(const Point *, bool bProp ); SAL_DLLPRIVATE void ExtSelWrd(const Point *, bool bProp );
SAL_DLLPRIVATE long ExtSelLn(const Point *, bool bProp ); SAL_DLLPRIVATE void ExtSelLn(const Point *, bool bProp );
SAL_DLLPRIVATE long BeginFrameDrag(const Point *, bool bProp ); SAL_DLLPRIVATE void BeginFrameDrag(const Point *, bool bProp );
// after SSize/Move of a frame update; Point is destination. // after SSize/Move of a frame update; Point is destination.
SAL_DLLPRIVATE long UpdateLayoutFrame(const Point *, bool bProp ); SAL_DLLPRIVATE void UpdateLayoutFrame(const Point *, bool bProp );
SAL_DLLPRIVATE void SttLeaveSelect(); SAL_DLLPRIVATE void SttLeaveSelect();
SAL_DLLPRIVATE void AddLeaveSelect(); SAL_DLLPRIVATE void AddLeaveSelect();
@@ -629,7 +630,7 @@ inline bool SwWrtShell::IsInClickToEdit() const { return m_bIsInClickToEdit; }
inline bool SwWrtShell::Is_FnDragEQBeginDrag() const inline bool SwWrtShell::Is_FnDragEQBeginDrag() const
{ {
#ifdef __GNUC__ #ifdef __GNUC__
SELECTFUNC fnTmp = &SwWrtShell::BeginDrag; SELECTFUNC2 fnTmp = &SwWrtShell::BeginDrag;
return m_fnDrag == fnTmp; return m_fnDrag == fnTmp;
#else #else
return m_fnDrag == &SwWrtShell::BeginDrag; return m_fnDrag == &SwWrtShell::BeginDrag;

View File

@@ -414,11 +414,11 @@ void SwWrtShell::EndSelect()
pWrdCnt->UpdateCounts(); pWrdCnt->UpdateCounts();
} }
long SwWrtShell::ExtSelWrd(const Point *pPt, bool ) void SwWrtShell::ExtSelWrd(const Point *pPt, bool )
{ {
SwMvContext aMvContext(this); SwMvContext aMvContext(this);
if( IsTableMode() ) if( IsTableMode() )
return 1; return;
// Bug 66823: actual crsr has in additional mode no selection? // Bug 66823: actual crsr has in additional mode no selection?
// Then destroy the actual an go to prev, this will be expand // Then destroy the actual an go to prev, this will be expand
@@ -434,7 +434,7 @@ long SwWrtShell::ExtSelWrd(const Point *pPt, bool )
} }
// check the direction of the selection with the new point // check the direction of the selection with the new point
bool bRet = false, bMoveCursor = true, bToTop = false; bool bMoveCursor = true, bToTop = false;
SwCursorShell::SelectWord( &m_aStart ); // select the startword SwCursorShell::SelectWord( &m_aStart ); // select the startword
SwCursorShell::Push(); // save the cursor SwCursorShell::Push(); // save the cursor
SwCursorShell::SetCursor( *pPt ); // and check the direction SwCursorShell::SetCursor( *pPt ); // and check the direction
@@ -461,7 +461,6 @@ long SwWrtShell::ExtSelWrd(const Point *pPt, bool )
if( bToTop ) if( bToTop )
SwapPam(); SwapPam();
Combine(); Combine();
bRet = true;
} }
else else
{ {
@@ -470,17 +469,14 @@ long SwWrtShell::ExtSelWrd(const Point *pPt, bool )
SwapPam(); SwapPam();
} }
} }
else
bRet = true;
return bRet ? 1 : 0;
} }
long SwWrtShell::ExtSelLn(const Point *pPt, bool ) void SwWrtShell::ExtSelLn(const Point *pPt, bool )
{ {
SwMvContext aMvContext(this); SwMvContext aMvContext(this);
SwCursorShell::SetCursor(*pPt); SwCursorShell::SetCursor(*pPt);
if( IsTableMode() ) if( IsTableMode() )
return 1; return;
// Bug 66823: actual crsr has in additional mode no selection? // Bug 66823: actual crsr has in additional mode no selection?
// Then destroy the actual an go to prev, this will be expand // Then destroy the actual an go to prev, this will be expand
@@ -513,7 +509,10 @@ long SwWrtShell::ExtSelLn(const Point *pPt, bool )
} }
SwapPam(); SwapPam();
return (bToTop ? SwCursorShell::GoStartSentence() : SwCursorShell::GoEndSentence()) ? 1 : 0; if (bToTop)
SwCursorShell::GoStartSentence();
else
SwCursorShell::GoEndSentence();
} }
// Back into the standard mode: no mode, no selections. // Back into the standard mode: no mode, no selections.
@@ -657,7 +656,7 @@ void SwWrtShell::SetRedlineFlagsAndCheckInsMode( RedlineFlags eMode )
// Edit frame // Edit frame
long SwWrtShell::BeginFrameDrag(const Point *pPt, bool bIsShift) void SwWrtShell::BeginFrameDrag(const Point *pPt, bool bIsShift)
{ {
m_fnDrag = &SwFEShell::Drag; m_fnDrag = &SwFEShell::Drag;
if(bStartDrag) if(bStartDrag)
@@ -667,7 +666,6 @@ long SwWrtShell::BeginFrameDrag(const Point *pPt, bool bIsShift)
} }
else else
SwFEShell::BeginDrag( pPt, bIsShift ); SwFEShell::BeginDrag( pPt, bIsShift );
return 1;
} }
void SwWrtShell::EnterSelFrameMode(const Point *pPos) void SwWrtShell::EnterSelFrameMode(const Point *pPos)
@@ -717,12 +715,11 @@ IMPL_LINK( SwWrtShell, ExecFlyMac, const SwFlyFrameFormat*, pFlyFormat, void )
} }
} }
long SwWrtShell::UpdateLayoutFrame(const Point *, bool ) void SwWrtShell::UpdateLayoutFrame(const Point *, bool )
{ {
// still a dummy // still a dummy
SwFEShell::EndDrag(); SwFEShell::EndDrag();
m_fnDrag = &SwWrtShell::BeginFrameDrag; m_fnDrag = &SwWrtShell::BeginFrameDrag;
return 1;
} }
// Handler for toggling the modes. Returns back the old mode. // Handler for toggling the modes. Returns back the old mode.
@@ -749,7 +746,7 @@ bool SwWrtShell::ToggleExtMode()
// Dragging in standard mode (Selecting of content) // Dragging in standard mode (Selecting of content)
long SwWrtShell::BeginDrag(const Point * /*pPt*/, bool ) void SwWrtShell::BeginDrag(const Point * /*pPt*/, bool )
{ {
if(m_bSelWrd) if(m_bSelWrd)
{ {
@@ -771,19 +768,15 @@ long SwWrtShell::BeginDrag(const Point * /*pPt*/, bool )
m_fnDrag = &SwWrtShell::DefaultDrag; m_fnDrag = &SwWrtShell::DefaultDrag;
SttSelect(); SttSelect();
} }
return 1;
} }
long SwWrtShell::DefaultDrag(const Point *, bool ) void SwWrtShell::DefaultDrag(const Point *, bool )
{ {
if( IsSelTableCells() ) if( IsSelTableCells() )
m_aSelTableLink.Call(*this); m_aSelTableLink.Call(*this);
return 1;
} }
long SwWrtShell::DefaultEndDrag(const Point * /*pPt*/, bool ) void SwWrtShell::DefaultEndDrag(const Point * /*pPt*/, bool )
{ {
m_fnDrag = &SwWrtShell::BeginDrag; m_fnDrag = &SwWrtShell::BeginDrag;
if( IsExtSel() ) if( IsExtSel() )
@@ -792,7 +785,6 @@ long SwWrtShell::DefaultEndDrag(const Point * /*pPt*/, bool )
if( IsSelTableCells() ) if( IsSelTableCells() )
m_aSelTableLink.Call(*this); m_aSelTableLink.Call(*this);
EndSelect(); EndSelect();
return 1;
} }
// #i32329# Enhanced table selection // #i32329# Enhanced table selection