Kaydet (Commit) 9288a3c6 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Miklos Vajna

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
üst e1f9b539
...@@ -447,14 +447,8 @@ public: ...@@ -447,14 +447,8 @@ public:
*/ */
void Combine(); void Combine();
#ifdef DBG_UTIL
void SttCrsrMove(); void SttCrsrMove();
void EndCrsrMove( const bool bIdleEnd = false ); 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. * When the focus is lost the selected ranges are not displayed anymore.
......
...@@ -314,22 +314,27 @@ void SwCrsrShell::EndAction( const bool bIdleEnd, const bool DoSetPosX ) ...@@ -314,22 +314,27 @@ void SwCrsrShell::EndAction( const bool bIdleEnd, const bool DoSetPosX )
} }
} }
#ifdef DBG_UTIL
void SwCrsrShell::SttCrsrMove() void SwCrsrShell::SttCrsrMove()
{ {
#ifdef DBG_UTIL
OSL_ENSURE( m_nCrsrMove < USHRT_MAX, "To many nested CrsrMoves." ); OSL_ENSURE( m_nCrsrMove < USHRT_MAX, "To many nested CrsrMoves." );
#endif
++m_nCrsrMove; ++m_nCrsrMove;
StartAction(); StartAction();
} }
void SwCrsrShell::EndCrsrMove( const bool bIdleEnd ) void SwCrsrShell::EndCrsrMove( const bool bIdleEnd )
{ {
#ifdef DBG_UTIL
OSL_ENSURE( m_nCrsrMove, "EndCrsrMove() without SttCrsrMove()." ); OSL_ENSURE( m_nCrsrMove, "EndCrsrMove() without SttCrsrMove()." );
#endif
EndAction( bIdleEnd, true ); EndAction( bIdleEnd, true );
if( !--m_nCrsrMove ) --m_nCrsrMove;
#ifdef DBG_UTIL
if( !m_nCrsrMove )
m_bInCMvVisportChgd = false; m_bInCMvVisportChgd = false;
}
#endif #endif
}
bool SwCrsrShell::LeftRight( bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode, bool SwCrsrShell::LeftRight( bool bLeft, sal_uInt16 nCnt, sal_uInt16 nMode,
bool bVisualAllowed ) bool bVisualAllowed )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment