OSDN Git Service

[ 765399 ] Careful view initialization in PrimeListWithFile
authorLaurent Ganier <laoran@users.sourceforge.net>
Fri, 11 Jul 2003 23:09:45 +0000 (23:09 +0000)
committerLaurent Ganier <laoran@users.sourceforge.net>
Fri, 11 Jul 2003 23:09:45 +0000 (23:09 +0000)
Src/MergeDoc.cpp
Src/MergeEditView.cpp
Src/editlib/ccrystaltextview.cpp
Src/readme.txt

index 944c5c0..010b9b8 100644 (file)
@@ -425,14 +425,9 @@ int CMergeDoc::Rescan(BOOL bForced /* =FALSE */)
 
                                // display the files
                                PrimeTextBuffers();
-
-                               int nResumeTopLine = m_pLeftView->GetScrollPos(SB_VERT)+1;
-
                                m_pLeftView->PrimeListWithFile();
                                m_pRightView->PrimeListWithFile();
 
-                               m_pLeftView->GoToLine(nResumeTopLine, FALSE);
-
                                // PrimeListWithFile will call resetview which resets tabs
 //                             mf->m_pLeft->SetTabSize(mf->m_nTabSize);
 //                             mf->m_pRight->SetTabSize(mf->m_nTabSize);
index af78072..eb86bc1 100644 (file)
@@ -125,11 +125,16 @@ void CMergeEditView::UpdateResources()
 
 BOOL CMergeEditView::PrimeListWithFile()
 {
+       int nResumeTopLine = m_nTopLine;
+
        SetWordWrapping(FALSE);
        ResetView();
-       RecalcVertScrollBar();
+       // RecalcVertScrollBar is done during ScrollToLine
+       //RecalcVertScrollBar();
        SetTabSize(mf->m_nTabSize);
 
+       ScrollToLine(nResumeTopLine);
+
        return TRUE;
 }
 
index 79e457a..2097a7a 100644 (file)
@@ -1565,6 +1565,14 @@ OnDraw (CDC * pdc)
   const int nLineHeight = GetLineHeight ();
   PrepareSelBounds ();
 
+  // if the private arrays (m_pdwParseCookies and m_pnActualLineLength) 
+  // are defined, check they are in phase wih the text buffer
+  // as the access to these arrays is not protected (simple arrays not CArray) 
+  if (m_pdwParseCookies != NULL)
+    ASSERT(m_nParseArraySize == nLineCount);
+  if (m_pnActualLineLength != NULL)
+    ASSERT(m_nActualLengthArraySize == nLineCount);
+
   CDC cacheDC;
   VERIFY (cacheDC.CreateCompatibleDC (pdc));
   if (m_pCacheBitmap == NULL)
index 729a437..78e1b5c 100644 (file)
@@ -1,4 +1,9 @@
 2003-07-12 Laoran
+ PATCH: [ 765399 ] Careful view initialization in PrimeListWithFile
+  WinMerge: MergeDoc.cpp MergeEditView.cpp 
+  editlib: ccrystaltextview.cpp
+
+2003-07-12 Laoran
  PATCH: [ 769122 ] Keep top screen line within the shorter panel
   WinMerge: MergeEditView.cpp