diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-14 15:17:23 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-19 10:46:02 +0200 |
commit | 5e319087ac0ab7533e4ae1554d9a38ef08fac5d5 (patch) | |
tree | 8cfca0c00aeb0045dbe792d71807a91bbb038a58 /sw/source/uibase | |
parent | c0ee80f9787bc5e86fb7a342b567c0649253e1e3 (diff) |
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>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/inc/wrtsh.hxx | 25 | ||||
-rw-r--r-- | sw/source/uibase/wrtsh/select.cxx | 36 |
2 files changed, 27 insertions, 34 deletions
diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx index 13825221942a..f87d113b80ab 100644 --- a/sw/source/uibase/inc/wrtsh.hxx +++ b/sw/source/uibase/inc/wrtsh.hxx @@ -99,11 +99,12 @@ private: using SwCursorShell::GotoMark; typedef long (SwWrtShell::*SELECTFUNC)(const Point *, bool bProp ); + typedef void (SwWrtShell::*SELECTFUNC2)(const Point *, bool bProp ); - SELECTFUNC m_fnDrag; - SELECTFUNC m_fnSetCursor; - SELECTFUNC m_fnEndDrag; - SELECTFUNC m_fnKillSel; + SELECTFUNC2 m_fnDrag; + SELECTFUNC m_fnSetCursor; + SELECTFUNC2 m_fnEndDrag; + SELECTFUNC m_fnKillSel; public: @@ -574,17 +575,17 @@ private: SAL_DLLPRIVATE long SetCursorKillSel(const Point *, bool bProp ); - SAL_DLLPRIVATE long BeginDrag(const Point *, bool bProp ); - SAL_DLLPRIVATE long DefaultDrag(const Point *, bool bProp ); - SAL_DLLPRIVATE long DefaultEndDrag(const Point *, bool bProp ); + SAL_DLLPRIVATE void BeginDrag(const Point *, bool bProp ); + SAL_DLLPRIVATE void DefaultDrag(const Point *, bool bProp ); + SAL_DLLPRIVATE void DefaultEndDrag(const Point *, bool bProp ); - SAL_DLLPRIVATE long ExtSelWrd(const Point *, bool bProp ); - SAL_DLLPRIVATE long ExtSelLn(const Point *, bool bProp ); + SAL_DLLPRIVATE void ExtSelWrd(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. - SAL_DLLPRIVATE long UpdateLayoutFrame(const Point *, bool bProp ); + SAL_DLLPRIVATE void UpdateLayoutFrame(const Point *, bool bProp ); SAL_DLLPRIVATE void SttLeaveSelect(); SAL_DLLPRIVATE void AddLeaveSelect(); @@ -629,7 +630,7 @@ inline bool SwWrtShell::IsInClickToEdit() const { return m_bIsInClickToEdit; } inline bool SwWrtShell::Is_FnDragEQBeginDrag() const { #ifdef __GNUC__ - SELECTFUNC fnTmp = &SwWrtShell::BeginDrag; + SELECTFUNC2 fnTmp = &SwWrtShell::BeginDrag; return m_fnDrag == fnTmp; #else return m_fnDrag == &SwWrtShell::BeginDrag; diff --git a/sw/source/uibase/wrtsh/select.cxx b/sw/source/uibase/wrtsh/select.cxx index bad0b82dfefb..105e1caf7d67 100644 --- a/sw/source/uibase/wrtsh/select.cxx +++ b/sw/source/uibase/wrtsh/select.cxx @@ -414,11 +414,11 @@ void SwWrtShell::EndSelect() pWrdCnt->UpdateCounts(); } -long SwWrtShell::ExtSelWrd(const Point *pPt, bool ) +void SwWrtShell::ExtSelWrd(const Point *pPt, bool ) { SwMvContext aMvContext(this); if( IsTableMode() ) - return 1; + return; // Bug 66823: actual crsr has in additional mode no selection? // 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 - bool bRet = false, bMoveCursor = true, bToTop = false; + bool bMoveCursor = true, bToTop = false; SwCursorShell::SelectWord( &m_aStart ); // select the startword SwCursorShell::Push(); // save the cursor SwCursorShell::SetCursor( *pPt ); // and check the direction @@ -461,7 +461,6 @@ long SwWrtShell::ExtSelWrd(const Point *pPt, bool ) if( bToTop ) SwapPam(); Combine(); - bRet = true; } else { @@ -470,17 +469,14 @@ long SwWrtShell::ExtSelWrd(const Point *pPt, bool ) 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); SwCursorShell::SetCursor(*pPt); if( IsTableMode() ) - return 1; + return; // Bug 66823: actual crsr has in additional mode no selection? // Then destroy the actual an go to prev, this will be expand @@ -513,7 +509,10 @@ long SwWrtShell::ExtSelLn(const Point *pPt, bool ) } 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. @@ -657,7 +656,7 @@ void SwWrtShell::SetRedlineFlagsAndCheckInsMode( RedlineFlags eMode ) // Edit frame -long SwWrtShell::BeginFrameDrag(const Point *pPt, bool bIsShift) +void SwWrtShell::BeginFrameDrag(const Point *pPt, bool bIsShift) { m_fnDrag = &SwFEShell::Drag; if(bStartDrag) @@ -667,7 +666,6 @@ long SwWrtShell::BeginFrameDrag(const Point *pPt, bool bIsShift) } else SwFEShell::BeginDrag( pPt, bIsShift ); - return 1; } 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 SwFEShell::EndDrag(); m_fnDrag = &SwWrtShell::BeginFrameDrag; - return 1; } // Handler for toggling the modes. Returns back the old mode. @@ -749,7 +746,7 @@ bool SwWrtShell::ToggleExtMode() // Dragging in standard mode (Selecting of content) -long SwWrtShell::BeginDrag(const Point * /*pPt*/, bool ) +void SwWrtShell::BeginDrag(const Point * /*pPt*/, bool ) { if(m_bSelWrd) { @@ -771,19 +768,15 @@ long SwWrtShell::BeginDrag(const Point * /*pPt*/, bool ) m_fnDrag = &SwWrtShell::DefaultDrag; SttSelect(); } - - return 1; } -long SwWrtShell::DefaultDrag(const Point *, bool ) +void SwWrtShell::DefaultDrag(const Point *, bool ) { if( IsSelTableCells() ) m_aSelTableLink.Call(*this); - - return 1; } -long SwWrtShell::DefaultEndDrag(const Point * /*pPt*/, bool ) +void SwWrtShell::DefaultEndDrag(const Point * /*pPt*/, bool ) { m_fnDrag = &SwWrtShell::BeginDrag; if( IsExtSel() ) @@ -792,7 +785,6 @@ long SwWrtShell::DefaultEndDrag(const Point * /*pPt*/, bool ) if( IsSelTableCells() ) m_aSelTableLink.Call(*this); EndSelect(); - return 1; } // #i32329# Enhanced table selection |