Kaydet (Commit) efd6fc5e authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Unwind this logic and make it easier to read.

Change-Id: Iaf4ccc8949fb823a7bd3329c0164443220573b03
üst 8ab7cbe7
...@@ -1013,6 +1013,8 @@ class ScChangeTrack : public utl::ConfigurationListener ...@@ -1013,6 +1013,8 @@ class ScChangeTrack : public utl::ConfigurationListener
// bRecursion == called from reject with table // bRecursion == called from reject with table
bool Reject( ScChangeAction*, ScChangeActionMap*, bool bRecursion ); bool Reject( ScChangeAction*, ScChangeActionMap*, bool bRecursion );
bool IsLastAction( sal_uLong nNum ) const;
void ClearMsgQueue(); void ClearMsgQueue();
virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 ) SAL_OVERRIDE; virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 ) SAL_OVERRIDE;
......
...@@ -3161,8 +3161,8 @@ void ScChangeTrack::Undo( sal_uLong nStartAction, sal_uLong nEndAction, bool bMe ...@@ -3161,8 +3161,8 @@ void ScChangeTrack::Undo( sal_uLong nStartAction, sal_uLong nEndAction, bool bMe
for ( sal_uLong j = nEndAction; j >= nStartAction; --j ) for ( sal_uLong j = nEndAction; j >= nStartAction; --j )
{ // Traverse backwards to recycle nActionMax and for faster access via pLast { // Traverse backwards to recycle nActionMax and for faster access via pLast
// Deletes are in right order // Deletes are in right order
ScChangeAction* pAct = ( (j == nActionMax && pLast && ScChangeAction* pAct = IsLastAction(j) ? pLast : GetAction(j);
pLast->GetActionNumber() == j) ? pLast : GetAction( j ) );
if ( pAct ) if ( pAct )
{ {
if ( pAct->IsDeleteType() ) if ( pAct->IsDeleteType() )
...@@ -4409,6 +4409,11 @@ bool ScChangeTrack::Reject( ...@@ -4409,6 +4409,11 @@ bool ScChangeTrack::Reject(
return bRejected; return bRejected;
} }
bool ScChangeTrack::IsLastAction( sal_uLong nNum ) const
{
return nNum == nActionMax && pLast && pLast->GetActionNumber() == nNum;
}
sal_uLong ScChangeTrack::AddLoadedGenerated( sal_uLong ScChangeTrack::AddLoadedGenerated(
const ScCellValue& rNewCell, const ScBigRange& aBigRange, const OUString& sNewValue ) const ScCellValue& rNewCell, const ScBigRange& aBigRange, const OUString& sNewValue )
{ {
......
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