[glom] C++11: More use of auto.



commit e244477d4f4fd2c171a7fa216528a387b26fa03e
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Mar 18 21:08:19 2016 +0100

    C++11: More use of auto.

 glom/appwindow.cc                                  |    2 +-
 glom/base_db.cc                                    |    2 +-
 glom/base_db_table_data.cc                         |    4 +-
 glom/frame_glom.cc                                 |    2 +-
 glom/libglom/data_structure/field.cc               |    2 +-
 glom/libglom/db_utils.cc                           |    6 ++--
 glom/libglom/document/document.cc                  |   12 +++++-----
 glom/libglom/privs.cc                              |    6 ++--
 glom/libglom/report_builder.cc                     |    2 +-
 glom/mode_data/box_data_calendar_related.cc        |    6 ++--
 glom/mode_data/box_data_details.cc                 |    2 +-
 glom/mode_data/box_data_list_related.cc            |    1 -
 .../datawidget/combochoiceswithtreemodel.cc        |    4 +-
 glom/mode_data/datawidget/treemodel_db.cc          |   24 ++++++++++----------
 glom/mode_data/db_adddel/db_adddel.cc              |    4 +-
 glom/mode_data/flowtablewithfields.cc              |    6 ++--
 glom/mode_design/box_db_table_relationships.cc     |    4 +-
 glom/mode_design/layout/dialog_choose_field.cc     |    2 +-
 glom/mode_design/layout/dialog_layout_details.cc   |    2 +-
 glom/mode_design/layout/dialog_layout_export.cc    |    2 +-
 .../layout/dialog_layout_list_related.cc           |    2 +-
 .../report_layout/dialog_layout_report.cc          |    3 +-
 glom/mode_design/users/dialog_users_list.cc        |    4 +-
 glom/navigation/box_tables.cc                      |    2 +-
 glom/print_layout/canvas_print_layout.cc           |    2 +-
 glom/test_pyembed.cc                               |    3 +-
 glom/utility_widgets/flowtable.cc                  |    3 +-
 glom/utils_ui.cc                                   |    2 +-
 ...est_selfhosting_new_then_export_with_big_num.cc |    2 +-
 29 files changed, 57 insertions(+), 61 deletions(-)
