[glom] C+11: Use auto for iterator types.



commit 69732ec45779ba127ded76cc43d2dd475844196f
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Jan 5 17:04:03 2016 +0100

    C+11: Use auto for iterator types.

 glom/base_db.cc                                    |    4 ++--
 glom/base_db_table_data.cc                         |    6 +++---
 glom/import_csv/dialog_import_csv_progress.cc      |    4 ++--
 glom/libglom/connectionpool.cc                     |    4 ++--
 glom/libglom/db_utils.cc                           |    2 +-
 glom/libglom/document/document.cc                  |   10 +++++-----
 glom/libglom/privs.cc                              |    2 +-
 glom/libglom/python_embed/py_glom_record.cc        |    2 +-
 glom/libglom/python_embed/py_glom_related.cc       |    4 ++--
 glom/libglom/python_embed/py_glom_relatedrecord.cc |    2 +-
 glom/libglom/utils.cc                              |    8 ++++----
 glom/mode_data/box_data_calendar_related.cc        |    2 +-
 .../mode_data/datawidget/combo_as_radio_buttons.cc |    2 +-
 .../datawidget/combochoiceswithtreemodel.cc        |    2 +-
 glom/mode_data/datawidget/treemodel_db.cc          |    6 +++---
 glom/mode_data/db_adddel/db_adddel.cc              |    2 +-
 glom/mode_data/flowtablewithfields.cc              |    4 ++--
 glom/mode_design/fields/box_db_table_definition.cc |    4 ++--
 glom/mode_design/iso_codes.cc                      |    2 +-
 glom/mode_design/layout/treestore_layout.cc        |   12 ++++++------
 .../print_layouts/window_print_layout_edit.cc      |    2 +-
 .../relationships_overview/canvas_group_dbtable.cc |    2 +-
 .../report_layout/treestore_report_layout.cc       |    8 ++++----
 glom/navigation/box_tables.cc                      |    2 +-
 glom/print_layout/canvas_print_layout.cc           |    8 ++++----
 tests/import/test_parsing.cc                       |    6 +++---
 tests/import/test_signals.cc                       |    4 ++--
 tests/test_document_load.cc                        |    4 ++--
 tests/test_document_load_translations.cc           |    2 +-
 29 files changed, 61 insertions(+), 61 deletions(-)
