diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-07-17 15:21:43 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-07-17 15:40:44 -0400 |
commit | efd6fc5e99d89509129469843bbdf3e8f94b58a4 (patch) | |
tree | 0802557fcf958c4dffc22e6dcc3fb3460aff6003 /sc | |
parent | 8ab7cbe751a1b643a2a72f06da2c8d7b9a3a3b31 (diff) |
Unwind this logic and make it easier to read.
Change-Id: Iaf4ccc8949fb823a7bd3329c0164443220573b03
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/chgtrack.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/chgtrack.cxx | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/sc/inc/chgtrack.hxx b/sc/inc/chgtrack.hxx index 59b405809ec4..f036f7954806 100644 --- a/sc/inc/chgtrack.hxx +++ b/sc/inc/chgtrack.hxx @@ -1013,6 +1013,8 @@ class ScChangeTrack : public utl::ConfigurationListener // bRecursion == called from reject with table bool Reject( ScChangeAction*, ScChangeActionMap*, bool bRecursion ); + bool IsLastAction( sal_uLong nNum ) const; + void ClearMsgQueue(); virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 ) SAL_OVERRIDE; diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index 80a66cd49233..8373605e1ab3 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -3161,8 +3161,8 @@ void ScChangeTrack::Undo( sal_uLong nStartAction, sal_uLong nEndAction, bool bMe for ( sal_uLong j = nEndAction; j >= nStartAction; --j ) { // Traverse backwards to recycle nActionMax and for faster access via pLast // Deletes are in right order - ScChangeAction* pAct = ( (j == nActionMax && pLast && - pLast->GetActionNumber() == j) ? pLast : GetAction( j ) ); + ScChangeAction* pAct = IsLastAction(j) ? pLast : GetAction(j); + if ( pAct ) { if ( pAct->IsDeleteType() ) @@ -4409,6 +4409,11 @@ bool ScChangeTrack::Reject( return bRejected; } +bool ScChangeTrack::IsLastAction( sal_uLong nNum ) const +{ + return nNum == nActionMax && pLast && pLast->GetActionNumber() == nNum; +} + sal_uLong ScChangeTrack::AddLoadedGenerated( const ScCellValue& rNewCell, const ScBigRange& aBigRange, const OUString& sNewValue ) { |