m_ptEndPos = src.m_ptEndPos;
m_nAction = src.m_nAction;
SetText(src.GetText(), src.GetTextLength());
- INT_PTR size = src.m_paSavedRevisonNumbers->GetSize();
- if (!m_paSavedRevisonNumbers)
- m_paSavedRevisonNumbers = new CDWordArray();
- m_paSavedRevisonNumbers->SetSize(size);
+ INT_PTR size = src.m_paSavedRevisionNumbers->GetSize();
+ if (!m_paSavedRevisionNumbers)
+ m_paSavedRevisionNumbers = new CDWordArray();
+ m_paSavedRevisionNumbers->SetSize(size);
INT_PTR i;
for (i = 0; i < size; i++)
- (*m_paSavedRevisonNumbers)[i] = (*src.m_paSavedRevisonNumbers)[i];
+ (*m_paSavedRevisionNumbers)[i] = (*src.m_paSavedRevisionNumbers)[i];
}
void UndoRecord::
DWORD m_dwFlags;\r
CPoint m_ptStartPos, m_ptEndPos; // Block of text participating\r
int m_nAction; // For information only: action type\r
- CDWordArray *m_paSavedRevisonNumbers;\r
+ CDWordArray *m_paSavedRevisionNumbers;\r
\r
private:\r
// TCHAR *m_pcText;\r
UndoRecord () // default constructor\r
: m_dwFlags(0)\r
, m_nAction(0)\r
- , m_paSavedRevisonNumbers(NULL)\r
+ , m_paSavedRevisionNumbers(NULL)\r
, m_pszText(NULL)\r
{\r
}\r
UndoRecord (const UndoRecord & src) // copy constructor\r
: m_dwFlags(0)\r
, m_nAction(0)\r
- , m_paSavedRevisonNumbers(NULL)\r
+ , m_paSavedRevisionNumbers(NULL)\r
, m_pszText(NULL)\r
{\r
Clone(src);\r
virtual ~UndoRecord () // destructor\r
{\r
FreeText();\r
- if (m_paSavedRevisonNumbers)\r
- delete m_paSavedRevisonNumbers;\r
+ if (m_paSavedRevisionNumbers)\r
+ delete m_paSavedRevisionNumbers;\r
}\r
\r
void SetText (LPCTSTR pszText, int cchText);\r
}
// restore line revision numbers
- RestoreRevisionNumbers(ur.m_ptStartPos.y, ur.m_paSavedRevisonNumbers);
+ RestoreRevisionNumbers(ur.m_ptStartPos.y, ur.m_paSavedRevisionNumbers);
if (ur.m_dwFlags & UNDO_BEGINGROUP)
break;
void CCrystalTextBuffer::
AddUndoRecord (bool bInsert, const CPoint & ptStartPos,
const CPoint & ptEndPos, LPCTSTR pszText, int cchText, int nActionType,
- CDWordArray *paSavedRevisonNumbers)
+ CDWordArray *paSavedRevisionNumbers)
{
// Forgot to call BeginUndoGroup()?
ASSERT (m_bUndoGroup);
ur.m_ptStartPos = ptStartPos;
ur.m_ptEndPos = ptEndPos;
ur.SetText (pszText, cchText);
- ur.m_paSavedRevisonNumbers = paSavedRevisonNumbers;
+ ur.m_paSavedRevisionNumbers = paSavedRevisionNumbers;
// Optimize memory allocation
if (m_aUndoBuf.capacity() == m_aUndoBuf.size())
bool bHistory /*=true*/)
{
// save line revision numbers for undo
- CDWordArray *paSavedRevisonNumbers = new CDWordArray;
- paSavedRevisonNumbers->SetSize(1);
- (*paSavedRevisonNumbers)[0] = m_aLines[nLine].m_dwRevisionNumber;
+ CDWordArray *paSavedRevisionNumbers = new CDWordArray;
+ paSavedRevisionNumbers->SetSize(1);
+ (*paSavedRevisionNumbers)[0] = m_aLines[nLine].m_dwRevisionNumber;
if (!InternalInsertText (pSource, nLine, nPos, pszText, cchText, nEndLine, nEndChar))
{
- delete paSavedRevisonNumbers;
+ delete paSavedRevisionNumbers;
return false;
}
if (bHistory == false)
{
- delete paSavedRevisonNumbers;
+ delete paSavedRevisionNumbers;
return true;
}
}
AddUndoRecord (true, CPoint (nPos, nLine), CPoint (nEndChar, nEndLine),
- pszText, cchText, nAction, paSavedRevisonNumbers);
+ pszText, cchText, nAction, paSavedRevisionNumbers);
if (bGroupFlag)
FlushUndoGroup (pSource);
CopyRevisionNumbers(int nStartLine, int nEndLine) const
{
// save line revision numbers for undo
- CDWordArray *paSavedRevisonNumbers = new CDWordArray;
- paSavedRevisonNumbers->SetSize(nEndLine - nStartLine + 1);
+ CDWordArray *paSavedRevisionNumbers = new CDWordArray;
+ paSavedRevisionNumbers->SetSize(nEndLine - nStartLine + 1);
for (int i = 0; i < nEndLine - nStartLine + 1; i++)
- (*paSavedRevisonNumbers)[i] = m_aLines[nStartLine + i].m_dwRevisionNumber;
- return paSavedRevisonNumbers;
+ (*paSavedRevisionNumbers)[i] = m_aLines[nStartLine + i].m_dwRevisionNumber;
+ return paSavedRevisionNumbers;
}
void CCrystalTextBuffer::
-RestoreRevisionNumbers(int nStartLine, CDWordArray *paSavedRevisonNumbers)
+RestoreRevisionNumbers(int nStartLine, CDWordArray *paSavedRevisionNumbers)
{
- for (int i = 0; i < paSavedRevisonNumbers->GetSize(); i++)
- m_aLines[nStartLine + i].m_dwRevisionNumber = (*paSavedRevisonNumbers)[i];
+ for (int i = 0; i < paSavedRevisionNumbers->GetSize(); i++)
+ m_aLines[nStartLine + i].m_dwRevisionNumber = (*paSavedRevisionNumbers)[i];
}
bool CCrystalTextBuffer::
GetTextWithoutEmptys (nStartLine, nStartChar, nEndLine, nEndChar, sTextToDelete);
// save line revision numbers for undo
- CDWordArray *paSavedRevisonNumbers = CopyRevisionNumbers(nStartLine, nEndLine);
+ CDWordArray *paSavedRevisionNumbers = CopyRevisionNumbers(nStartLine, nEndLine);
if (!InternalDeleteText (pSource, nStartLine, nStartChar, nEndLine, nEndChar))
{
- delete paSavedRevisonNumbers;
+ delete paSavedRevisionNumbers;
return false;
}
if (bHistory == false)
{
- delete paSavedRevisonNumbers;
+ delete paSavedRevisionNumbers;
return true;
}
AddUndoRecord (false, CPoint (nStartChar, nStartLine), CPoint (nEndChar, nEndLine),
- sTextToDelete, sTextToDelete.GetLength(), nAction, paSavedRevisonNumbers);
+ sTextToDelete, sTextToDelete.GetLength(), nAction, paSavedRevisionNumbers);
return true;
}
// [JRT] Support For Descriptions On Undo/Redo Actions
virtual void AddUndoRecord (bool bInsert, const CPoint & ptStartPos, const CPoint & ptEndPos,
- LPCTSTR pszText, int cchText, int nActionType = CE_ACTION_UNKNOWN, CDWordArray *paSavedRevisonNumbers = NULL);
+ LPCTSTR pszText, int cchText, int nActionType = CE_ACTION_UNKNOWN, CDWordArray *paSavedRevisionNumbers = NULL);
virtual UndoRecord GetUndoRecord (int nUndoPos) const;
virtual CDWordArray *CopyRevisionNumbers(int nStartLine, int nEndLine) const;
void CDiffTextBuffer::AddUndoRecord(bool bInsert, const CPoint & ptStartPos,
const CPoint & ptEndPos, LPCTSTR pszText, int cchText,
int nActionType /*= CE_ACTION_UNKNOWN*/,
- CDWordArray *paSavedRevisonNumbers)
+ CDWordArray *paSavedRevisionNumbers)
{
CGhostTextBuffer::AddUndoRecord(bInsert, ptStartPos, ptEndPos, pszText,
- cchText, nActionType, paSavedRevisonNumbers);
+ cchText, nActionType, paSavedRevisionNumbers);
if (m_aUndoBuf[m_nUndoPosition - 1].m_dwFlags & UNDO_BEGINGROUP)
{
m_pOwnerDoc->undoTgt.erase(m_pOwnerDoc->curUndo, m_pOwnerDoc->undoTgt.end());
virtual void AddUndoRecord (bool bInsert, const CPoint & ptStartPos,
const CPoint & ptEndPos, LPCTSTR pszText, int cchText,
int nActionType = CE_ACTION_UNKNOWN,
- CDWordArray *paSavedRevisonNumbers = NULL);
+ CDWordArray *paSavedRevisionNumbers = NULL);
bool curUndoGroup();
void ReplaceFullLines(CDiffTextBuffer& dbuf, CDiffTextBuffer& sbuf, CCrystalTextView * pSource, int nLineBegin, int nLineEnd, int nAction =CE_ACTION_UNKNOWN);
CDWordArray *CGhostTextBuffer::
CopyRevisionNumbers(int nStartLine, int nEndLine) const
{
- CDWordArray *paSavedRevisonNumbers = CCrystalTextBuffer::CopyRevisionNumbers(nStartLine, nEndLine);
+ CDWordArray *paSavedRevisionNumbers = CCrystalTextBuffer::CopyRevisionNumbers(nStartLine, nEndLine);
for (int nLine = nEndLine; nLine >= nStartLine; --nLine)
{
if ((GetLineFlags(nLine) & LF_GHOST) != 0)
- paSavedRevisonNumbers->RemoveAt(nLine - nStartLine);
+ paSavedRevisionNumbers->RemoveAt(nLine - nStartLine);
}
if ((GetLineFlags(nEndLine) & LF_GHOST) != 0)
{
for (int nLine = nEndLine + 1; nLine < GetLineCount(); ++nLine)
if ((GetLineFlags(nLine) & LF_GHOST) == 0)
{
- paSavedRevisonNumbers->Add(GetLineFlags(nLine));
+ paSavedRevisionNumbers->Add(GetLineFlags(nLine));
break;
}
}
- return paSavedRevisonNumbers;
+ return paSavedRevisionNumbers;
}
void CGhostTextBuffer::
-RestoreRevisionNumbers(int nStartLine, CDWordArray *paSavedRevisonNumbers)
+RestoreRevisionNumbers(int nStartLine, CDWordArray *paSavedRevisionNumbers)
{
- for (int i = 0, j = 0; i < paSavedRevisonNumbers->GetSize(); j++)
+ for (int i = 0, j = 0; i < paSavedRevisionNumbers->GetSize(); j++)
{
if ((GetLineFlags(nStartLine + j) & LF_GHOST) == 0)
{
- m_aLines[nStartLine + j].m_dwRevisionNumber = (*paSavedRevisonNumbers)[i];
+ m_aLines[nStartLine + j].m_dwRevisionNumber = (*paSavedRevisionNumbers)[i];
++i;
}
}
void CGhostTextBuffer::AddUndoRecord(bool bInsert, const CPoint & ptStartPos,
const CPoint & ptEndPos, LPCTSTR pszText, int cchText,
int nActionType /*= CE_ACTION_UNKNOWN*/,
- CDWordArray *paSavedRevisonNumbers)
+ CDWordArray *paSavedRevisionNumbers)
{
CPoint real_ptStartPos(ptStartPos.x, ComputeRealLine(ptStartPos.y));
CPoint real_ptEndPos(ptEndPos.x, real_ptStartPos.y + CountEol(pszText, cchText));
CCrystalTextBuffer::AddUndoRecord(bInsert, real_ptStartPos, real_ptEndPos, pszText,
- cchText, nActionType, paSavedRevisonNumbers);
+ cchText, nActionType, paSavedRevisionNumbers);
}
UndoRecord CGhostTextBuffer::GetUndoRecord(int nUndoPos) const
bool InsertGhostLine (CCrystalTextView * pSource, int nLine);
virtual void AddUndoRecord (bool bInsert, const CPoint & ptStartPos, const CPoint & ptEndPos,
- LPCTSTR pszText, int cchText, int nActionType = CE_ACTION_UNKNOWN, CDWordArray *paSavedRevisonNumbers = NULL);
+ LPCTSTR pszText, int cchText, int nActionType = CE_ACTION_UNKNOWN, CDWordArray *paSavedRevisionNumbers = NULL);
virtual UndoRecord GetUndoRecord(int nUndoPos) const;
virtual CDWordArray *CopyRevisionNumbers(int nStartLine, int nEndLine) const;
- virtual void RestoreRevisionNumbers(int nStartLine, CDWordArray *paSavedRevisonNumbers);
+ virtual void RestoreRevisionNumbers(int nStartLine, CDWordArray *paSavedRevisionNumbers);
public:
//@{