}
// restore line revision numbers
- int naSavedRevisonNumbersSize = (int) ur.m_paSavedRevisonNumbers->GetSize();
- for (int i = 0; i < naSavedRevisonNumbersSize; i++)
- m_aLines[ur.m_ptStartPos.y + i].m_dwRevisionNumber = (*ur.m_paSavedRevisonNumbers)[i];
+ RestoreRevisionNumbers(ur.m_ptStartPos.y, ur.m_paSavedRevisonNumbers);
if (ur.m_dwFlags & UNDO_BEGINGROUP)
break;
return paSavedRevisonNumbers;
}
+void CCrystalTextBuffer::
+RestoreRevisionNumbers(int nStartLine, CDWordArray *paSavedRevisonNumbers)
+{
+ for (int i = 0; i < paSavedRevisonNumbers->GetSize(); i++)
+ m_aLines[nStartLine + i].m_dwRevisionNumber = (*paSavedRevisonNumbers)[i];
+}
+
bool CCrystalTextBuffer::
DeleteText2 (CCrystalTextView * pSource, int nStartLine, int nStartChar,
int nEndLine, int nEndChar, int nAction, bool bHistory /*=true*/)
virtual UndoRecord GetUndoRecord (int nUndoPos) const;
virtual CDWordArray *CopyRevisionNumbers(int nStartLine, int nEndLine) const;
+ virtual void RestoreRevisionNumbers(int nStartLine, CDWordArray *psaSavedRevisionNumbers);
// Overridable: provide action description
virtual bool GetActionDescription (int nAction, CString & desc) const;
return paSavedRevisonNumbers;
}
+void CGhostTextBuffer::
+RestoreRevisionNumbers(int nStartLine, CDWordArray *paSavedRevisonNumbers)
+{
+ for (int i = 0, j = 0; i < paSavedRevisonNumbers->GetSize(); j++)
+ {
+ if ((GetLineFlags(nStartLine + j) & LF_GHOST) == 0)
+ {
+ m_aLines[nStartLine + j].m_dwRevisionNumber = (*paSavedRevisonNumbers)[i];
+ ++i;
+ }
+ }
+}
+
bool CGhostTextBuffer::
DeleteText2 (CCrystalTextView * pSource, int nStartLine, int nStartChar,
int nEndLine, int nEndChar, int nAction, bool bHistory /*=true*/)
virtual UndoRecord GetUndoRecord(int nUndoPos) const;
virtual CDWordArray *CopyRevisionNumbers(int nStartLine, int nEndLine) const;
+ virtual void RestoreRevisionNumbers(int nStartLine, CDWordArray *paSavedRevisonNumbers);
public:
//@{