diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-01-29 17:46:23 +0900 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-02-09 08:09:29 +0100 |
commit | 9288a3c6b0d07a763a227e8fd97d0ece0eee96b9 (patch) | |
tree | 4cd6c17f6814d983f81891fbf883a300a4946c45 /sw | |
parent | e1f9b5394b7cf512a0bcbbb4f1ae2a96e9b8b248 (diff) |
Combine DBG_UTIL and header version of Stt{End}CrsrMove
Having 2 versions (debug and release) of one method (on top of
that in different places - one implemented in header) which are
mostly the same is a recipe for disaster.
Change-Id: Ia38f900ac076d1c1765fea2c7326147b115e343d
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/crsrsh.hxx | 6 | ||||
-rw-r--r-- | sw/source/core/crsr/crsrsh.cxx | 11 |
2 files changed, 8 insertions, 9 deletions
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx index d57520caf610..13489ce684b4 100644 --- a/sw/inc/crsrsh.hxx +++ b/sw/inc/crsrsh.hxx @@ -447,14 +447,8 @@ public: */ void Combine(); -#ifdef DBG_UTIL void SttCrsrMove(); void EndCrsrMove( const bool bIdleEnd = false ); -#else - void SttCrsrMove() { ++m_nCrsrMove; StartAction(); } - void EndCrsrMove( const bool bIdleEnd = false ) - { EndAction( bIdleEnd, true ); --m_nCrsrMove; } -#endif /* * When the focus is lost the selected ranges are not displayed anymore. diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 2e63da77e63b..a8cd152dcfb0 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -314,22 +314,27 @@ void SwCrsrShell::EndAction( const bool bIdleEnd, const bool DoSetPosX ) } } -#ifdef DBG_UTIL void SwCrsrShell::SttCrsrMove() { +#ifdef DBG_UTIL OSL_ENSURE( m_nCrsrMove < USHRT_MAX, "To many nested CrsrMoves." ); +#endif ++m_nCrsrMove; StartAction(); } void SwCrsrShell::EndCrsrMove( const bool bIdleEnd ) { +#ifdef DBG_UTIL OSL_ENSURE( m_nCrsrMove, "EndCrsrMove() without SttCrsrMove()." ); +#endif EndAction( bIdleEnd, true ); - if( !--m_nCrsrMove ) + --m_nCrsrMove; +#ifdef DBG_UTIL + if( !m_nCrsrMove ) m_bInCMvVisportChgd = false; -} #endif +} bool SwCrsrShell::LeftRight( bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode, bool bVisualAllowed ) |