lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [5084] Improve error handling


From: Greg Chicares
Subject: [lmi-commits] [5084] Improve error handling
Date: Wed, 28 Jul 2010 20:42:42 +0000

Revision: 5084
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5084
Author:   chicares
Date:     2010-07-28 20:42:42 +0000 (Wed, 28 Jul 2010)
Log Message:
-----------
Improve error handling

Modified Paths:
--------------
    lmi/trunk/ChangeLog
    lmi/trunk/census_view.cpp

Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2010-07-28 20:12:37 UTC (rev 5083)
+++ lmi/trunk/ChangeLog 2010-07-28 20:42:42 UTC (rev 5084)
@@ -26653,3 +26653,29 @@
 Fix defect introduced 20100703T0055Z. See:
   http://lists.nongnu.org/archive/html/lmi/2010-07/msg00035.html
 
+20100728T1947Z <address@hidden> [658]
+
+  census_view.cpp
+Expunge disused diagnostic code.
+
+20100728T1951Z <address@hidden> [658]
+
+  census_view.cpp
+Rearrange.
+
+20100728T1956Z <address@hidden> [657]
+
+  census_view.cpp
+Improve documentation.
+
+20100728T2012Z <address@hidden> [656]
+
+  census_view.cpp
+Resurrect documented behavior.
+
+20100728T2042Z <address@hidden> [656]
+
+  census_view.cpp
+Improve error handling. See:
+  http://lists.nongnu.org/archive/html/lmi/2010-07/msg00036.html
+

Modified: lmi/trunk/census_view.cpp
===================================================================
--- lmi/trunk/census_view.cpp   2010-07-28 20:12:37 UTC (rev 5083)
+++ lmi/trunk/census_view.cpp   2010-07-28 20:42:42 UTC (rev 5084)
@@ -957,10 +957,8 @@
 ///
 /// A newly-created census contains one default cell, which doesn't
 /// represent user input, so it is erased before pasting new cells
-/// from the clipboard. It is erased as soon as the paste command is
-/// given. If pasting fails, the census is left with no cells, but
-/// that's okay; in that event, the user is likely to correct the
-/// data and repaste it.
+/// from the clipboard. The clipboard contents are validated before
+/// this erasure, so the document is not changed if pasting failed.
 ///
 /// But if the census contains any user input, it shouldn't be erased.
 /// User input is present if either the document has been modified
@@ -972,13 +970,6 @@
 
 void CensusView::UponPasteCensus(wxCommandEvent&)
 {
-    if(!document().IsModified() && !document().GetDocumentSaved())
-        {
-        cell_parms().clear();
-        class_parms().clear();
-        class_parms().push_back(case_parms()[0]);
-        }
-
     std::string const census_data = ClipboardEx::GetText();
 
     std::vector<std::string> headers;
@@ -1071,11 +1062,14 @@
         return;
         }
 
-    std::back_insert_iterator<std::vector<Input> > iip
-        (cell_parms()
-        );
+    if(!document().IsModified() && !document().GetDocumentSaved())
+        {
+        cell_parms().clear();
+        class_parms().clear();
+        class_parms().push_back(case_parms()[0]);
+        }
+    std::back_insert_iterator<std::vector<Input> > iip(cell_parms());
     std::copy(cells.begin(), cells.end(), iip);
-
     document().Modify(true);
 
     Update();




reply via email to

[Prev in Thread] Current Thread [Next in Thread]