[glom/glom-1-26] AddDel::construct_specified_columns(): Really zero the items.



commit 3f173983b26d1c2a9740773091c19a8ef9e47797
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Dec 2 22:00:37 2014 +0100

    AddDel::construct_specified_columns(): Really zero the items.
    
    The = 0 was inside the switch() instead of after it.
    Found by Coverity Scan.

 glom/utility_widgets/adddel/adddel.cc |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/glom/utility_widgets/adddel/adddel.cc b/glom/utility_widgets/adddel/adddel.cc
index 476cd3b..7eab78d 100644
--- a/glom/utility_widgets/adddel/adddel.cc
+++ b/glom/utility_widgets/adddel/adddel.cc
@@ -701,13 +701,13 @@ void AddDel::construct_specified_columns()
   model_column_index = 0;
   for(type_vecModelColumns::iterator iter = vecModelColumns.begin(); iter != vecModelColumns.end(); ++iter)
   {
-     Gtk::TreeModelColumnBase* pModelColumn = *iter;
+    Gtk::TreeModelColumnBase* pModelColumn = *iter;
 
-     if(model_column_index < (int)m_ColumnTypes.size())
-     {
-       AddDelColumnInfo::enumStyles style = m_ColumnTypes[model_column_index].m_style;
-       switch(style)
-       {
+    if(model_column_index < (int)m_ColumnTypes.size())
+    {
+      AddDelColumnInfo::enumStyles style = m_ColumnTypes[model_column_index].m_style;
+      switch(style)
+      {
         //Cast it to the derived type, so we can delete it properly.
         //This is necessary because TreeModelColumnBase's destructor is not virtual.
         case(AddDelColumnInfo::STYLE_Boolean):
@@ -728,9 +728,9 @@ void AddDel::construct_specified_columns()
           delete pModelColumnDerived;
           break;
         }
-
-        *iter = 0;
       }
+
+      *iter = 0;
     }
     else
     {


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