[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [tortoisesvn] r24208 committed - Keep the modified state for each view in the undo-state.

From: Oto BREZINA <brezina_at_printflow.eu>
Date: Sat, 18 May 2013 16:50:11 +0200

Stefan i will take care about this issue, it is not that simple, you may save view separetaly and then modified state stop work.

Only question I have no answer yet is where to store base undo step when saving view in view or in undo.

--
Ot(ik) Oto BREZINA, Printflow s.r.o, EU
mobil: +421 903 653470, skype: ot_ik_
----- Reply message -----
From: tortoisesvn_at_googlecode.com
To: <commits_at_tortoisesvn.tigris.org>
Subject: [tortoisesvn] r24208 committed - Keep the modified state for each view in the undo-state.
Date: Sat, May 18, 2013 14:19
Revision: 24208
Author:   tortoisesvn
Date:     Sat May 18 05:19:09 2013
Log:      Keep the modified state for each view in the undo-state.
http://code.google.com/p/tortoisesvn/source/detail?r=24208
Modified:
  /trunk/src/TortoiseMerge/BaseView.cpp
  /trunk/src/TortoiseMerge/Undo.cpp
  /trunk/src/TortoiseMerge/Undo.h
=======================================
--- /trunk/src/TortoiseMerge/BaseView.cpp	Sun May  5 04:03:34 2013
+++ /trunk/src/TortoiseMerge/BaseView.cpp	Sat May 18 05:19:09 2013
@@ -4706,6 +4706,12 @@
  {
      if (!m_AllState.IsEmpty())
      {
+        if (m_pwndLeft)
+            m_AllState.left.modified = m_pwndLeft->IsModified();
+        if (m_pwndRight)
+            m_AllState.right.modified = m_pwndRight->IsModified();
+        if (m_pwndBottom)
+            m_AllState.bottom.modified = m_pwndBottom->IsModified();
          CUndo::GetInstance().AddState(m_AllState, GetCaretViewPosition());
      }
      ResetUndoStep();
=======================================
--- /trunk/src/TortoiseMerge/Undo.cpp	Thu Nov 29 01:23:40 2012
+++ /trunk/src/TortoiseMerge/Undo.cpp	Sat May 18 05:19:09 2013
@@ -1,6 +1,6 @@
  // TortoiseMerge - a Diff/Patch program
-// Copyright (C) 2006-2007, 2010-2011 - TortoiseSVN
+// Copyright (C) 2006-2007, 2010-2011, 2013 - TortoiseSVN
  // This program is free software; you can redistribute it and/or
  // modify it under the terms of the GNU General Public License
@@ -45,6 +45,7 @@
      removedlines.clear();
      replacedlines.clear();
+    modified = false;
  }
  CUndo& CUndo::GetInstance()
@@ -110,13 +111,6 @@
          pActiveView->RecalcAllHorzScrollBars();
          pActiveView->EnsureCaretVisible();
          pActiveView->UpdateCaret();
-        bool bModified = m_viewstates.size() != m_originalstate;
-        if (pLeft)
-            pLeft->SetModified(bModified);
-        if (pRight)
-            pRight->SetModified(bModified);
-        if (pBottom)
-            pBottom->SetModified(bModified);
          pActiveView->RefreshViews();
      }
@@ -183,8 +177,7 @@
          pView->SetCaretViewPosition(pt);
          pView->EnsureCaretVisible();
      }
-
-
+    pView->SetModified(state.modified);
  }
  void CUndo::Clear()
=======================================
--- /trunk/src/TortoiseMerge/Undo.h	Sat Feb  2 02:36:47 2013
+++ /trunk/src/TortoiseMerge/Undo.h	Sat May 18 05:19:09 2013
@@ -1,6 +1,6 @@
  // TortoiseMerge - a Diff/Patch program
-// Copyright (C) 2006-2007, 2009-2012 - TortoiseSVN
+// Copyright (C) 2006-2007, 2009-2013 - TortoiseSVN
  // This program is free software; you can redistribute it and/or
  // modify it under the terms of the GNU General Public License
@@ -29,14 +29,15 @@
   */
  typedef struct viewstate
  {
-    std::map<int, CString> difflines;
-    std::map<int, DWORD> linestates;
-    std::map<int, DWORD> linelines;
-    std::map<int, EOL> linesEOL;
-    std::list<int> addedlines;
+    std::map<int, CString>  difflines;
+    std::map<int, DWORD>    linestates;
+    std::map<int, DWORD>    linelines;
+    std::map<int, EOL>      linesEOL;
+    std::list<int>          addedlines;
      std::map<int, viewdata> removedlines;
      std::map<int, viewdata> replacedlines;
+    bool                    modified;
      void    AddViewLineFromView(CBaseView *pView, int nViewLine, bool  
bAddEmptyLine);
      void    Clear();
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=3547&dsMessageId=3055863
__________ Information from ESET Mail Security, version of virus signature database 8346 (20130518) __________
The message was checked by ESET Mail Security.
http://www.eset.com
Received on 2013-05-18 16:51:02 CEST

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.