diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2014-12-03 16:19:16 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2014-12-04 01:09:33 +0100 |
commit | 0ba70442f1eb56e0efed0958bab34e68559a95f9 (patch) | |
tree | d5bf7188c9d1135a21c49ed9f58d1d173f28c042 | |
parent | ac5d8e3a3571d41c62ab7b6b80b1c7c11a869947 (diff) |
use C++11 iteration
Change-Id: I1c0787d2edece9c96e1b74d849d226166b7af4c0
-rw-r--r-- | sw/source/core/crsr/crstrvl.cxx | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index cfc67b2d371b..e196978997c6 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -860,19 +860,12 @@ SwField* SwCrsrShell::GetCurFld( const bool bIncludeInputFldAtStart ) const bool SwCrsrShell::CrsrInsideInputFld() const { - bool bCrsrInsideInputFld = false; - - const SwPaM* pCrsr = GetCrsr(); - const SwPaM* pFirst = pCrsr; - do + for(SwPaM& rCrsr : GetCrsr()->GetRingContainer()) { - bCrsrInsideInputFld = dynamic_cast<const SwInputField*>(GetFieldAtCrsr( pCrsr, false )) != NULL; - - pCrsr = static_cast<SwPaM*>(pCrsr->GetNext()); - } while ( !bCrsrInsideInputFld - && pCrsr != pFirst ); - - return bCrsrInsideInputFld; + if(dynamic_cast<const SwInputField*>(GetFieldAtCrsr( &rCrsr, false ))) + return true; + } + return false; } bool SwCrsrShell::PosInsideInputFld( const SwPosition& rPos ) const |