OSSP CVS Repository

ossp - Check-in [4059]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 4059
Date: 2003-Feb-20 17:46:38 (local)
2003-Feb-20 16:46:38 (UTC)
User:ms
Branch:
Comment: Use exceptions when handling report generation errors.
Tickets:
Inspections:
Files:
ossp-pkg/as/as-gui/as_slot.cpp      1.128 -> 1.129     10 inserted, 6 deleted

ossp-pkg/as/as-gui/as_slot.cpp 1.128 -> 1.129

--- as_slot.cpp  2003/02/19 18:23:16     1.128
+++ as_slot.cpp  2003/02/20 16:46:38     1.129
@@ -1558,12 +1558,16 @@
 //
 void Titraqform::genReport(void)
 {
-    Reportpanel *pReport = NULL;    // The local report panel
-
-    // Create a new local report window
-    pReport = new Reportpanel(m_pMaintable, m_pPrefs, this, "Locreportpanel");
-    pReport->exec();    // Modal panel handler
-    delete pReport;     // Dispose Panel object
+    try { // Create and execute a new local report window
+        std::auto_ptr<AS::Reportpanel> pReport(new AS::Reportpanel
+            (m_pMaintable, m_pPrefs, this, "Locreportpanel"));
+        pReport->exec();
+        delete pReport.release(); // Technically unnecessary, smart pointer
+    }
+    catch (Genexcept& Genex) {
+        Genex.reportErr();
+        return;
+    }
 }
 
 //

CVSTrac 2.0.1