---
diff --git a/glom/base_db.cc b/glom/base_db.cc
index 22f5dcd..36d8789 100644
--- a/glom/base_db.cc
+++ b/glom/base_db.cc
@@ -619,7 +619,7 @@ void Base_DB::get_table_fields_to_show_for_sequence_add_group(const Glib::ustrin
       }
       else //It's a regular field in the table:
       {
-        type_vec_fields::const_iterator iterFind = find_if_same_name(all_db_fields, field_name);
+        const auto iterFind = find_if_same_name(all_db_fields, field_name);
 
         //If the field does not exist anymore then we won't try to show it:
         if(iterFind != all_db_fields.end() )
@@ -1151,7 +1151,7 @@ Base_DB::type_list_const_field_items Base_DB::get_calculated_fields(const Glib::
       //Does this field's calculation use the field?
       const auto fields_triggered = get_calculation_fields(table_name, layoutitem_field_to_examine);
       //std::cout << "    debug: field_triggered.size()=" << fields_triggered.size() << std::endl;
-      type_list_const_field_items::const_iterator iterFind = find_if_layout_item_is_equal(fields_triggered, 
field);
+      const auto iterFind = find_if_layout_item_is_equal(fields_triggered, field);
       if(iterFind != fields_triggered.end())
       {
         //std::cout << "      debug: FOUND: name=" << layoutitem_field_to_examine->get_name() << std::endl;
diff --git a/glom/base_db_table_data.cc b/glom/base_db_table_data.cc
index 4b0a1ce..d104166 100644
--- a/glom/base_db_table_data.cc
+++ b/glom/base_db_table_data.cc
@@ -75,7 +75,7 @@ bool Base_DB_Table_Data::record_new(bool use_entered_data, const Gnome::Gda::Val
   for(const auto& item : m_TableFields)
   {
     //TODO: Search for the non-related field with the name, not just the field with the name:
-    type_vecConstLayoutFields::const_iterator iterFind = find_if_same_name(fieldsToAdd, item->get_name());
+    const auto iterFind = find_if_same_name(fieldsToAdd, item->get_name());
     if(iterFind == fieldsToAdd.end())
     {
       std::shared_ptr<LayoutItem_Field> layout_item = std::make_shared<LayoutItem_Field>();
@@ -99,7 +99,7 @@ bool Base_DB_Table_Data::record_new(bool use_entered_data, const Gnome::Gda::Val
     const Glib::ustring field_name = layout_item->get_name();
     if(!layout_item->get_has_relationship_name()) //TODO: Allow people to add a related record also by 
entering new data in a related field of the related record.
     {
-      type_map_added::const_iterator iterFind = map_added.find(field_name);
+      const auto iterFind = map_added.find(field_name);
       if(iterFind == map_added.end()) //If it was not added already
       {
         Gnome::Gda::Value value;
@@ -510,7 +510,7 @@ void Base_DB_Table_Data::refresh_related_fields(const LayoutFieldInRecord& field
       //Field contents:
       if(result->get_n_rows())
       {
-        type_vecConstLayoutFields::const_iterator iterFields = fieldsToGet.begin();
+        auto iterFields = fieldsToGet.begin();
 
         const guint cols_count = result->get_n_columns();
         if(cols_count <= 0)
diff --git a/glom/import_csv/dialog_import_csv_progress.cc b/glom/import_csv/dialog_import_csv_progress.cc
index 947bec0..16bba81 100644
--- a/glom/import_csv/dialog_import_csv_progress.cc
+++ b/glom/import_csv/dialog_import_csv_progress.cc
@@ -261,7 +261,7 @@ void Dialog_Import_CSV_Progress::on_response(int /* response_id */)
 
 Gnome::Gda::Value Dialog_Import_CSV_Progress::get_entered_field_data(const std::shared_ptr<const 
LayoutItem_Field>& field) const
 {
-  type_mapValues::const_iterator iter = m_current_row_values.find(field->get_name());
+  const auto iter = m_current_row_values.find(field->get_name());
   if(iter == m_current_row_values.end())
     return Gnome::Gda::Value();
 
@@ -280,7 +280,7 @@ std::shared_ptr<Field> Dialog_Import_CSV_Progress::get_field_primary_key() const
 
 Gnome::Gda::Value Dialog_Import_CSV_Progress::get_primary_key_value_selected() const
 {
-  type_mapValues::const_iterator iter = m_current_row_values.find(m_field_primary_key->get_name());
+  const auto iter = m_current_row_values.find(m_field_primary_key->get_name());
   if(iter == m_current_row_values.end())
     return Gnome::Gda::Value();
 
diff --git a/glom/libglom/connectionpool.cc b/glom/libglom/connectionpool.cc
index 9c7d0f4..8331eff 100644
--- a/glom/libglom/connectionpool.cc
+++ b/glom/libglom/connectionpool.cc
@@ -783,8 +783,8 @@ bool ConnectionPool::change_columns(const Glib::ustring& table_name, const type_
   //Add or remove any auto-increment rows:
   //The new auto-increment row would actually be added automatically,
   //but this makes it available even before a record has been added. 
-  type_vec_const_fields::const_iterator iter_old = old_fields.begin();
-  type_vec_const_fields::const_iterator iter_new = new_fields.begin();
+  auto iter_old = old_fields.begin();
+  auto iter_new = new_fields.begin();
   while( (iter_old != old_fields.end()) && (iter_new != new_fields.end()) )
   {
     const std::shared_ptr<const Field> field_old = *iter_old;
diff --git a/glom/libglom/db_utils.cc b/glom/libglom/db_utils.cc
index ddcb77d..237e0a3 100644
--- a/glom/libglom/db_utils.cc
+++ b/glom/libglom/db_utils.cc
@@ -993,7 +993,7 @@ type_vec_fields get_fields_for_table(const Document* document, const Glib::ustri
 
     //Get the field info from the database:
     //This is in the document as well, but it _might_ have changed.
-    type_vec_fields::const_iterator iterFindDatabase = 
+    const auto iterFindDatabase = 
       find_if_same_name(fieldsDatabase, field_name);
 
     if(iterFindDatabase != fieldsDatabase.end() ) //Ignore fields that don't exist in the database anymore.
diff --git a/glom/libglom/document/document.cc b/glom/libglom/document/document.cc
index f885ffd..ccec382 100644
--- a/glom/libglom/document/document.cc
+++ b/glom/libglom/document/document.cc
@@ -3727,7 +3727,7 @@ bool Document::save_before()
           XmlUtils::set_child_text_node(elemField, GLOM_NODE_CALCULATION, field->get_calculation());
 
           Glib::ustring field_type;
-          Field::type_map_type_names::const_iterator iterTypes = type_names.find( field->get_glom_type() );
+          const auto iterTypes = type_names.find( field->get_glom_type() );
           if(iterTypes != type_names.end())
             field_type = iterTypes->second;
 
@@ -4040,7 +4040,7 @@ std::shared_ptr<Report> Document::get_report(const Glib::ustring& table_name, co
   const std::shared_ptr<const DocumentTableInfo> info = get_table_info(table_name);
   if(info)
   {
-    DocumentTableInfo::type_reports::const_iterator iterFindReport = info->m_reports.find(report_name);
+    const auto iterFindReport = info->m_reports.find(report_name);
     if(iterFindReport != info->m_reports.end())
     {
       return iterFindReport->second;
@@ -4099,7 +4099,7 @@ std::shared_ptr<PrintLayout> Document::get_print_layout(const Glib::ustring& tab
   const std::shared_ptr<const DocumentTableInfo> info = get_table_info(table_name);
   if(info)
   {
-    DocumentTableInfo::type_print_layouts::const_iterator iterFindPrintLayout = 
info->m_print_layouts.find(print_layout_name);
+    const auto iterFindPrintLayout = info->m_print_layouts.find(print_layout_name);
     if(iterFindPrintLayout != info->m_print_layouts.end())
     {
       return iterFindPrintLayout->second;
@@ -4205,7 +4205,7 @@ Gnome::Gda::Value Document::get_layout_record_viewed(const Glib::ustring& table_
   const std::shared_ptr<const DocumentTableInfo> info = get_table_info(table_name);
   if(info)
   {
-    DocumentTableInfo::type_map_layout_primarykeys::const_iterator iterLayoutKeys = 
info->m_map_current_record.find(layout_name);
+    const auto iterLayoutKeys = info->m_map_current_record.find(layout_name);
     if(iterLayoutKeys != info->m_map_current_record.end())
       return iterLayoutKeys->second;
   }
@@ -4669,7 +4669,7 @@ void Document::set_library_module(const Glib::ustring& name, const Glib::ustring
 
 Glib::ustring Document::get_library_module(const Glib::ustring& name) const
 {
-  type_map_library_scripts::const_iterator iter = m_map_library_scripts.find(name);
+  const auto iter = m_map_library_scripts.find(name);
   if(iter != m_map_library_scripts.end())
   {
     return iter->second;
diff --git a/glom/libglom/privs.cc b/glom/libglom/privs.cc
index 323d416..2e40dd7 100644
--- a/glom/libglom/privs.cc
+++ b/glom/libglom/privs.cc
@@ -448,7 +448,7 @@ Privileges Privs::get_current_privs(const Glib::ustring& table_name)
 
   //Return a cached value if possible.
   //(If it is in the cache then it's fairly recent)
-  type_map_privileges::const_iterator iter = m_privileges_cache.find(table_name);
+  const auto iter = m_privileges_cache.find(table_name);
   if(iter != m_privileges_cache.end())
   {
     //std::cout << "debug: " << G_STRFUNC << ": Returning cache." << std::endl;
diff --git a/glom/libglom/python_embed/py_glom_record.cc b/glom/libglom/python_embed/py_glom_record.cc
index 7a8fdb6..eb84edd 100644
--- a/glom/libglom/python_embed/py_glom_record.cc
+++ b/glom/libglom/python_embed/py_glom_record.cc
@@ -115,7 +115,7 @@ boost::python::object PyGlomRecord::getitem(const boost::python::object& cppitem
 {
   const std::string key = boost::python::extract<std::string>(cppitem);
 
-  PyGlomRecord::type_map_field_values::const_iterator iterFind = m_map_field_values.find(key);
+  const auto iterFind = m_map_field_values.find(key);
   if(iterFind != m_map_field_values.end())
   {
     return glom_pygda_value_as_boost_pyobject(iterFind->second);
diff --git a/glom/libglom/python_embed/py_glom_related.cc b/glom/libglom/python_embed/py_glom_related.cc
index 2ec0b94..cac9820 100644
--- a/glom/libglom/python_embed/py_glom_related.cc
+++ b/glom/libglom/python_embed/py_glom_related.cc
@@ -63,7 +63,7 @@ boost::python::object PyGlomRelated::getitem(const boost::python::object& cppite
       else
       {
         //If the relationship exists:
-        PyGlomRelated::type_map_relationships::const_iterator iterFind = m_map_relationships.find(key);
+        const auto iterFind = m_map_relationships.find(key);
         if(iterFind != m_map_relationships.end())
         {
           //Get the value of the from_key in the parent record.
@@ -74,7 +74,7 @@ boost::python::object PyGlomRelated::getitem(const boost::python::object& cppite
           if(extractor_record.check())
           {
             PyGlomRecord* record = extractor_record;
-            PyGlomRecord::type_map_field_values::const_iterator iterFromKey = 
record->m_map_field_values.find(from_key);
+            const auto iterFromKey = record->m_map_field_values.find(from_key);
             if(iterFromKey != record->m_map_field_values.end())
             {
               const Gnome::Gda::Value& from_key_value = iterFromKey->second;
diff --git a/glom/libglom/python_embed/py_glom_relatedrecord.cc 
b/glom/libglom/python_embed/py_glom_relatedrecord.cc
index d228a27..c74fabd 100644
--- a/glom/libglom/python_embed/py_glom_relatedrecord.cc
+++ b/glom/libglom/python_embed/py_glom_relatedrecord.cc
@@ -59,7 +59,7 @@ boost::python::object PyGlomRelatedRecord::getitem(const boost::python::object&
 {
   const std::string field_name = boost::python::extract<std::string>(cppitem);
 
-  PyGlomRelatedRecord::type_map_field_values::const_iterator iterFind = m_map_field_values.find(field_name);
+  const auto iterFind = m_map_field_values.find(field_name);
   if(iterFind != m_map_field_values.end())
   {
     //If the value has already been stored, then just return it again:
diff --git a/glom/libglom/utils.cc b/glom/libglom/utils.cc
index e7a8035..cc7b2b6 100644
--- a/glom/libglom/utils.cc
+++ b/glom/libglom/utils.cc
@@ -99,7 +99,7 @@ Glib::ustring Utils::trim_whitespace(const Glib::ustring& text)
  //Find non-whitespace from back:
   Glib::ustring::size_type posBack = Glib::ustring::npos;
   pos = 0;
-  for(Glib::ustring::reverse_iterator iter = result.rbegin(); iter != result.rend(); ++iter)
+  for(auto iter = result.rbegin(); iter != result.rend(); ++iter)
   {
     if(!Glib::Unicode::isspace(*iter))
     {
@@ -241,7 +241,7 @@ static void add_to_relationships_list(type_list_relationships& list_relationship
     return;
 
   //If this is a related relationship, add the first-level relationship too, so that the related 
relationship can be defined in terms of it:
-  type_list_relationships::const_iterator iterFind = 
find_if_uses_relationship_has_relationship(list_relationships, layout_item, true /* top_level_only */);
+  auto iterFind = find_if_uses_relationship_has_relationship(list_relationships, layout_item, true /* 
top_level_only */);
   if(iterFind == list_relationships.end()) //If the table is not yet in the list:
   {
     std::shared_ptr<UsesRelationship> uses_rel = std::make_shared<UsesRelationship>();
@@ -1486,7 +1486,7 @@ LayoutGroup::type_list_const_items Utils::get_layout_items_plus_primary_key(cons
   pk_layout_item->set_hidden();
   pk_layout_item->set_full_field_details(field_primary_key);
   
-  const LayoutGroup::type_list_const_items::const_iterator iterFind =
+  const auto iterFind =
     find_if_layout_item_field_is_same_field(items, pk_layout_item);
   if(iterFind != items.end())
     return items; //It is already in the list:
@@ -1516,7 +1516,7 @@ LayoutGroup::type_list_items Utils::get_layout_items_plus_primary_key(const Layo
   pk_layout_item->set_hidden();
   pk_layout_item->set_full_field_details(field_primary_key);
   
-  const LayoutGroup::type_list_items::const_iterator iterFind = 
+  const auto iterFind = 
     find_if_layout_item_field_is_same_field(items, pk_layout_item);
   if(iterFind != items.end())
     return items; //It is already in the list:
diff --git a/glom/mode_data/box_data_calendar_related.cc b/glom/mode_data/box_data_calendar_related.cc
index e59dd11..a640d4e 100644
--- a/glom/mode_data/box_data_calendar_related.cc
+++ b/glom/mode_data/box_data_calendar_related.cc
@@ -431,7 +431,7 @@ Glib::ustring Box_Data_Calendar_Related::on_calendar_details(guint year, guint m
   Glib::Date date(day, datemonth, year);
 
   //Examine the cached data:
-  type_map_values::const_iterator iter_find = m_map_values.find(date);
+  const auto iter_find = m_map_values.find(date);
   if(iter_find == m_map_values.end())
     return Glib::ustring(); //No data was found for this date.
 
diff --git a/glom/mode_data/datawidget/combo_as_radio_buttons.cc 
b/glom/mode_data/datawidget/combo_as_radio_buttons.cc
index a6d0bb5..a21ac15 100644
--- a/glom/mode_data/datawidget/combo_as_radio_buttons.cc
+++ b/glom/mode_data/datawidget/combo_as_radio_buttons.cc
@@ -88,7 +88,7 @@ void ComboAsRadioButtons::set_choices_with_second(const type_list_values_with_se
       const auto extra_values = the_pair.second;
       if(layout_choice_extra && !extra_values.empty())
       {
-        type_list_values::const_iterator iterValues = extra_values.begin();
+        auto iterValues = extra_values.begin();
         for(const auto& item : extra_fields)
         {
           if(iterValues != extra_values.end()) {
diff --git a/glom/mode_data/datawidget/combochoiceswithtreemodel.cc 
b/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
index 654576c..b38a1b4 100644
--- a/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
+++ b/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
@@ -173,7 +173,7 @@ void ComboChoicesWithTreeModel::set_choices_with_second(const type_list_values_w
       if(layout_choice_extra && !extra_values.empty())
       {
         guint model_index = 1; //0 is for the main field.
-        type_list_values::const_iterator iterValues = extra_values.begin();
+        const auto iterValues = extra_values.begin();
         for(const auto& extra_field : extra_fields)
         {
           if(model_index >= columns_count)
diff --git a/glom/mode_data/datawidget/treemodel_db.cc b/glom/mode_data/datawidget/treemodel_db.cc
index aca75c0..fa928cf 100644
--- a/glom/mode_data/datawidget/treemodel_db.cc
+++ b/glom/mode_data/datawidget/treemodel_db.cc
@@ -170,7 +170,7 @@ DbTreeModelRow::DbValue DbTreeModelRow::get_value(DbTreeModel& model, int column
 {
   fill_values_if_necessary(model, row);
 
-  type_vec_values::const_iterator iterFind = m_db_values.find(column);
+  const auto iterFind = m_db_values.find(column);
   if(iterFind != m_db_values.end())
     return iterFind->second;
   else
@@ -890,7 +890,7 @@ void DbTreeModel::clear()
 
 bool DbTreeModel::row_was_removed(const type_datamodel_row_index& datamodel_row) const
 {
-  type_map_rows::const_iterator iterFind = m_map_rows.find(datamodel_row);
+  const auto iterFind = m_map_rows.find(datamodel_row);
   if(iterFind != m_map_rows.end())
     return iterFind->second.m_removed;
   else
@@ -948,7 +948,7 @@ Gtk::TreeModel::iterator DbTreeModel::get_placeholder_row()
       }
     }
 
-    type_map_rows::const_iterator iter_map = m_map_rows.find(row);
+    const auto iter_map = m_map_rows.find(row);
     if(iter_map != m_map_rows.end())
     {
       //std::cerr << G_STRFUNC << ": returning row=" << row << std::endl;
diff --git a/glom/mode_data/db_adddel/db_adddel.cc b/glom/mode_data/db_adddel/db_adddel.cc
index 3c05a38..9be073e 100644
--- a/glom/mode_data/db_adddel/db_adddel.cc
+++ b/glom/mode_data/db_adddel/db_adddel.cc
@@ -339,7 +339,7 @@ Gnome::Gda::Value DbAddDel::get_value(const Gtk::TreeModel::iterator& iter, cons
       type_list_indexes list_indexes = get_data_model_column_index(layout_item);
       if(!list_indexes.empty())
       {
-        type_list_indexes::const_iterator iter_begin = list_indexes.begin(); //Just get the first displayed 
instance of this field->
+        const auto iter_begin = list_indexes.begin(); //Just get the first displayed instance of this field->
 
         const guint col_real = *iter_begin + get_count_hidden_system_columns();
         treerow.get_value(col_real, value);
diff --git a/glom/mode_data/flowtablewithfields.cc b/glom/mode_data/flowtablewithfields.cc
index 52836e1..f3933a7 100644
--- a/glom/mode_data/flowtablewithfields.cc
+++ b/glom/mode_data/flowtablewithfields.cc
@@ -640,7 +640,7 @@ std::shared_ptr<LayoutGroup> FlowTableWithFields::get_layout_group()
 
 void FlowTableWithFields::remove_field(const Glib::ustring& id)
 {
-  for(type_listFields::iterator iter = m_listFields.begin(); iter != m_listFields.end(); ++iter)
+  for(auto iter = m_listFields.begin(); iter != m_listFields.end(); ++iter)
   {
     Info info = *iter;
     if(info.m_field->get_name() == id)
@@ -710,7 +710,7 @@ void FlowTableWithFields::set_other_field_value(const std::shared_ptr<const Layo
 Gnome::Gda::Value FlowTableWithFields::get_field_value(const std::shared_ptr<const LayoutItem_Field>& field) 
const
 {
   type_list_const_widgets list_widgets = get_field(field, true);
-  for(type_list_const_widgets::const_iterator iter = list_widgets.begin();
+  for(auto iter = list_widgets.begin();
     iter != list_widgets.end(); ++iter)
   {
     const auto datawidget = dynamic_cast<const DataWidget*>(*iter);
diff --git a/glom/mode_design/fields/box_db_table_definition.cc 
b/glom/mode_design/fields/box_db_table_definition.cc
index 6d493c4..e19232c 100644
--- a/glom/mode_design/fields/box_db_table_definition.cc
+++ b/glom/mode_design/fields/box_db_table_definition.cc
@@ -76,7 +76,7 @@ void Box_DB_Table_Definition::init()
 
   Field::type_map_type_names mapFieldTypes = Field::get_usable_type_names();
   AddDel::type_vec_strings vecTypes;
-  for(Field::type_map_type_names ::iterator iter = mapFieldTypes.begin(); iter != mapFieldTypes.end();++iter)
+  for(auto iter = mapFieldTypes.begin(); iter != mapFieldTypes.end();++iter)
   {
     const Glib::ustring& name = (*iter).second;
     vecTypes.push_back(name);
@@ -373,7 +373,7 @@ void Box_DB_Table_Definition::on_adddel_changed(const Gtk::TreeModel::iterator&
     m_Field_BeingEdited = constfield;
 
     //Get DB field info: (TODO: This might be unnecessary).
-    type_vec_fields::const_iterator iterFind = find_if_same_name(m_vecFields, strFieldNameBeingEdited);
+    const auto iterFind = find_if_same_name(m_vecFields, strFieldNameBeingEdited);
     if(iterFind == m_vecFields.end()) //If it was not found:
       std::cerr << G_STRFUNC << ": field not found: " << strFieldNameBeingEdited << std::endl;
     else
diff --git a/glom/mode_design/iso_codes.cc b/glom/mode_design/iso_codes.cc
index a91e43d..f5f49be 100644
--- a/glom/mode_design/iso_codes.cc
+++ b/glom/mode_design/iso_codes.cc
@@ -285,7 +285,7 @@ Glib::ustring get_locale_name(const Glib::ustring& locale_id)
 
   Glib::ustring result;
 
-  type_map_locales::const_iterator iter = map_locales.find(locale_id);
+  const auto iter = map_locales.find(locale_id);
   if(iter != map_locales.end())
     result = iter->second.m_name;
 
diff --git a/glom/mode_design/layout/treestore_layout.cc b/glom/mode_design/layout/treestore_layout.cc
index f2f53f9..1f01739 100644
--- a/glom/mode_design/layout/treestore_layout.cc
+++ b/glom/mode_design/layout/treestore_layout.cc
@@ -73,8 +73,8 @@ bool TreeStore_Layout::row_drop_possible_vfunc(const Gtk::TreeModel::Path& dest,
     //Get an iterator for the row at this path:
     //We must unconst this. This should not be necessary with a future version of gtkmm.
     auto unconstThis = const_cast<TreeStore_Layout*>(this); //TODO: Add a const version of get_iter to 
TreeModel:
-    const_iterator iter_dragged = unconstThis->get_iter(path_dragged_row);
-    //const_iterator iter_dragged = get_iter(path_dragged_row);
+    const auto iter_dragged = unconstThis->get_iter(path_dragged_row);
+    //const auto iter_dragged = get_iter(path_dragged_row);
 
     if(iter_dragged)
     {
@@ -95,8 +95,8 @@ bool TreeStore_Layout::row_drop_possible_vfunc(const Gtk::TreeModel::Path& dest,
     //Get an iterator for the row at the requested parent's path:
     //We must unconst this. This should not be necessary with a future version of gtkmm.
     auto unconstThis = const_cast<TreeStore_Layout*>(this); //TODO: Add a const version of get_iter to 
TreeModel:
-    const_iterator iter_dest_parent = unconstThis->get_iter(dest_parent);
-    //const_iterator iter_dest_parent = get_iter(dest);
+    const auto iter_dest_parent = unconstThis->get_iter(dest_parent);
+    //const auto iter_dest_parent = get_iter(dest);
     if(iter_dest_parent)
     {
       Gtk::TreeModel::Row row_parent = *iter_dest_parent;
@@ -116,7 +116,7 @@ bool TreeStore_Layout::row_drop_possible_vfunc(const Gtk::TreeModel::Path& dest,
 void TreeStore_Layout::fill_sequences()
 {
   guint sequence = 1;
-  for(iterator iter_children = children().begin(); iter_children != children().end(); ++iter_children)
+  for(auto iter_children = children().begin(); iter_children != children().end(); ++iter_children)
   {
     Gtk::TreeModel::Row row = *iter_children;
     row[m_columns.m_col_sequence] = sequence;
@@ -130,7 +130,7 @@ void TreeStore_Layout::fill_sequences()
 void TreeStore_Layout::fill_sequences(const iterator& iter)
 {
   guint sequence = 1;
-  for(iterator iter_children = iter->children().begin(); iter_children != iter->children().end(); 
++iter_children)
+  for(auto iter_children = iter->children().begin(); iter_children != iter->children().end(); 
++iter_children)
   {
     Gtk::TreeModel::Row row = *iter_children;
     row[m_columns.m_col_sequence] = sequence;
diff --git a/glom/mode_design/print_layouts/window_print_layout_edit.cc 
b/glom/mode_design/print_layouts/window_print_layout_edit.cc
index 33546ec..870557e 100644
--- a/glom/mode_design/print_layouts/window_print_layout_edit.cc
+++ b/glom/mode_design/print_layouts/window_print_layout_edit.cc
@@ -1403,7 +1403,7 @@ void Window_PrintLayout_Edit::on_canvas_selection_changed()
   m_connections_items_selected_moved.clear();
   
 
-  for(Canvas_PrintLayout::type_vec_items::const_iterator iter = items.begin();
+  for(auto iter = items.begin();
     iter != items.end(); ++iter)
   {
     Glib::RefPtr<CanvasLayoutItem> item = Glib::RefPtr<CanvasLayoutItem>::cast_dynamic(*iter);
diff --git a/glom/mode_design/relationships_overview/canvas_group_dbtable.cc 
b/glom/mode_design/relationships_overview/canvas_group_dbtable.cc
index c2810b9..8abd9c9 100644
--- a/glom/mode_design/relationships_overview/canvas_group_dbtable.cc
+++ b/glom/mode_design/relationships_overview/canvas_group_dbtable.cc
@@ -125,7 +125,7 @@ double CanvasGroupDbTable::get_table_width() const
 
 double CanvasGroupDbTable::get_field_y(const Glib::ustring& field_name) const
 {
-  type_map_fields_y::const_iterator iterFind = m_map_fields_y.find(field_name);
+  const auto iterFind = m_map_fields_y.find(field_name);
   if(iterFind !=  m_map_fields_y.end())
     return iterFind->second + 10.0; //Added an offset so that lines point approximately to the middle of the 
text.
   else
diff --git a/glom/mode_design/report_layout/treestore_report_layout.cc 
b/glom/mode_design/report_layout/treestore_report_layout.cc
index 12ad3aa..1ae7629 100644
--- a/glom/mode_design/report_layout/treestore_report_layout.cc
+++ b/glom/mode_design/report_layout/treestore_report_layout.cc
@@ -89,8 +89,8 @@ bool TreeStore_ReportLayout::row_drop_possible_vfunc(const Gtk::TreeModel::Path&
     //Get an iterator for the row at the requested parent's path:
     //We must unconst this. This should not be necessary with a future version of gtkmm.
     auto unconstThis = const_cast<TreeStore_ReportLayout*>(this); //TODO: Add a const version of get_iter to 
TreeModel:
-    const_iterator iter_dest_parent = unconstThis->get_iter(dest_parent);
-    //const_iterator iter_dest_parent = get_iter(dest);
+    const auto iter_dest_parent = unconstThis->get_iter(dest_parent);
+    //const auto iter_dest_parent = get_iter(dest);
     if(iter_dest_parent)
     {
       Gtk::TreeModel::Row row_parent = *iter_dest_parent;
@@ -107,7 +107,7 @@ bool TreeStore_ReportLayout::row_drop_possible_vfunc(const Gtk::TreeModel::Path&
 void TreeStore_ReportLayout::fill_sequences()
 {
   guint sequence = 1;
-  for(iterator iter_children = children().begin(); iter_children != children().end(); ++iter_children)
+  for(auto iter_children = children().begin(); iter_children != children().end(); ++iter_children)
   {
     Gtk::TreeModel::Row row = *iter_children;
     row[m_columns.m_col_sequence] = sequence;
@@ -121,7 +121,7 @@ void TreeStore_ReportLayout::fill_sequences()
 void TreeStore_ReportLayout::fill_sequences(const iterator& iter)
 {
   guint sequence = 1;
-  for(iterator iter_children = iter->children().begin(); iter_children != iter->children().end(); 
++iter_children)
+  for(auto iter_children = iter->children().begin(); iter_children != iter->children().end(); 
++iter_children)
   {
     Gtk::TreeModel::Row row = *iter_children;
     row[m_columns.m_col_sequence] = sequence;
diff --git a/glom/navigation/box_tables.cc b/glom/navigation/box_tables.cc
index 67e3beb..8708751 100644
--- a/glom/navigation/box_tables.cc
+++ b/glom/navigation/box_tables.cc
@@ -167,7 +167,7 @@ bool Box_Tables::fill_from_database()
       std::shared_ptr<TableInfo> table_info;
 
       //Check whether it should be hidden:
-      Document::type_listTableInfo::const_iterator iterFind = find_if_same_name(listTablesDocument, strName);
+      const auto iterFind = find_if_same_name(listTablesDocument, strName);
       if(iterFind != listTablesDocument.end())
       {
         table_info = *iterFind;
diff --git a/glom/print_layout/canvas_print_layout.cc b/glom/print_layout/canvas_print_layout.cc
index 0bfe62d..b6de0cb 100644
--- a/glom/print_layout/canvas_print_layout.cc
+++ b/glom/print_layout/canvas_print_layout.cc
@@ -99,14 +99,14 @@ void Canvas_PrintLayout::set_print_layout(const Glib::ustring& table_name, const
   remove_rules();
 
   const PrintLayout::type_vec_doubles h_rules = print_layout->get_horizontal_rules();
-  for(PrintLayout::type_vec_doubles::const_iterator iter = h_rules.begin();
+  for(auto iter = h_rules.begin();
     iter != h_rules.end(); ++iter)
   {
     add_horizontal_rule(*iter);
   }
 
   const PrintLayout::type_vec_doubles v_rules = print_layout->get_vertical_rules();
-  for(PrintLayout::type_vec_doubles::const_iterator iter = v_rules.begin();
+  for(auto iter = v_rules.begin();
     iter != v_rules.end(); ++iter)
   {
     add_vertical_rule(*iter);
@@ -840,7 +840,7 @@ void Canvas_PrintLayout::fill_with_data(const Glib::RefPtr<Goocanvas::Group>& ca
     std::shared_ptr<LayoutItem_Field> layoutitem_field = 
std::dynamic_pointer_cast<LayoutItem_Field>(layout_item);
     if(layoutitem_field)
     {
-      type_map_layout_fields_index::const_iterator iterFind = map_fields_index.find( 
layoutitem_field->get_layout_display_name() );
+      const auto iterFind = map_fields_index.find( layoutitem_field->get_layout_display_name() );
       if(iterFind != map_fields_index.end())
       {
         //Set the data from the database:
@@ -950,7 +950,7 @@ void Canvas_PrintLayout::fill_with_data_portal(const Glib::RefPtr<CanvasLayoutIt
   for(int row = 0; row < rows_count; ++row)
   {
     int db_col = 0;
-    LayoutGroup::type_list_items::const_iterator iter_child_layout_items = child_layout_items.begin();
+    auto iter_child_layout_items = child_layout_items.begin();
     for(int col = 0; col < cols_count; ++col)
     {
       //Glib::RefPtr<Goocanvas::Item> canvas_child = base_item->get_cell_child(row, col); //TODO: Add this 
to Goocanvas::Table.
diff --git a/tests/import/test_parsing.cc b/tests/import/test_parsing.cc
index 755c949..f359cb6 100644
--- a/tests/import/test_parsing.cc
+++ b/tests/import/test_parsing.cc
@@ -23,7 +23,7 @@ type_tokens& get_tokens_instance()
 
 void on_line_scanned(const std::vector<Glib::ustring>& row, guint /*line_number*/)
 {
-  for(std::vector<Glib::ustring>::const_iterator iter = row.begin();
+  for(auto iter = row.begin();
       iter != row.end();
       ++iter)
   {
@@ -36,7 +36,7 @@ void on_line_scanned(const std::vector<Glib::ustring>& row, guint /*line_number*
 /*
 void print_tokens()
 {
-  for(type_tokens::const_iterator iter = get_tokens_instance().begin();
+  for(auto iter = get_tokens_instance().begin();
       iter != get_tokens_instance().end();
       ++iter)
   {
@@ -65,7 +65,7 @@ bool check_tokens(const std::string& regex)
   if(get_tokens_instance().empty())
     return false;
 
-  for(type_tokens::const_iterator iter = get_tokens_instance().begin();
+  for(auto iter = get_tokens_instance().begin();
        iter != get_tokens_instance().end();
        ++iter)
   {
diff --git a/tests/import/test_signals.cc b/tests/import/test_signals.cc
index d56652c..116b55c 100644
--- a/tests/import/test_signals.cc
+++ b/tests/import/test_signals.cc
@@ -109,7 +109,7 @@ int main()
     const char* raw = "\0xc0\0x00\n";
     ImportTests::set_parser_contents(parser, raw);
 
-    for (type_encodings::const_iterator iter = encodings.begin();
+    for (auto iter = encodings.begin();
          iter != encodings.end();
          ++iter)
     {
@@ -129,7 +129,7 @@ int main()
     }
 
 
-    const const bool passed = (2 == get_encoding_error_count_instance() &&
+    const bool passed = (2 == get_encoding_error_count_instance() &&
                    0 == get_line_scanned_count_instance());
 
     if(!ImportTests::check("test_wrong_encoding", passed, report))
diff --git a/tests/test_document_load.cc b/tests/test_document_load.cc
index e1881c6..cb8a4b1 100644
--- a/tests/test_document_load.cc
+++ b/tests/test_document_load.cc
@@ -56,7 +56,7 @@ bool contains_value(const T_Container& container, const Glib::ustring& name)
 
 static bool get_group_named(const Glom::Document::type_list_groups& container, const Glib::ustring& name, 
Glom::GroupInfo& group_info)
 {
-  Glom::Document::type_list_groups::const_iterator iter =
+  const auto iter =
     Glom::Utils::find_if(container,
       [&name] (const Glom::GroupInfo& info)
       {
@@ -342,7 +342,7 @@ int main()
 
   Glom::GroupInfo group_info_accounts;
   g_assert(get_group_named(user_groups, "props_department", group_info_accounts));
-  Glom::GroupInfo::type_map_table_privileges::const_iterator iterFind =
+  const auto iterFind =
     group_info_accounts.m_map_privileges.find("scenes");
   const bool privileges_found = (iterFind != group_info_accounts.m_map_privileges.end());
   g_assert(privileges_found);
diff --git a/tests/test_document_load_translations.cc b/tests/test_document_load_translations.cc
index 875bd26..eac3a3d 100644
--- a/tests/test_document_load_translations.cc
+++ b/tests/test_document_load_translations.cc
@@ -43,7 +43,7 @@ typename T_Container::value_type get_titled(const T_Container& container, const
   typedef typename T_Container::value_type type_sharedptr;
   type_sharedptr result;
 
-  typename T_Container::const_iterator iter =
+  const auto iter =
     Glom::Utils::find_if(container,
       [&title] (const typename T_Container::value_type& element)
       {


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