---
diff --git a/glom/appwindow.cc b/glom/appwindow.cc
index e8010ae..ee174b7 100644
--- a/glom/appwindow.cc
+++ b/glom/appwindow.cc
@@ -2039,7 +2039,7 @@ void AppWindow::on_menu_file_save_as_example()
       {
         const auto table_name = item->get_name();
 
-        //const type_vec_fields vec_fields = document->get_table_fields(table_name);
+        //const auto vec_fields = document->get_table_fields(table_name);
 
         //export_data_to_*() needs a type_list_layout_groups;
         Document::type_list_layout_groups sequence = document->get_data_layout_groups_default("list", 
table_name, "" /* layout_platform */);
diff --git a/glom/base_db.cc b/glom/base_db.cc
index eee62a5..7e39cec 100644
--- a/glom/base_db.cc
+++ b/glom/base_db.cc
@@ -1277,7 +1277,7 @@ bool Base_DB::disable_user(const Glib::ustring& user)
   if(user.empty())
     return false;
 
-  type_vec_strings vecGroups = Privs::get_groups_of_user(user);
+  const auto vecGroups = Privs::get_groups_of_user(user);
   for(const auto& group : vecGroups)
   {
     DbUtils::remove_user_from_group(user, group);
diff --git a/glom/base_db_table_data.cc b/glom/base_db_table_data.cc
index 74798c1..5c60bfe 100644
--- a/glom/base_db_table_data.cc
+++ b/glom/base_db_table_data.cc
@@ -64,7 +64,7 @@ bool Base_DB_Table_Data::record_new(bool use_entered_data, const Gnome::Gda::Val
 
   const Glib::ustring primary_key_name = fieldPrimaryKey->get_name();
 
-  type_vecConstLayoutFields fieldsToAdd = m_FieldsShown;
+  auto fieldsToAdd = m_FieldsShown;
   if(m_TableFields.empty())
     m_TableFields = DbUtils::get_fields_for_table(document, m_table_name);
 
@@ -490,7 +490,7 @@ void Base_DB_Table_Data::refresh_related_fields(const LayoutFieldInRecord& field
   //Get values for lookup fields, if this field triggers those relationships:
   //TODO_performance: There is a LOT of iterating and copying here.
   //const Glib::ustring strFieldName = field_in_record_changed.m_field->get_name();
-  type_vecConstLayoutFields fieldsToGet = get_related_fields(field_in_record_changed.m_field);
+  const auto fieldsToGet = get_related_fields(field_in_record_changed.m_field);
 
   if(!fieldsToGet.empty())
   {
diff --git a/glom/frame_glom.cc b/glom/frame_glom.cc
index a8d33d9..f309693 100644
--- a/glom/frame_glom.cc
+++ b/glom/frame_glom.cc
@@ -1305,7 +1305,7 @@ void Frame_Glom::update_table_in_document_from_database()
 
     //Get the fields information from the document.
     //and add to, or update Document's list of fields:
-    type_vec_fields fieldsDocument = pDoc->get_table_fields(m_table_name);
+    auto fieldsDocument = pDoc->get_table_fields(m_table_name);
 
     for(const auto& field_database : fieldsDatabase)
     {
diff --git a/glom/libglom/data_structure/field.cc b/glom/libglom/data_structure/field.cc
index 9d95ff4..ec04ed1 100644
--- a/glom/libglom/data_structure/field.cc
+++ b/glom/libglom/data_structure/field.cc
@@ -762,7 +762,7 @@ Field::type_map_type_names Field::get_usable_type_names()
 {
   init_map();
 
-  type_map_type_names result =  m_map_type_names_ui;
+  auto result =  m_map_type_names_ui;
 
   //Remove INVALID, because it's not something that a user can use for a field type.
   auto iter = result.find(glom_field_type::INVALID);
diff --git a/glom/libglom/db_utils.cc b/glom/libglom/db_utils.cc
index a6808df..756ae2e 100644
--- a/glom/libglom/db_utils.cc
+++ b/glom/libglom/db_utils.cc
@@ -984,7 +984,7 @@ type_vec_fields get_fields_for_table(const std::shared_ptr<const Document>& docu
     return type_vec_fields(); //This should never happen.
   }
 
-  type_vec_fields result = document->get_table_fields(table_name);
+  const auto result = document->get_table_fields(table_name);
 
   //Look at each field in the database:
   /*
@@ -1042,7 +1042,7 @@ std::shared_ptr<Field> get_fields_for_table_one_field(const std::shared_ptr<cons
   if(field_name.empty() || table_name.empty())
     return result;
 
-  type_vec_fields fields = get_fields_for_table(document, table_name); //TODO_Performance
+  const auto fields = get_fields_for_table(document, table_name); //TODO_Performance
   auto iter = find_if_same_name(fields, field_name);
   if(iter != fields.end()) //TODO: Handle error?
   {
@@ -2194,7 +2194,7 @@ bool add_group(const std::shared_ptr<const Document>& document, const Glib::ustr
   priv.m_view = true;
   priv.m_edit = true;
 
-  const type_vec_strings table_list =
+  const auto table_list =
     get_table_names_from_database(true /* plus system prefs */);
   for(const auto& table : table_list)
   {
diff --git a/glom/libglom/document/document.cc b/glom/libglom/document/document.cc
index 83c1011..ef5cbfb 100644
--- a/glom/libglom/document/document.cc
+++ b/glom/libglom/document/document.cc
@@ -939,7 +939,7 @@ void Document::change_field_name(const Glib::ustring& table_name, const Glib::us
   if(info)
   {
     //Fields:
-    type_vec_fields& vecFields = info->m_fields;
+    auto& vecFields = info->m_fields;
     auto iterFind = find_if_same_name(vecFields, strFieldNameOld);
     if(iterFind != vecFields.end()) //If it was found:
     {
@@ -1082,7 +1082,7 @@ void Document::change_relationship_name(const Glib::ustring& table_name, const G
   const auto doctableinfo = get_table_info(table_name);
   if(doctableinfo)
   {
-    type_vec_relationships relationships = doctableinfo->m_relationships;
+    const auto relationships = doctableinfo->m_relationships;
       
     //Change the relationship name:
     auto iterRelFind = find_if_same_name(relationships, name);
@@ -4399,7 +4399,7 @@ Document::type_list_translatables Document::get_translatable_items()
     }
 
     //The table's relationships:
-    type_vec_relationships relationships = get_relationships(table_name);
+    const auto relationships = get_relationships(table_name);
     translatable_items_append_with_hint(result, relationships, hint);
 
     //The table's report titles:
@@ -4413,7 +4413,7 @@ Document::type_list_translatables Document::get_translatable_items()
       
       //Translatable report items:
       const auto this_hint = hint + ", Parent Report: " + report->get_name();
-      type_list_translatables list_layout_items = get_translatable_report_items(table_name, report_name, 
this_hint);
+      const auto list_layout_items = get_translatable_report_items(table_name, report_name, this_hint);
       add_to_translatable_list(result, list_layout_items);
     }
 
@@ -4428,12 +4428,12 @@ Document::type_list_translatables Document::get_translatable_items()
       
       //Translatable print layout items:
       const auto this_hint = hint + ", Print Layout: " + print_layout->get_name();
-      type_list_translatables list_layout_items = get_translatable_print_layout_items(table_name, 
print_layout_name, this_hint);
+      const auto list_layout_items = get_translatable_print_layout_items(table_name, print_layout_name, 
this_hint);
       add_to_translatable_list(result, list_layout_items);
     }
 
     //The table's translatable layout items:
-    type_list_translatables list_layout_items = get_translatable_layout_items(table_name, hint);
+    const auto list_layout_items = get_translatable_layout_items(table_name, hint);
     add_to_translatable_list(result, list_layout_items);
   } //for
 
diff --git a/glom/libglom/privs.cc b/glom/libglom/privs.cc
index a4ebaca..27f1edb 100644
--- a/glom/libglom/privs.cc
+++ b/glom/libglom/privs.cc
@@ -156,7 +156,7 @@ Privs::type_vec_strings Privs::get_database_users(const Glib::ustring& group_nam
         if(!value_group.is_null())
           group_list = value_group.get_string();
 
-        type_vec_strings vecUserIds = pg_list_separate(group_list);
+        const auto vecUserIds = pg_list_separate(group_list);
         for(const auto& userId: vecUserIds)
         {
           //TODO_Performance: Can we do this in one SQL SELECT?
@@ -397,7 +397,7 @@ Privs::type_vec_strings Privs::get_groups_of_user(const Glib::ustring& user)
   type_vec_strings result;
 
   //Look at each group:
-  type_vec_strings groups = get_database_groups();
+  const auto groups = get_database_groups();
   for(const auto& group : groups)
   {
     //See whether the user is in this group:
@@ -475,7 +475,7 @@ Privileges Privs::get_current_privs(const Glib::ustring& table_name)
   if(sharedconnection && 
sharedconnection->get_gda_connection()->supports_feature(Gnome::Gda::CONNECTION_FEATURE_USERS))
   {
     //Get the "true" rights for any groups that the user is in:
-    const type_vec_strings groups = get_groups_of_user(current_user);
+    const auto groups = get_groups_of_user(current_user);
     for(const auto& group : groups)
     {
       const auto privs = get_table_privileges(group, table_name);
diff --git a/glom/libglom/report_builder.cc b/glom/libglom/report_builder.cc
index f999f5a..8e971b9 100644
--- a/glom/libglom/report_builder.cc
+++ b/glom/libglom/report_builder.cc
@@ -274,7 +274,7 @@ bool ReportBuilder::report_build_groupby(const FoundSet& found_set_parent, xmlpp
         {
           auto nodeSecondaryFields = nodeGroupBy->add_child_element("secondary_fields");
 
-          type_vecLayoutItems itemsToGet =
+          const auto itemsToGet =
             copy_with_cloned_items(group_by->get_secondary_fields()->m_list_items);
 
           if(!itemsToGet.empty())
diff --git a/glom/mode_data/box_data_calendar_related.cc b/glom/mode_data/box_data_calendar_related.cc
index 4d586dd..eab2314 100644
--- a/glom/mode_data/box_data_calendar_related.cc
+++ b/glom/mode_data/box_data_calendar_related.cc
@@ -254,7 +254,7 @@ void Box_Data_Calendar_Related::clear_cached_database_values()
 {
   for(const auto& the_pair : m_map_values)
   {
-    type_list_vectors vec = the_pair.second;
+    const auto& vec = the_pair.second;
     for(const auto& pValues : vec)
     {
       delete pValues;
@@ -330,7 +330,7 @@ void Box_Data_Calendar_Related::on_record_added(const Gnome::Gda::Value& primary
 
 Box_Data_Calendar_Related::type_vecConstLayoutFields Box_Data_Calendar_Related::get_fields_to_show() const
 {
-  type_vecConstLayoutFields layout_fields = Box_Data_Portal::get_fields_to_show();
+  auto layout_fields = Box_Data_Portal::get_fields_to_show();
 
   const auto portal = get_portal();
   const auto derived_portal = std::dynamic_pointer_cast<const LayoutItem_CalendarPortal>(portal);
@@ -447,7 +447,7 @@ Glib::ustring Box_Data_Calendar_Related::on_calendar_details(guint year, guint m
   Glib::ustring result;
 
   //Look at each row for this date:
-  const type_list_vectors& rows = iter_find->second;
+  const auto& rows = iter_find->second;
   for(const auto& pRow : rows)
   {
     if(!pRow)
diff --git a/glom/mode_data/box_data_details.cc b/glom/mode_data/box_data_details.cc
index 05dda07..701ef40 100644
--- a/glom/mode_data/box_data_details.cc
+++ b/glom/mode_data/box_data_details.cc
@@ -286,7 +286,7 @@ bool Box_Data_Details::fill_from_database()
     bResult = Box_Data::fill_from_database();
 
     m_FieldsShown = get_fields_to_show();
-    type_vecConstLayoutFields fieldsToGet = m_FieldsShown;
+    auto fieldsToGet = m_FieldsShown;
 
     if(!fieldsToGet.empty())
     {
diff --git a/glom/mode_data/box_data_list_related.cc b/glom/mode_data/box_data_list_related.cc
index fc82ab9..ac4cf4c 100644
--- a/glom/mode_data/box_data_list_related.cc
+++ b/glom/mode_data/box_data_list_related.cc
@@ -97,7 +97,6 @@ bool Box_Data_List_Related::init_db_details(const Glib::ustring& parent_table, b
   if(show_title)
   {
     Glib::ustring title;
-    const auto portal = get_portal();
     if(portal)
       title = item_get_title(portal);
 
diff --git a/glom/mode_data/datawidget/combochoiceswithtreemodel.cc 
b/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
index 481438e..ffd7571 100644
--- a/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
+++ b/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
@@ -109,7 +109,7 @@ void ComboChoicesWithTreeModel::set_choices_with_second(const type_list_values_w
     type_list_values_with_second::const_iterator iter= list_values.begin();
     if(iter != list_values.end())
     {
-      const type_list_values& second = iter->second;
+      const auto& second = iter->second;
       columns_count += second.size();
     }
   }
@@ -147,7 +147,7 @@ void ComboChoicesWithTreeModel::set_choices_with_second(const type_list_values_w
         Conversions::get_text_for_gda_value(layout_choice_first->get_glom_type(), the_pair->first, 
layout_choice_first->get_formatting_used().m_numeric_format);
       row.set_value(0, text);
 
-      const type_list_values extra_values = the_pair->second;
+      const auto& extra_values = the_pair->second;
       if(layout_choice_extra && !extra_values.empty())
       {
         guint model_index = 1; //0 is for the main field.
diff --git a/glom/mode_data/datawidget/treemodel_db.cc b/glom/mode_data/datawidget/treemodel_db.cc
index 299f655..83b5135 100644
--- a/glom/mode_data/datawidget/treemodel_db.cc
+++ b/glom/mode_data/datawidget/treemodel_db.cc
@@ -436,14 +436,14 @@ void DbTreeModel::get_value_vfunc(const TreeModel::iterator& iter, int column, G
       //Glib::Value< DbValue > value_specific;
       //value_specific.init( Glib::Value< DbValue >::value_type() ); //TODO: Is there any way to avoid this 
step?
 
-      type_datamodel_row_index datamodel_row = get_datamodel_row_index_from_tree_row_iter(iter);
+      const auto datamodel_row = get_datamodel_row_index_from_tree_row_iter(iter);
       //g_warning("DbTreeModel::get_value_vfunc(): datamodel_row=%d, get_internal_rows_count=%d", 
datamodel_row, get_internal_rows_count());
       const unsigned int internal_rows_count = get_internal_rows_count();
       if( datamodel_row < internal_rows_count) //!= m_rows.end())
       {
          //std::cout << "  debug: DbTreeModel::get_value_vfunc() 1.2\n";
 
-        //const typeRow& dataRow = *datamodel_row;
+        //const auto& dataRow = *datamodel_row;
 
         //g_warning("DbTreeModel::get_value_vfunc 1: column=%d, row=%d", column, datamodel_row);
 
@@ -515,7 +515,7 @@ bool DbTreeModel::iter_next_vfunc(const iterator& iter, iterator& iter_next) con
   if( check_treeiter_validity(iter) )
   {
     //Get the current row:
-    type_datamodel_row_index datamodel_row = get_datamodel_row_index_from_tree_row_iter(iter);
+    auto datamodel_row = get_datamodel_row_index_from_tree_row_iter(iter);
     //std::cout << "debug: " << G_STRFUNC << ":" << datamodel_row << std::endl;
 
     //Make the iter_next GtkTreeIter represent the next row:
@@ -623,7 +623,7 @@ bool DbTreeModel::iter_parent_vfunc(const iterator& child, iterator& iter) const
 
 Gtk::TreeModel::Path DbTreeModel::get_path_vfunc(const iterator& iter) const
 {
-  type_datamodel_row_index datamodel_row = get_datamodel_row_index_from_tree_row_iter(iter);
+  const auto datamodel_row = get_datamodel_row_index_from_tree_row_iter(iter);
 
   //TODO_Performance:
   //Get the number of non-removed items before this iter, because the path index doesn't care about removed 
internal stuff.
@@ -730,7 +730,7 @@ DbTreeModel::iterator DbTreeModel::append()
   //m_rows.resize(existing_size + 1);
 
   //Get aniterator to the last element:
-  type_datamodel_row_index datamodel_row = get_internal_rows_count();
+  const auto datamodel_row = get_internal_rows_count();
   //std::cerr << G_STRFUNC << ": new row number=" << datamodel_row << std::endl;
   ++m_count_extra_rows; //So that create_iterator() can succeed.
 
@@ -766,7 +766,7 @@ void DbTreeModel::set_value_impl(const iterator& row, int column, const Glib::Va
   if(iter_is_valid(row))
   {
     //Get the index from the user_data:
-    type_datamodel_row_index datamodel_row = get_datamodel_row_index_from_tree_row_iter(row);
+    const auto datamodel_row = get_datamodel_row_index_from_tree_row_iter(row);
 
     //TODO: Check column against get_n_columns() too, though it could hurt performance.
 
@@ -806,7 +806,7 @@ DbTreeModel::iterator DbTreeModel::erase(const iterator& iter)
   if(iter_is_valid(iter))
   {
     //Get the index from the user_data:
-    type_datamodel_row_index datamodel_row = get_datamodel_row_index_from_tree_row_iter(iter);
+    auto datamodel_row = get_datamodel_row_index_from_tree_row_iter(iter);
 
     //Remove the row.
     Gtk::TreeModel::Path path_deleted = get_path(iter);
@@ -836,7 +836,7 @@ void DbTreeModel::set_key_value(const TreeModel::iterator& iter, const DbValue&
   //g_warning("DbTreeModel::set_is_placeholder(): val=%d", val);
   if(check_treeiter_validity(iter))
   {
-    type_datamodel_row_index datamodel_row = get_datamodel_row_index_from_tree_row_iter(iter);
+    const auto datamodel_row = get_datamodel_row_index_from_tree_row_iter(iter);
     m_map_rows[datamodel_row].m_key = value;
   }
 }
@@ -845,7 +845,7 @@ DbTreeModel::DbValue DbTreeModel::get_key_value(const TreeModel::iterator& iter)
 {
   if(check_treeiter_validity(iter))
   {
-    type_datamodel_row_index datamodel_row = get_datamodel_row_index_from_tree_row_iter(iter);
+    const auto datamodel_row = get_datamodel_row_index_from_tree_row_iter(iter);
     auto iterFind = m_map_rows.find(datamodel_row);
     if(iterFind != m_map_rows.end())
       return iterFind->second.m_key;
@@ -865,7 +865,7 @@ bool DbTreeModel::get_is_placeholder(const TreeModel::iterator& iter) const
   //g_warning("DbTreeModel::g et_is_placeholder()");
   if(check_treeiter_validity(iter))
   {
-    type_datamodel_row_index datamodel_row = get_datamodel_row_index_from_tree_row_iter(iter);
+    const auto datamodel_row = get_datamodel_row_index_from_tree_row_iter(iter);
     return (datamodel_row == ((type_datamodel_row_index)get_internal_rows_count() -1));
   }
 
@@ -905,7 +905,7 @@ Gtk::TreeModel::iterator DbTreeModel::get_last_row()
   const int rows_count = get_internal_rows_count();
   if(rows_count)
   {
-    type_datamodel_row_index row = rows_count - 1;
+    auto row = rows_count - 1;
     
     if(row > 0) //This should always be true, because there is always a placeholder.
       --row; //Ignore the placeholder.
@@ -934,7 +934,7 @@ Gtk::TreeModel::iterator DbTreeModel::get_placeholder_row()
   const int rows_count = get_internal_rows_count();
   if(rows_count)
   {
-    type_datamodel_row_index row = rows_count - 1;
+    auto row = rows_count - 1;
 
     //Step backwards until we find one that is not removed:
     while((m_map_rows.find(row) != m_map_rows.end()) && m_map_rows[row].m_removed)
diff --git a/glom/mode_data/db_adddel/db_adddel.cc b/glom/mode_data/db_adddel/db_adddel.cc
index a61dfe0..4abc5a6 100644
--- a/glom/mode_data/db_adddel/db_adddel.cc
+++ b/glom/mode_data/db_adddel/db_adddel.cc
@@ -336,7 +336,7 @@ Gnome::Gda::Value DbAddDel::get_value(const Gtk::TreeModel::iterator& iter, cons
 
     if(treerow)
     {
-      type_list_indexes list_indexes = get_data_model_column_index(layout_item);
+      const auto list_indexes = get_data_model_column_index(layout_item);
       if(!list_indexes.empty())
       {
         const auto iter_begin = list_indexes.begin(); //Just get the first displayed instance of this field->
@@ -441,7 +441,7 @@ bool DbAddDel::select_item(const Gtk::TreeModel::iterator& iter, const std::shar
   {
     //Get the model column:
     guint treemodel_col = 0;
-    type_list_indexes list_indexes = get_column_index(layout_item);
+    const auto list_indexes = get_column_index(layout_item);
     if(list_indexes.empty())
       return false;
     else
diff --git a/glom/mode_data/flowtablewithfields.cc b/glom/mode_data/flowtablewithfields.cc
index 68cd3da..bd78c93 100644
--- a/glom/mode_data/flowtablewithfields.cc
+++ b/glom/mode_data/flowtablewithfields.cc
@@ -717,7 +717,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
 {
-  const type_list_const_widgets list_widgets = get_field(field, true);
+  const auto list_widgets = get_field(field, true);
   for(const auto& list_widget : list_widgets)
   {
     const auto datawidget = dynamic_cast<const DataWidget*>(list_widget);
@@ -803,7 +803,7 @@ FlowTableWithFields::type_portals FlowTableWithFields::get_portals(const std::sh
   {
     if(subtable)
     {
-      type_portals sub_list = subtable->get_portals(from_key);
+      const auto sub_list = subtable->get_portals(from_key);
       if(!sub_list.empty())
       {
         //Add to the main result:
@@ -927,7 +927,7 @@ FlowTableWithFields::type_list_widgets FlowTableWithFields::get_field(const std:
   {
     if(subtable)
     {
-      type_list_widgets sub_list = subtable->get_field(layout_item, include_item);
+      const auto sub_list = subtable->get_field(layout_item, include_item);
       if(!sub_list.empty())
       {
         //Add to the main result:
diff --git a/glom/mode_design/box_db_table_relationships.cc b/glom/mode_design/box_db_table_relationships.cc
index 900d1cd..606d46a 100644
--- a/glom/mode_design/box_db_table_relationships.cc
+++ b/glom/mode_design/box_db_table_relationships.cc
@@ -93,7 +93,7 @@ bool Box_DB_Table_Relationships::fill_from_database()
     m_AddDel.set_column_choices(m_colFromField, util_vecStrings_from_Fields(
       DbUtils::get_fields_for_table(document, m_table_name)));
 
-    type_vec_strings vecTableNames = document->get_table_names(false /* ignore_system_tables */);
+    const auto vecTableNames = document->get_table_names(false /* ignore_system_tables */);
     type_vec_strings vecTableNames_ustring(vecTableNames.begin(), vecTableNames.end());
     m_AddDel.set_column_choices(m_colToTable, vecTableNames_ustring);
 
@@ -246,7 +246,7 @@ void Box_DB_Table_Relationships::on_adddel_user_activated(const Gtk::TreeModel::
         auto connection = sharedconnection->get_gda_connection();
 
         auto document = get_document();
-        type_vec_strings vecFields = util_vecStrings_from_Fields(DbUtils::get_fields_for_table(document, 
table_name));
+        const auto vecFields = util_vecStrings_from_Fields(DbUtils::get_fields_for_table(document, 
table_name));
 
         //This would cause a lot of tedious re-filling:
         //m_AddDel.set_column_choices(m_colToField, vecFields);
diff --git a/glom/mode_design/layout/dialog_choose_field.cc b/glom/mode_design/layout/dialog_choose_field.cc
index c822cbc..a6b432c 100644
--- a/glom/mode_design/layout/dialog_choose_field.cc
+++ b/glom/mode_design/layout/dialog_choose_field.cc
@@ -198,7 +198,7 @@ std::shared_ptr<LayoutItem_Field> Dialog_ChooseField::get_field_chosen() const
 {
   std::shared_ptr<LayoutItem_Field> field;
 
-  type_list_field_items list_fields = get_fields_chosen();
+  const auto list_fields = get_fields_chosen();
   if(!(list_fields.empty()))
   {
     field = *(list_fields.begin()); 
diff --git a/glom/mode_design/layout/dialog_layout_details.cc 
b/glom/mode_design/layout/dialog_layout_details.cc
index 6ee034b..20ae49e 100644
--- a/glom/mode_design/layout/dialog_layout_details.cc
+++ b/glom/mode_design/layout/dialog_layout_details.cc
@@ -521,7 +521,7 @@ void Dialog_Layout_Details::on_button_down()
 
 void Dialog_Layout_Details::on_button_add_field()
 {
-  type_list_field_items fields_list = offer_field_list(m_table_name, this);
+  const auto fields_list = offer_field_list(m_table_name, this);
   for(const auto& layout_item : fields_list)
   {
     if(!layout_item)
diff --git a/glom/mode_design/layout/dialog_layout_export.cc b/glom/mode_design/layout/dialog_layout_export.cc
index c8c6fe6..c4afea1 100644
--- a/glom/mode_design/layout/dialog_layout_export.cc
+++ b/glom/mode_design/layout/dialog_layout_export.cc
@@ -250,7 +250,7 @@ void Dialog_Layout_Export::on_treeview_fields_selection_changed()
 void Dialog_Layout_Export::on_button_add_field()
 {
   //Get the chosen fields:
-  type_list_field_items fields_list = offer_field_list(m_table_name, this);
+  const auto fields_list = offer_field_list(m_table_name, this);
   for(const auto& field : fields_list) 
   {
     if(!field)
diff --git a/glom/mode_design/layout/dialog_layout_list_related.cc 
b/glom/mode_design/layout/dialog_layout_list_related.cc
index 5f88726..a0b5648 100644
--- a/glom/mode_design/layout/dialog_layout_list_related.cc
+++ b/glom/mode_design/layout/dialog_layout_list_related.cc
@@ -491,7 +491,7 @@ void Dialog_Layout_List_Related::on_button_add_field()
   //std::cout << "debug: related relationship=" << 
glom_get_sharedptr_name(m_portal->get_related_relationship()) << std::endl;
   //std::cout << "debug table used =" << m_portal->get_table_used(m_table_name) << std::endl;
 
-  type_list_field_items fields_list = offer_field_list(m_portal->get_table_used(m_table_name), this);
+  const auto fields_list = offer_field_list(m_portal->get_table_used(m_table_name), this);
   for(const auto& field : fields_list)
   {
     if(!field)
diff --git a/glom/mode_design/report_layout/dialog_layout_report.cc 
b/glom/mode_design/report_layout/dialog_layout_report.cc
index 6785eab..09537bc 100644
--- a/glom/mode_design/report_layout/dialog_layout_report.cc
+++ b/glom/mode_design/report_layout/dialog_layout_report.cc
@@ -723,8 +723,7 @@ Gtk::TreeModel::iterator Dialog_Layout_Report::get_selected_group_parent() const
   if(!treeview)
     return parent;
 
-  Glib::RefPtr<const type_model> model = get_selected_model();
-
+  auto model = get_selected_model();
 
   auto refTreeSelection = treeview->get_selection();
   if(refTreeSelection)
diff --git a/glom/mode_design/users/dialog_users_list.cc b/glom/mode_design/users/dialog_users_list.cc
index a1c7f44..7494738 100644
--- a/glom/mode_design/users/dialog_users_list.cc
+++ b/glom/mode_design/users/dialog_users_list.cc
@@ -292,7 +292,7 @@ void Dialog_UsersList::on_button_user_edit()
       //Fill groups:
       dialog->m_combo_group->remove_all();
 
-      type_vec_strings group_list = Privs::get_database_groups();
+      const auto group_list = Privs::get_database_groups();
       for(const auto& group : group_list)
       {
          dialog->m_combo_group->append(group);
@@ -387,7 +387,7 @@ void Dialog_UsersList::set_group(const Glib::ustring& group_name)
   //Fill the list of groups:
   m_combo_group->remove_all();
 
-  type_vec_strings group_list = Privs::get_database_groups();
+  const auto group_list = Privs::get_database_groups();
   for(const auto& group : group_list)
   {
     m_combo_group->append(group);
diff --git a/glom/navigation/box_tables.cc b/glom/navigation/box_tables.cc
index 0504ebf..d97410e 100644
--- a/glom/navigation/box_tables.cc
+++ b/glom/navigation/box_tables.cc
@@ -257,7 +257,7 @@ void Box_Tables::on_adddel_Add(const Gtk::TreeModel::iterator& row)
       //Save the field information directly into the database, because we cannot get all the correct 
information from the database.
       //Otherwise some information would be forgotten:
 
-      type_vec_fields fields = document->get_table_fields(table_name);
+      const auto fields = document->get_table_fields(table_name);
       document->set_table_fields(table_name, fields);
 
       //TODO: Just let create_table_with_default_fields() update the document, and then reload the row.
diff --git a/glom/print_layout/canvas_print_layout.cc b/glom/print_layout/canvas_print_layout.cc
index d36d694..ea1e75b 100644
--- a/glom/print_layout/canvas_print_layout.cc
+++ b/glom/print_layout/canvas_print_layout.cc
@@ -900,7 +900,7 @@ void Canvas_PrintLayout::fill_with_data_portal(const Glib::RefPtr<CanvasLayoutIt
   const LayoutGroup::type_list_items child_layout_items = portal->get_items();
 
   //Build and run the SQL query for this portal:
-  const type_vecConstLayoutFields fields_shown = get_portal_fields_to_show(portal);
+  const auto fields_shown = get_portal_fields_to_show(portal);
 
   FoundSet found_set;
   found_set.m_table_name = portal->get_table_used(Glib::ustring() /* parent table_name, not used. */);
diff --git a/glom/test_pyembed.cc b/glom/test_pyembed.cc
index a61dffd..977b895 100644
--- a/glom/test_pyembed.cc
+++ b/glom/test_pyembed.cc
@@ -31,8 +31,7 @@ void evaluate_function_implementation(const Glib::ustring& func_impl)
 {
   Glib::ustring func_def;
 
-  typedef std::list<Glib::ustring> type_listStrings;
-  type_listStrings listStrings = ustring_tokenize(func_impl, "\n", -1);
+  const auto listStrings = ustring_tokenize(func_impl, "\n", -1);
   for(const auto& item : listStrings)
   {
     func_def += "  " + item + '\n';
diff --git a/glom/utility_widgets/flowtable.cc b/glom/utility_widgets/flowtable.cc
index 0e8dba1..0f4ab85 100644
--- a/glom/utility_widgets/flowtable.cc
+++ b/glom/utility_widgets/flowtable.cc
@@ -75,8 +75,7 @@ void FlowTable::delete_and_forget_hbox(Gtk::Box* hbox)
 {
   //Remove its children because the API hides the fact that they are inside the Box.
   //Otherwise they could even be deleted by the Box.
-  typedef std::vector<Widget*> type_children;
-  type_children children = hbox->get_children();
+  auto children = hbox->get_children();
   while(!children.empty())
   {
     auto widget = children[0];
diff --git a/glom/utils_ui.cc b/glom/utils_ui.cc
index 28bd685..7577ecb 100644
--- a/glom/utils_ui.cc
+++ b/glom/utils_ui.cc
@@ -223,7 +223,7 @@ Glib::RefPtr<Gdk::Pixbuf> UiUtils::get_pixbuf_for_gda_value(const Gnome::Gda::Va
     if(buffer_binary && buffer_binary_length)
     {
       //typedef std::list<Gdk::PixbufFormat> type_list_formats;
-      //const type_list_formats formats = Gdk::Pixbuf::get_formats();
+      //const auto formats = Gdk::Pixbuf::get_formats();
       //std::cout << "Debug: Supported pixbuf formats:\n";
       //for(const auto& item : formats)
       //{
diff --git a/tests/export/test_selfhosting_new_then_export_with_big_num.cc 
b/tests/export/test_selfhosting_new_then_export_with_big_num.cc
index 7a5ae72..5b312a9 100644
--- a/tests/export/test_selfhosting_new_then_export_with_big_num.cc
+++ b/tests/export/test_selfhosting_new_then_export_with_big_num.cc
@@ -39,7 +39,7 @@ static bool test(Glom::Document::HostingMode hosting_mode)
   
   Glom::FoundSet found_set; //TODO: Test a where clause.
   found_set.m_table_name = "artists";
-  Glom::Document::type_list_layout_groups layout_groups;
+  Glom::Document::type_list_const_layout_groups layout_groups;
   auto group = std::make_shared<Glom::LayoutGroup>();
   layout_groups.emplace_back(group);
   auto field = std::make_shared<Glom::LayoutItem_Field>();


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