[glom] Fix the build with -Wshadow.



commit 24350bba237d9436d601cf1bf13b242043e8c1aa
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Jul 6 13:50:25 2015 +0200

    Fix the build with -Wshadow.
    
    This seems useful. It can catch real errors.

 glom/appwindow.cc                                  |   18 +-
 glom/base_db.cc                                    |   29 +-
 glom/base_db.h                                     |    6 +-
 glom/base_db_table_data.cc                         |   28 +-
 glom/frame_glom.cc                                 |   25 +-
 glom/import_csv/dialog_import_csv.cc               |   10 +-
 glom/libglom/connectionpool_backends/mysql.cc      |   18 +-
 glom/libglom/connectionpool_backends/mysql_self.cc |   11 +-
 glom/libglom/connectionpool_backends/postgres.cc   |   10 +-
 .../connectionpool_backends/postgres_self.cc       |    6 +-
 glom/libglom/connectionpool_backends/sqlite.cc     |    4 +-
 glom/libglom/db_utils.cc                           |   27 +-
 glom/libglom/document/document.cc                  |  410 ++++++++++----------
 glom/libglom/privs.cc                              |   50 ++--
 glom/libglom/python_embed/py_glom_related.cc       |   12 +-
 glom/libglom/report_builder.cc                     |   11 +-
 glom/libglom/utils.cc                              |    1 -
 glom/mode_data/box_data_calendar_related.cc        |    1 -
 glom/mode_data/box_data_details.cc                 |   28 +-
 glom/mode_data/box_data_details.h                  |    2 +-
 .../datawidget/combochoiceswithtreemodel.cc        |   10 +-
 glom/mode_data/datawidget/treemodel_db.cc          |    4 +-
 glom/mode_data/db_adddel/db_adddel.cc              |   17 +-
 glom/mode_data/flowtablewithfields.cc              |   18 +-
 glom/mode_design/fields/box_db_table_definition.cc |    4 +-
 glom/mode_design/layout/combobox_relationship.cc   |   14 +-
 glom/mode_design/layout/dialog_layout_details.cc   |    5 +-
 .../print_layouts/window_print_layout_edit.cc      |    3 -
 .../relationships_overview/canvas_group_dbtable.cc |   46 ++--
 .../relationships_overview/canvas_group_dbtable.h  |    4 -
 .../report_layout/dialog_layout_report.cc          |   10 +-
 glom/mode_design/users/dialog_groups_list.cc       |   12 +-
 glom/mode_design/users/dialog_users_list.cc        |   10 +-
 glom/navigation/box_tables.cc                      |    4 +-
 glom/print_layout/canvas_layout_item.cc            |    4 +-
 glom/print_layout/canvas_print_layout.cc           |   12 +-
 glom/python_embed/glom_python.cc                   |    6 +-
 glom/utility_widgets/adddel/adddel.cc              |   28 +-
 glom/utility_widgets/canvas/canvas_editable.cc     |   16 +-
 glom/utility_widgets/canvas/canvas_editable.h      |    2 +-
 .../utility_widgets/canvas/canvas_image_movable.cc |    4 +-
 glom/utility_widgets/flowtable.cc                  |    5 +-
 glom/utility_widgets/imageglom.cc                  |   20 +-
 tests/test_document_load.cc                        |    4 +-
 tests/test_document_load_and_change.cc             |    4 +-
 45 files changed, 473 insertions(+), 500 deletions(-)
---
diff --git a/glom/appwindow.cc b/glom/appwindow.cc
index 420860a..5462692 100644
--- a/glom/appwindow.cc
+++ b/glom/appwindow.cc
@@ -1068,16 +1068,16 @@ bool AppWindow::on_document_load()
         //connection_request_password_and_choose_new_database_name() has already change the database name to 
a new unused one:
 
         bool user_cancelled = false;
-        bool test = false;
+        bool recreated = false;
         if(is_example)
-          test = recreate_database_from_example(user_cancelled);
+          recreated = recreate_database_from_example(user_cancelled);
         else
         {
-          test = recreate_database_from_backup(m_backup_data_filepath, user_cancelled);
+          recreated = recreate_database_from_backup(m_backup_data_filepath, user_cancelled);
           m_backup_data_filepath.clear();
         }
 
-        if(!test)
+        if(!recreated)
         {
           // TODO: Do we need to call connection_pool->cleanup() here, for
           // stopping self-hosted databases? armin.
@@ -1372,8 +1372,6 @@ void AppWindow::existing_or_new_new()
 
   //Each document must have a location, so ask the user for one.
   //This will use an extended save dialog that also asks for the database title and some hosting details:
-  Glib::ustring db_title;
-
   m_ui_save_extra_showextras = true; //Offer self-hosting or central hosting, and offer the database title.
   m_ui_save_extra_newdb_hosting_mode = Document::HOSTING_MODE_DEFAULT; /* Default to self-hosting */
   m_ui_save_extra_newdb_title.clear();
@@ -2026,13 +2024,13 @@ void AppWindow::fill_menu_print_layouts(const Glib::ustring& table_name)
 #ifndef GLOM_ENABLE_CLIENT_ONLY
   for(const auto& item : tables)
   {
-    std::shared_ptr<PrintLayout> print_layout = document->get_print_layout(table_name, item);
-    if(print_layout)
+    std::shared_ptr<PrintLayout> layout = document->get_print_layout(table_name, item);
+    if(layout)
     {
-      const auto name = print_layout->get_name();
+      const auto name = layout->get_name();
       if(!name.empty())
       {
-        const auto title = Utils::string_escape_underscores(item_get_title(print_layout));
+        const auto title = Utils::string_escape_underscores(item_get_title(layout));
         const Glib::ustring action_name = name;
 
         menu->append(title, ACTION_GROUP_NAME_PRINT_LAYOUTS + "." + action_name);
diff --git a/glom/base_db.cc b/glom/base_db.cc
index cae5d8f..ab4e811 100644
--- a/glom/base_db.cc
+++ b/glom/base_db.cc
@@ -832,15 +832,15 @@ void Base_DB::calculate_field(const LayoutFieldInRecord& field_in_record)
     iterFind = m_FieldsCalculationInProgress.find(field_name); //Always succeeds.
   }
 
-  CalcInProgress& refCalcProgress = iterFind->second;
+  CalcInProgress& calc_progress = iterFind->second;
 
   //Use the previously-calculated value if possible:
-  if(refCalcProgress.m_calc_in_progress)
+  if(calc_progress.m_calc_in_progress)
   {
     //std::cerr << G_STRFUNC << ": Circular calculation detected. field_name=" << field_name << std::endl;
     //refCalcProgress.m_value = Conversions::get_empty_value(field->get_glom_type()); //Give up.
   }
-  else if(refCalcProgress.m_calc_finished)
+  else if(calc_progress.m_calc_finished)
   {
     //std::cerr << G_STRFUNC << ": Already calculated." << std::endl;
 
@@ -850,10 +850,7 @@ void Base_DB::calculate_field(const LayoutFieldInRecord& field_in_record)
   {
     //std::cerr << G_STRFUNC << ": setting calc_in_progress: field_name=" << field_name << std::endl;
 
-    refCalcProgress.m_calc_in_progress = true; //Let the recursive calls to calculate_field() check this.
-
-    std::shared_ptr<LayoutItem_Field> layout_item = std::make_shared<LayoutItem_Field>();
-    layout_item->set_full_field_details(refCalcProgress.m_field);
+    calc_progress.m_calc_in_progress = true; //Let the recursive calls to calculate_field() check this.
 
     //Calculate dependencies first:
     //TODO: Prevent unncessary recalculations?
@@ -888,10 +885,10 @@ void Base_DB::calculate_field(const LayoutFieldInRecord& field_in_record)
 
     //m_FieldsCalculationInProgress has changed, probably invalidating our iter, so get it again:
     iterFind = m_FieldsCalculationInProgress.find(field_name); //Always succeeds.
-    CalcInProgress& refCalcProgress = iterFind->second;
+    CalcInProgress& calc_progress_refreshed = iterFind->second;
 
-    //Check again, because the value miight have been calculated during the dependencies.
-    if(refCalcProgress.m_calc_finished)
+    //Check again, because the value might have been calculated during the dependencies.
+    if(calc_progress_refreshed.m_calc_finished)
     {
       //We recently calculated this value, and set it in the database and layout, so don't waste time doing 
it again:
     }
@@ -902,7 +899,7 @@ void Base_DB::calculate_field(const LayoutFieldInRecord& field_in_record)
       const auto field_values = get_record_field_values_for_calculation(field_in_record.m_table_name, 
field_in_record.m_key, field_in_record.m_key_value);
       if(!field_values.empty())
       {
-        std::shared_ptr<const Field> field = refCalcProgress.m_field;
+        std::shared_ptr<const Field> field = calc_progress_refreshed.m_field;
         if(field)
         {
           //We need the connection when we run the script, so that the script may use it.
@@ -911,7 +908,7 @@ void Base_DB::calculate_field(const LayoutFieldInRecord& field_in_record)
           g_assert(sharedconnection);
 
           Glib::ustring error_message; //TODO: Check this.
-          refCalcProgress.m_value =
+          calc_progress_refreshed.m_value =
             glom_evaluate_python_function_implementation(field->get_glom_type(),
               field->get_calculation(),
               field_values,
@@ -921,14 +918,14 @@ void Base_DB::calculate_field(const LayoutFieldInRecord& field_in_record)
               sharedconnection->get_gda_connection(),
               error_message);
 
-          refCalcProgress.m_calc_finished = true;
-          refCalcProgress.m_calc_in_progress = false;
+          calc_progress_refreshed.m_calc_finished = true;
+          calc_progress_refreshed.m_calc_in_progress = false;
 
           std::shared_ptr<LayoutItem_Field> layout_item = std::make_shared<LayoutItem_Field>();
           layout_item->set_full_field_details(field);
 
           //show it:
-          set_entered_field_data(layout_item, refCalcProgress.m_value ); //TODO: If this record is shown.
+          set_entered_field_data(layout_item, calc_progress_refreshed.m_value ); //TODO: If this record is 
shown.
 
           //Add it to the database (even if it is not shown in the view)
           //Using true for the last parameter means we use existing calculations where possible,
@@ -938,7 +935,7 @@ void Base_DB::calculate_field(const LayoutFieldInRecord& field_in_record)
           {
             LayoutFieldInRecord field_in_record_layout(layout_item, field_in_record.m_table_name /* parent 
*/, field_in_record.m_key, field_in_record.m_key_value);
 
-            set_field_value_in_database(field_in_record_layout, refCalcProgress.m_value, true); //This 
triggers other recalculations/lookups.
+            set_field_value_in_database(field_in_record_layout, calc_progress_refreshed.m_value, true); 
//This triggers other recalculations/lookups.
           }
         }
       }
diff --git a/glom/base_db.h b/glom/base_db.h
index 7643eca..3f2268c 100644
--- a/glom/base_db.h
+++ b/glom/base_db.h
@@ -153,11 +153,11 @@ protected:
         {
           if(layout_item->get_has_related_relationship_name()) //For doubly-related fields
           {
-            std::shared_ptr<const Relationship> rel = layout_item->get_related_relationship();
-            if(rel)
+            std::shared_ptr<const Relationship> related_rel = layout_item->get_related_relationship();
+            if(related_rel)
             {
               //Actually a foreign key in a doubly-related table:
-              m_key = document.get_field(m_table_name, rel->get_to_field());
+              m_key = document.get_field(m_table_name, related_rel->get_to_field());
             }
           }
           else
diff --git a/glom/base_db_table_data.cc b/glom/base_db_table_data.cc
index 66699f8..b509ef3 100644
--- a/glom/base_db_table_data.cc
+++ b/glom/base_db_table_data.cc
@@ -295,11 +295,10 @@ bool Base_DB_Table_Data::add_related_record_for_field(const std::shared_ptr<cons
         //Generate the new key value;
       }
 
-      Glib::RefPtr<Gnome::Gda::SqlBuilder> builder = 
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_INSERT);
-      builder->set_table(relationship->get_to_table());
-      builder->add_field_value(primary_key_field->get_name(), primary_key_value);
-      const auto test = DbUtils::query_execute(builder);
-      if(!test)
+      Glib::RefPtr<Gnome::Gda::SqlBuilder> builder_insert = 
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_INSERT);
+      builder_insert->set_table(relationship->get_to_table());
+      builder_insert->add_field_value(primary_key_field->get_name(), primary_key_value);
+      if(!DbUtils::query_execute(builder_insert))
       {
         std::cerr << G_STRFUNC << ": INSERT failed." << std::endl;
         return false;
@@ -341,17 +340,16 @@ bool Base_DB_Table_Data::add_related_record_for_field(const std::shared_ptr<cons
           else
           {
             const auto target_table = relationship->get_from_table();
-            Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+            Glib::RefPtr<Gnome::Gda::SqlBuilder> builder_update =
               Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_UPDATE);
-            builder->set_table(target_table);
-            builder->add_field_value_as_value(relationship->get_from_field(), primary_key_value);
-            builder->set_where(
-              builder->add_cond(Gnome::Gda::SQL_OPERATOR_TYPE_EQ,
-                builder->add_field_id(parent_primary_key_field->get_name(), target_table),
-                builder->add_expr(parent_primary_key_value)) );
-
-            const auto test = DbUtils::query_execute(builder);
-            if(!test)
+            builder_update->set_table(target_table);
+            builder_update->add_field_value_as_value(relationship->get_from_field(), primary_key_value);
+            builder_update->set_where(
+              builder_update->add_cond(Gnome::Gda::SQL_OPERATOR_TYPE_EQ,
+                builder_update->add_field_id(parent_primary_key_field->get_name(), target_table),
+                builder_update->add_expr(parent_primary_key_value)) );
+
+            if(!DbUtils::query_execute(builder_update))
             {
               std::cerr << G_STRFUNC << ": UPDATE failed." << std::endl;
               return false;
diff --git a/glom/frame_glom.cc b/glom/frame_glom.cc
index a582a6b..1d23044 100644
--- a/glom/frame_glom.cc
+++ b/glom/frame_glom.cc
@@ -1202,7 +1202,6 @@ void Frame_Glom::on_dialog_add_related_table_response(int response)
 
       on_dialog_tables_hide(); //Update the menu.
 
-      Gtk::Window* parent = get_app_window();
       if(parent)
         show_ok_dialog(_("Related Table Created"), _("The new related table has been created."), *parent, 
Gtk::MESSAGE_INFO);
     }
@@ -2567,6 +2566,20 @@ void Frame_Glom::on_notebook_data_record_selection_changed()
     pApp->enable_menu_print_layouts_details(something_selected);  
 }
 
+namespace {
+
+static Glib::ustring ulong_as_string(gulong value)
+{
+  Glib::ustring result;
+  std::stringstream the_stream;
+  //the_stream.imbue( current_locale );
+  the_stream << value;
+  the_stream >> result;
+  return result;
+}
+
+} //anonymous namespace
+
 gulong Frame_Glom::update_records_count()
 {
   //Get the number of records available and the number found,
@@ -2578,11 +2591,7 @@ gulong Frame_Glom::update_records_count()
   //std::cout << G_STRFUNC << ": count_all=" << count_all << ", count_found=" << count_found << std::endl;
 
   std::string str_count_all, str_count_found;
-
-  std::stringstream the_stream;
-  //the_stream.imbue( current_locale );
-  the_stream << count_all;
-  the_stream >> str_count_all;
+  str_count_all = ulong_as_string(count_all);
 
   if(count_found == count_all)
   {
@@ -2595,9 +2604,7 @@ gulong Frame_Glom::update_records_count()
   }
   else
   {
-    std::stringstream the_stream; //Reusing the existing stream seems to produce an empty string.
-    the_stream << count_found;
-    the_stream >> str_count_found;
+    str_count_found = ulong_as_string(count_found);
 
     m_Button_FindAll.show();
   }
diff --git a/glom/import_csv/dialog_import_csv.cc b/glom/import_csv/dialog_import_csv.cc
index 7052df4..7e92c33 100644
--- a/glom/import_csv/dialog_import_csv.cc
+++ b/glom/import_csv/dialog_import_csv.cc
@@ -196,8 +196,8 @@ void Dialog_Import_CSV::import(const Glib::ustring& uri, const Glib::ustring& in
     m_target_table->set_markup("<b>" + Glib::Markup::escape_text(into_table) + "</b>");
 
     m_field_model = Gtk::ListStore::create(m_field_columns);
-    auto tree_iter = m_field_model->append();
-    (*tree_iter)[m_field_columns.m_col_field_name] = _("<None>");
+    auto tree_iter_none = m_field_model->append();
+    (*tree_iter_none)[m_field_columns.m_col_field_name] = _("<None>");
 
     const Document::type_vec_fields fields(document->get_table_fields(into_table));
     for (const auto& field : fields)
@@ -659,14 +659,14 @@ void Dialog_Import_CSV::on_field_edited(const Glib::ustring& path, const Glib::u
       // Update the rows, so they are redrawn, doing a conversion to the new type.
       const auto sample_children = m_sample_model->children();
       // Create a TreeModel::Path with initial index 0. We need a TreeModel::Path for the row_changed() call
-      Gtk::TreeModel::Path path("0");
+      Gtk::TreeModel::Path path_changed("0");
 
       for(auto sample_iter = sample_children.begin(); sample_iter != sample_children.end(); ++ sample_iter)
       {
         if(sample_iter != iter)
-          m_sample_model->row_changed(path, sample_iter);
+          m_sample_model->row_changed(path_changed, sample_iter);
 
-        path.next();
+        path_changed.next();
       }
 
       validate_primary_key();
diff --git a/glom/libglom/connectionpool_backends/mysql.cc b/glom/libglom/connectionpool_backends/mysql.cc
index 93a63f7..ec4b303 100644
--- a/glom/libglom/connectionpool_backends/mysql.cc
+++ b/glom/libglom/connectionpool_backends/mysql.cc
@@ -87,7 +87,7 @@ Glib::RefPtr<Gnome::Gda::Connection> MySQL::attempt_connect(const Glib::ustring&
   const Glib::ustring cnc_string_main = "HOST=" + DbUtils::gda_cnc_string_encode(m_host)
    + ";PORT=" + DbUtils::gda_cnc_string_encode(port)
    + ";PROTOCOL=TCP"; //PROTOCOL is in libgda >= 5.1.2.
-  const auto cnc_string = cnc_string_main +";DB_NAME=" + DbUtils::gda_cnc_string_encode(database);
+  const auto cnc_string_with_db = cnc_string_main +";DB_NAME=" + DbUtils::gda_cnc_string_encode(database);
 
   Glib::RefPtr<Gnome::Gda::Connection> connection;
   Glib::RefPtr<Gnome::Gda::DataModel> data_model;
@@ -96,7 +96,7 @@ Glib::RefPtr<Gnome::Gda::Connection> MySQL::attempt_connect(const Glib::ustring&
 
 #ifdef GLOM_CONNECTION_DEBUG
   std::cout << std::endl << "DEBUG: Glom: trying to connect on port=" << port << std::endl;
-  std::cout << "debug: " << G_STRFUNC << ": cnc_string=" << cnc_string << std::endl;
+  std::cout << "debug: " << G_STRFUNC << ": cnc_string=" << cnc_string_with_db << std::endl;
   std::cout << "  DEBUG: auth_string=" << auth_string << std::endl;
 #endif
 
@@ -105,13 +105,13 @@ Glib::RefPtr<Gnome::Gda::Connection> MySQL::attempt_connect(const Glib::ustring&
     if(fake_connection)
     {
       connection = Gnome::Gda::Connection::create_from_string("MySQL",
-        cnc_string, auth_string,
+        cnc_string_with_db, auth_string,
         Gnome::Gda::CONNECTION_OPTIONS_SQL_IDENTIFIERS_CASE_SENSITIVE);
     }
     else
     {
       connection = Gnome::Gda::Connection::open_from_string("MySQL",
-        cnc_string, auth_string,
+        cnc_string_with_db, auth_string,
         Gnome::Gda::CONNECTION_OPTIONS_SQL_IDENTIFIERS_CASE_SENSITIVE);
 
       //connection->statement_execute_non_select("SET DATESTYLE = 'ISO'");
@@ -125,13 +125,13 @@ Glib::RefPtr<Gnome::Gda::Connection> MySQL::attempt_connect(const Glib::ustring&
     std::cout << "debug: " << G_STRFUNC << ": Attempting to connect without specifying the database." << 
std::endl;
 #endif
 
-    const auto cnc_string = cnc_string_main + ";DB_NAME=" + DbUtils::gda_cnc_string_encode(default_database);
+    const auto cnc_string_without_db = cnc_string_main + ";DB_NAME=" + 
DbUtils::gda_cnc_string_encode(default_database);
     Glib::RefPtr<Gnome::Gda::Connection> temp_conn;
-    auto auth_string = create_auth_string(username, password);
+    //auto auth_string = create_auth_string(username, password);
     try
     {
       temp_conn = Gnome::Gda::Connection::open_from_string("MySQL",
-        cnc_string, auth_string,
+        cnc_string_without_db, auth_string,
         Gnome::Gda::CONNECTION_OPTIONS_SQL_IDENTIFIERS_CASE_SENSITIVE);
     }
     catch(const Glib::Error& /* ex */)
@@ -394,9 +394,9 @@ bool MySQL::change_columns(const Glib::RefPtr<Gnome::Gda::Connection>& connectio
     {
       connection->rollback_transaction(TRANSACTION_NAME);
     }
-    catch(const Glib::Error& ex)
+    catch(const Glib::Error& ex_rollback)
     {
-      std::cerr << G_STRFUNC << "Could not rollback the transaction: Exception: " << ex.what() << std::endl;
+      std::cerr << G_STRFUNC << "Could not rollback the transaction: Exception: " << ex_rollback.what() << 
std::endl;
     }
   }
   
diff --git a/glom/libglom/connectionpool_backends/mysql_self.cc 
b/glom/libglom/connectionpool_backends/mysql_self.cc
index c508146..5741304 100644
--- a/glom/libglom/connectionpool_backends/mysql_self.cc
+++ b/glom/libglom/connectionpool_backends/mysql_self.cc
@@ -362,9 +362,7 @@ Backend::StartupErrors MySQLSelfHosted::startup(const SlotProgress& slot_progres
   const std::string second_command_success_text = "mysqld is alive"; //TODO: This is not a stable API. Also, 
watch out for localisation.
   //std::cout << G_STRFUNC << ": debug: command_check_mysql_has_started=" << command_check_mysql_has_started 
<< std::endl;
 
-  const auto result = 
Glom::Spawn::execute_command_line_and_wait_until_second_command_returns_success(command_mysql_start, 
command_check_mysql_has_started, slot_progress, second_command_success_text);
-
-  if(!result)
+  if(!Glom::Spawn::execute_command_line_and_wait_until_second_command_returns_success(command_mysql_start, 
command_check_mysql_has_started, slot_progress, second_command_success_text))
   {
     m_port = 0;
 
@@ -388,9 +386,7 @@ Backend::StartupErrors MySQLSelfHosted::startup(const SlotProgress& slot_progres
       + " password " + Glib::shell_quote(m_initial_password_to_set);
     //std::cout << "debug: command_initdb_set_initial_password=" << command_initdb_set_initial_password << 
std::endl;
 
-    const auto result = Glom::Spawn::execute_command_line_and_wait(command_initdb_set_initial_password, 
slot_progress);
-
-    if(!result)
+    if(!Glom::Spawn::execute_command_line_and_wait(command_initdb_set_initial_password, slot_progress))
     {
       std::cerr << G_STRFUNC << ": Error while attempting to start self-hosting MySQL database, when setting 
the initial password." << std::endl;
       return STARTUPERROR_FAILED_UNKNOWN_REASON;
@@ -550,8 +546,7 @@ bool MySQLSelfHosted::cleanup(const SlotProgress& slot_progress)
     
     //I've seen it fail when running under valgrind, and there are reports of failures in bug #420962.
     //Maybe it will help to try again:
-    const auto result = Glom::Spawn::execute_command_line_and_wait(command_mysql_stop, slot_progress);
-    if(!result)
+    if(!Glom::Spawn::execute_command_line_and_wait(command_mysql_stop, slot_progress))
     {
       std::cerr << G_STRFUNC << ": Error while attempting (for a second time) to stop self-hosting of the 
database."  << std::endl;
       return false;
diff --git a/glom/libglom/connectionpool_backends/postgres.cc 
b/glom/libglom/connectionpool_backends/postgres.cc
index 7366abb..e4e28a9 100644
--- a/glom/libglom/connectionpool_backends/postgres.cc
+++ b/glom/libglom/connectionpool_backends/postgres.cc
@@ -112,13 +112,13 @@ Glib::RefPtr<Gnome::Gda::Connection> Postgres::attempt_connect(const Glib::ustri
     std::cout << "debug: " << G_STRFUNC << ": Attempting to connect without specifying the database." << 
std::endl;
 #endif
 
-    const auto cnc_string = cnc_string_main + ";DB_NAME=" + DbUtils::gda_cnc_string_encode(default_database);
+    const auto cnc_string_with_db = cnc_string_main + ";DB_NAME=" + 
DbUtils::gda_cnc_string_encode(default_database);
     Glib::RefPtr<Gnome::Gda::Connection> temp_conn;
-    auto auth_string = create_auth_string(username, password);
+    //auto auth_string = create_auth_string(username, password);
     try
     {
       temp_conn = Gnome::Gda::Connection::open_from_string("PostgreSQL",
-        cnc_string, auth_string,
+        cnc_string_with_db, auth_string,
         Gnome::Gda::CONNECTION_OPTIONS_SQL_IDENTIFIERS_CASE_SENSITIVE);
     }
     catch(const Glib::Error& /* ex */)
@@ -379,9 +379,9 @@ bool Postgres::change_columns(const Glib::RefPtr<Gnome::Gda::Connection>& connec
     {
       connection->rollback_transaction(TRANSACTION_NAME);
     }
-    catch(const Glib::Error& ex)
+    catch(const Glib::Error& ex_rollback)
     {
-      std::cerr << G_STRFUNC << ": Could not rollback the transaction: Exception: " << ex.what() << 
std::endl;
+      std::cerr << G_STRFUNC << ": Could not rollback the transaction: Exception: " << ex_rollback.what() << 
std::endl;
     }
   }
   
diff --git a/glom/libglom/connectionpool_backends/postgres_self.cc 
b/glom/libglom/connectionpool_backends/postgres_self.cc
index 32db63d..31b5aa2 100644
--- a/glom/libglom/connectionpool_backends/postgres_self.cc
+++ b/glom/libglom/connectionpool_backends/postgres_self.cc
@@ -493,8 +493,7 @@ bool PostgresSelfHosted::cleanup(const SlotProgress& slot_progress)
   // Make sure to use double quotes for the executable path, because the
   // CreateProcess() API used on Windows does not support single quotes.
   const auto command_postgres_stop = get_path_to_postgres_executable("pg_ctl") + " -D " + 
Glib::shell_quote(dbdir_data) + " stop -m fast";
-  const auto result = Glom::Spawn::execute_command_line_and_wait(command_postgres_stop, slot_progress);
-  if(!result)
+  if(!Glom::Spawn::execute_command_line_and_wait(command_postgres_stop, slot_progress))
   {
     std::cerr << G_STRFUNC << ": Error while attempting to stop self-hosting of the database. Trying again." 
 << std::endl;
     
@@ -510,8 +509,7 @@ bool PostgresSelfHosted::cleanup(const SlotProgress& slot_progress)
     
     //I've seen it fail when running under valgrind, and there are reports of failures in bug #420962.
     //Maybe it will help to try again:
-    const auto result = Glom::Spawn::execute_command_line_and_wait(command_postgres_stop, slot_progress);
-    if(!result)
+    if(!Glom::Spawn::execute_command_line_and_wait(command_postgres_stop, slot_progress))
     {
       std::cerr << G_STRFUNC << ": Error while attempting (for a second time) to stop self-hosting of the 
database."  << std::endl;
       return false;
diff --git a/glom/libglom/connectionpool_backends/sqlite.cc b/glom/libglom/connectionpool_backends/sqlite.cc
index ef0ef49..5d2577a 100644
--- a/glom/libglom/connectionpool_backends/sqlite.cc
+++ b/glom/libglom/connectionpool_backends/sqlite.cc
@@ -369,9 +369,9 @@ bool Sqlite::recreate_table(const Glib::RefPtr<Gnome::Gda::Connection>& connecti
     {
       connection->rollback_transaction(TRANSACTION_NAME);
     }
-    catch(const Glib::Error& ex)
+    catch(const Glib::Error& ex_rollback)
     {
-       std::cerr << G_STRFUNC << ": Could not revert the transaction. exception=" << ex.what() << std::endl;
+       std::cerr << G_STRFUNC << ": Could not revert the transaction. exception=" << ex_rollback.what() << 
std::endl;
     }
   }
 
diff --git a/glom/libglom/db_utils.cc b/glom/libglom/db_utils.cc
index cc636f6..a3ec7b0 100644
--- a/glom/libglom/db_utils.cc
+++ b/glom/libglom/db_utils.cc
@@ -483,25 +483,23 @@ bool add_standard_tables(const Document* document)
       if(test)
       {
         //Add the single record:
-        Glib::RefPtr<Gnome::Gda::SqlBuilder> builder = 
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_INSERT);
-        builder->set_table(GLOM_STANDARD_TABLE_PREFS_TABLE_NAME);
-        builder->add_field_value(GLOM_STANDARD_TABLE_PREFS_FIELD_ID, 1);
-        const auto test = query_execute(builder);
-        if(!test)
+        Glib::RefPtr<Gnome::Gda::SqlBuilder> builderAdd = 
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_INSERT);
+        builderAdd->set_table(GLOM_STANDARD_TABLE_PREFS_TABLE_NAME);
+        builderAdd->add_field_value(GLOM_STANDARD_TABLE_PREFS_FIELD_ID, 1);
+        if(!query_execute(builderAdd))
           std::cerr << G_STRFUNC << ": INSERT failed." << std::endl;
 
         //Use the database title from the document, if there is one:
         const auto system_name = document->get_database_title_original();
         if(!system_name.empty())
         {
-          Glib::RefPtr<Gnome::Gda::SqlBuilder> builder = 
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_UPDATE);
-          builder->set_table(GLOM_STANDARD_TABLE_PREFS_TABLE_NAME);
-          builder->add_field_value(GLOM_STANDARD_TABLE_PREFS_FIELD_NAME, system_name);
-          builder->set_where(builder->add_cond(Gnome::Gda::SQL_OPERATOR_TYPE_EQ,
-                                               builder->add_field_id(GLOM_STANDARD_TABLE_PREFS_FIELD_ID, 
GLOM_STANDARD_TABLE_PREFS_TABLE_NAME),
-                                               builder->add_expr(1)));
-          const auto test = query_execute(builder);
-          if(!test)
+          Glib::RefPtr<Gnome::Gda::SqlBuilder> builderUpdate = 
Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_UPDATE);
+          builderUpdate->set_table(GLOM_STANDARD_TABLE_PREFS_TABLE_NAME);
+          builderUpdate->add_field_value(GLOM_STANDARD_TABLE_PREFS_FIELD_NAME, system_name);
+          builderUpdate->set_where(builderAdd->add_cond(Gnome::Gda::SQL_OPERATOR_TYPE_EQ,
+                                               builderAdd->add_field_id(GLOM_STANDARD_TABLE_PREFS_FIELD_ID, 
GLOM_STANDARD_TABLE_PREFS_TABLE_NAME),
+                                               builderAdd->add_expr(1)));
+          if(!query_execute(builderUpdate))
             std::cerr << G_STRFUNC << ": UPDATE failed." << std::endl;
         }
       }
@@ -2156,8 +2154,7 @@ bool add_user(const Document* document, const Glib::ustring& user, const Glib::u
   {
     const auto table_name = table->get_name();
     const Glib::ustring strQuery = "REVOKE ALL PRIVILEGES ON " + DbUtils::escape_sql_id(table_name) + " FROM 
" + DbUtils::escape_sql_id(user);
-    const auto test = DbUtils::query_execute_string(strQuery);
-    if(!test)
+    if(!DbUtils::query_execute_string(strQuery))
       std::cerr << G_STRFUNC << ": REVOKE failed." << std::endl;
   }
 
diff --git a/glom/libglom/document/document.cc b/glom/libglom/document/document.cc
index b820e2c..49a0778 100644
--- a/glom/libglom/document/document.cc
+++ b/glom/libglom/document/document.cc
@@ -718,9 +718,9 @@ void Document::remove_relationship(const std::shared_ptr<const Relationship>& re
 
   //Remove relationshp from any reports:
   auto reports = info->m_reports;
-  for(const auto& the_pair : reports)
+  for(const auto& report_pair : reports)
   {
-    auto report = the_pair.second;
+    auto report = report_pair.second;
     auto group = report->get_layout_group();
 
     //Remove the field wherever it is a related field:
@@ -731,10 +731,10 @@ void Document::remove_relationship(const std::shared_ptr<const Relationship>& re
 void Document::remove_field(const Glib::ustring& table_name, const Glib::ustring& field_name)
 {
   //Remove the field itself:
-  const auto info = get_table_info(table_name);
-  if(info)
+  const auto table_info = get_table_info(table_name);
+  if(table_info)
   {
-    auto vecFields = info->m_fields;
+    auto vecFields = table_info->m_fields;
     auto iterFind = std::find_if( vecFields.begin(), vecFields.end(), 
predicate_FieldHasName<Field>(field_name) );
     if(iterFind != vecFields.end()) //If it was found:
     {
@@ -746,9 +746,9 @@ void Document::remove_field(const Glib::ustring& table_name, const Glib::ustring
   }
 
   //Remove any relationships that use this field:
-  for(const auto& the_pair : m_tables)
+  for(const auto& table_pair : m_tables)
   {
-    const auto info = the_pair.second;
+    const auto info = table_pair.second;
     if(!info)
       continue;
 
@@ -800,9 +800,9 @@ void Document::remove_field(const Glib::ustring& table_name, const Glib::ustring
 
     //Remove field from any reports:
     auto reports = info->m_reports;
-    for(const auto& the_pair : reports)
+    for(const auto& report_pair : reports)
     {
-      auto report = the_pair.second;
+      auto report = report_pair.second;
       auto group = report->get_layout_group();
 
       //Remove regular fields if the field is in this layout's table:
@@ -825,9 +825,9 @@ void Document::remove_table(const Glib::ustring& table_name)
   }
 
   //Remove any relationships that use this table:
-  for(const auto& the_pair : m_tables)
+  for(const auto& table_pair : m_tables)
   {
-    const auto info = the_pair.second;
+    const auto info = table_pair.second;
     if(!info)
       continue;
 
@@ -965,15 +965,15 @@ void Document::change_field_name(const Glib::ustring& table_name, const Glib::us
 
     //Find any relationships, layouts, or formatting that use this field
     //Look at each table:
-    for(const auto& the_pair : m_tables)
+    for(const auto& table_pair : m_tables)
     {
-      const auto infoInner = the_pair.second;
+      const auto infoInner = table_pair.second;
       if(!infoInner)
         continue;
 
       //Fields:
-      type_vec_fields& vecFields = infoInner->m_fields;
-      for(const auto& field : vecFields)
+      type_vec_fields& vecFieldsInner = infoInner->m_fields;
+      for(const auto& field : vecFieldsInner)
       {
         if(!field)
           continue;
@@ -1026,10 +1026,10 @@ void Document::change_field_name(const Glib::ustring& table_name, const Glib::us
 
 
       //Look at each report:
-      for(const auto& the_pair : infoInner->m_reports)
+      for(const auto& report_pair : infoInner->m_reports)
       {
         //Change the field if it is in this group:
-        auto report = the_pair.second;
+        auto report = report_pair.second;
         if(report)
         {
           if(is_parent_table)
@@ -1065,14 +1065,14 @@ void Document::change_table_name(const Glib::ustring& table_name_old, const Glib
 
     //Find any relationships or layouts that use this table
     //Look at each table:
-    for(const auto& the_pair : m_tables)
+    for(const auto& table_pair : m_tables)
     {
       //Look at each relationship in the table:
-      const auto doctableinfo = the_pair.second;
-      if(!doctableinfo)
+      const auto doctableinfo_inner = table_pair.second;
+      if(!doctableinfo_inner)
         continue;
 
-      type_vec_relationships relationships = doctableinfo->m_relationships;
+      type_vec_relationships relationships = doctableinfo_inner->m_relationships;
       for(const auto& relationship : relationships)
       {
         if(relationship->get_from_table() == table_name_old)
@@ -1165,9 +1165,9 @@ Document::type_listConstTableInfo Document::get_tables(bool plus_system_prefs) c
 
   type_listConstTableInfo result;
 
-  for(const auto& the_pair : m_tables)
+  for(const auto& table_pair : m_tables)
   {
-    const std::shared_ptr<const DocumentTableInfo> doctableinfo = the_pair.second;
+    const std::shared_ptr<const DocumentTableInfo> doctableinfo = table_pair.second;
     if(doctableinfo)
       result.push_back(doctableinfo->m_info);
 
@@ -1188,9 +1188,9 @@ Document::type_listTableInfo Document::get_tables(bool plus_system_prefs)
 {
   type_listTableInfo result;
 
-  for(const auto& the_pair : m_tables)
+  for(const auto& table_pair : m_tables)
   {
-    const auto doctableinfo = the_pair.second;
+    const auto doctableinfo = table_pair.second;
     if(doctableinfo)
       result.push_back(doctableinfo->m_info);
 
@@ -1281,9 +1281,9 @@ void Document::set_tables(const type_listTableInfo& tables)
   //Look at each "table":
 
   bool something_changed = false;
-  for(const auto& the_pair : m_tables)
+  for(const auto& table_pair : m_tables)
   {
-    const auto doctableinfo = the_pair.second;
+    const auto doctableinfo = table_pair.second;
     if(!doctableinfo)
       continue;
 
@@ -1313,9 +1313,9 @@ void Document::set_tables(const type_listTableInfo& tables)
 
 void Document::fill_sort_field_details(const Glib::ustring& parent_table_name, 
Formatting::type_list_sort_fields& sort_fields) const
 {
-  for(const auto& the_pair : sort_fields)
+  for(const auto& sort_pair : sort_fields)
   {
-    std::shared_ptr<const LayoutItem_Field> sort_field = the_pair.first;
+    std::shared_ptr<const LayoutItem_Field> sort_field = sort_pair.first;
     if(!sort_field)
      continue;
  
@@ -1793,9 +1793,9 @@ void Document::set_active_layout_platform(const Glib::ustring& layout_platform)
 
 Glib::ustring Document::get_default_table() const
 {
-  for(const auto& the_pair : m_tables)
+  for(const auto& table_pair : m_tables)
   {
-    const std::shared_ptr<const DocumentTableInfo> doctableinfo = the_pair.second;
+    const std::shared_ptr<const DocumentTableInfo> doctableinfo = table_pair.second;
     if(!doctableinfo)
       continue;
 
@@ -1979,10 +1979,10 @@ void Document::load_after_layout_item_formatting(const xmlpp::Element* element,
         Formatting::type_list_values list_values;
 
         auto listNodesCustomChoices = nodeChoiceList->get_children(GLOM_NODE_FORMAT_CUSTOM_CHOICE);
-        for(const auto& node : listNodesCustomChoices)
+        for(const auto& node_choices : listNodesCustomChoices)
         {
-          const auto element = dynamic_cast<const xmlpp::Element*>(node);
-          if(element)
+          const auto element_custom_choices = dynamic_cast<const xmlpp::Element*>(node_choices);
+          if(element_custom_choices)
           {
             if(field_type == Field::TYPE_INVALID)
             {
@@ -1995,7 +1995,7 @@ void Document::load_after_layout_item_formatting(const xmlpp::Element* element,
             }
 
             auto value = std::make_shared<ChoiceValue>();
-            load_after_choicevalue(element, value, field_type);
+            load_after_choicevalue(element_custom_choices, value, field_type);
             list_values.push_back(value);
           }
         }
@@ -2146,10 +2146,10 @@ void Document::load_after_sort_by(const xmlpp::Element* node, const Glib::ustrin
   if(!node)
     return;
 
-  auto listNodes = node->get_children(GLOM_NODE_DATA_LAYOUT_ITEM_FIELD);
-  for(const auto& node : listNodes)
+  auto list_nodes_item_fields = node->get_children(GLOM_NODE_DATA_LAYOUT_ITEM_FIELD);
+  for(const auto& node_item_field : list_nodes_item_fields)
   {
-    const auto element = dynamic_cast<const xmlpp::Element*>(node);
+    const auto element = dynamic_cast<const xmlpp::Element*>(node_item_field);
     if(element)
     {
       auto item = std::make_shared<LayoutItem_Field>();
@@ -2184,13 +2184,13 @@ void Document::load_after_layout_group(const xmlpp::Element* node, const Glib::u
   load_after_translations(node, temp);
 
   //Get the child items:
-  auto listNodes = node->get_children();
-  for(const auto& node : listNodes)
+  auto list_nodes_children = node->get_children();
+  for(const auto& node_child : list_nodes_children)
   {
     std::shared_ptr<LayoutItem> item_added;
 
     //Create the layout item:
-    const auto element = dynamic_cast<const xmlpp::Element*>(node);
+    const auto element = dynamic_cast<const xmlpp::Element*>(node_child);
     if(element)
     {
       if(element->get_name() == GLOM_NODE_DATA_LAYOUT_ITEM_FIELD)
@@ -2487,13 +2487,13 @@ void Document::load_after_translations(const xmlpp::Element* element, const std:
   if(nodeTranslations)
   {
     auto listNodesTranslations = nodeTranslations->get_children(GLOM_NODE_TRANSLATION);
-    for(const auto& node : listNodesTranslations)
+    for(const auto& node_translation : listNodesTranslations)
     {
-      const auto element = dynamic_cast<const xmlpp::Element*>(node);
-      if(element)
+      const auto element_translation = dynamic_cast<const xmlpp::Element*>(node_translation);
+      if(element_translation)
       {
-        const auto locale = XmlUtils::get_node_attribute_value(element, GLOM_ATTRIBUTE_TRANSLATION_LOCALE);
-        const auto translation = XmlUtils::get_node_attribute_value(element, 
GLOM_ATTRIBUTE_TRANSLATION_VALUE);
+        const auto locale = XmlUtils::get_node_attribute_value(element_translation, 
GLOM_ATTRIBUTE_TRANSLATION_LOCALE);
+        const auto translation = XmlUtils::get_node_attribute_value(element_translation, 
GLOM_ATTRIBUTE_TRANSLATION_VALUE);
         item->set_title(translation, locale);
 
         //Remember any new translation locales in our cached list:
@@ -2655,10 +2655,10 @@ bool Document::load_after(int& failure_code)
       m_tables.clear();
 
       //Look at each "table" node.
-      auto listNodes = nodeRoot->get_children(GLOM_NODE_TABLE);
-      for(const auto& node : listNodes)
+      auto list_nodes_tables = nodeRoot->get_children(GLOM_NODE_TABLE);
+      for(const auto& node_table : list_nodes_tables)
       {
-        auto nodeTable = dynamic_cast<xmlpp::Element*>(node);
+        auto nodeTable = dynamic_cast<xmlpp::Element*>(node_table);
         if(nodeTable)
         {
           const auto table_name = XmlUtils::get_node_attribute_value(nodeTable, GLOM_ATTRIBUTE_NAME);
@@ -2684,26 +2684,26 @@ bool Document::load_after(int& failure_code)
           const auto nodeRelationships = XmlUtils::get_node_child_named(nodeTable, GLOM_NODE_RELATIONSHIPS);
           if(nodeRelationships)
           {
-            const auto listNodes = nodeRelationships->get_children(GLOM_NODE_RELATIONSHIP);
-            for(const auto& node : listNodes)
+            const auto list_nodes_rels = nodeRelationships->get_children(GLOM_NODE_RELATIONSHIP);
+            for(const auto& item_rel : list_nodes_rels)
             {
-              const auto nodeChild = dynamic_cast<xmlpp::Element*>(node);
-              if(nodeChild)
+              const auto node_rel = dynamic_cast<xmlpp::Element*>(item_rel);
+              if(node_rel)
               {
                 auto relationship = std::make_shared<Relationship>();
-                const auto relationship_name = XmlUtils::get_node_attribute_value(nodeChild, 
GLOM_ATTRIBUTE_NAME);
+                const auto relationship_name = XmlUtils::get_node_attribute_value(node_rel, 
GLOM_ATTRIBUTE_NAME);
 
                 relationship->set_from_table(table_name);
                 relationship->set_name(relationship_name);;
 
-                relationship->set_from_field( XmlUtils::get_node_attribute_value(nodeChild, 
GLOM_ATTRIBUTE_KEY) );
-                relationship->set_to_table( XmlUtils::get_node_attribute_value(nodeChild, 
GLOM_ATTRIBUTE_OTHER_TABLE) );
-                relationship->set_to_field( XmlUtils::get_node_attribute_value(nodeChild, 
GLOM_ATTRIBUTE_OTHER_KEY) );
-                relationship->set_auto_create( XmlUtils::get_node_attribute_value_as_bool(nodeChild, 
GLOM_ATTRIBUTE_AUTO_CREATE) );
-                relationship->set_allow_edit( XmlUtils::get_node_attribute_value_as_bool(nodeChild, 
GLOM_ATTRIBUTE_ALLOW_EDIT) );
+                relationship->set_from_field( XmlUtils::get_node_attribute_value(node_rel, 
GLOM_ATTRIBUTE_KEY) );
+                relationship->set_to_table( XmlUtils::get_node_attribute_value(node_rel, 
GLOM_ATTRIBUTE_OTHER_TABLE) );
+                relationship->set_to_field( XmlUtils::get_node_attribute_value(node_rel, 
GLOM_ATTRIBUTE_OTHER_KEY) );
+                relationship->set_auto_create( XmlUtils::get_node_attribute_value_as_bool(node_rel, 
GLOM_ATTRIBUTE_AUTO_CREATE) );
+                relationship->set_allow_edit( XmlUtils::get_node_attribute_value_as_bool(node_rel, 
GLOM_ATTRIBUTE_ALLOW_EDIT) );
 
                 //Translations:
-                load_after_translations(nodeChild, relationship);
+                load_after_translations(node_rel, relationship);
 
                 doctableinfo->m_relationships.push_back(relationship);
               }
@@ -2717,23 +2717,23 @@ bool Document::load_after(int& failure_code)
             const auto type_names = Field::get_type_names();
 
             //Loop through Field child nodes:
-            auto listNodes = nodeFields->get_children(GLOM_NODE_FIELD);
-            for(const auto& node : listNodes)
+            auto list_nodes_fields = nodeFields->get_children(GLOM_NODE_FIELD);
+            for(const auto& item_field : list_nodes_fields)
             {
-              const auto nodeChild = dynamic_cast<xmlpp::Element*>(node);
-              if(nodeChild)
+              const auto node_field = dynamic_cast<xmlpp::Element*>(item_field);
+              if(node_field)
               {
                 std::shared_ptr<Field> field(new Field());
 
-                const auto strName = XmlUtils::get_node_attribute_value(nodeChild, GLOM_ATTRIBUTE_NAME);
+                const auto strName = XmlUtils::get_node_attribute_value(node_field, GLOM_ATTRIBUTE_NAME);
                 field->set_name( strName );
 
-                field->set_primary_key( XmlUtils::get_node_attribute_value_as_bool(nodeChild, 
GLOM_ATTRIBUTE_PRIMARY_KEY) );
-                field->set_unique_key( XmlUtils::get_node_attribute_value_as_bool(nodeChild, 
GLOM_ATTRIBUTE_UNIQUE) );
-                field->set_auto_increment( XmlUtils::get_node_attribute_value_as_bool(nodeChild, 
GLOM_ATTRIBUTE_AUTOINCREMENT) );
+                field->set_primary_key( XmlUtils::get_node_attribute_value_as_bool(node_field, 
GLOM_ATTRIBUTE_PRIMARY_KEY) );
+                field->set_unique_key( XmlUtils::get_node_attribute_value_as_bool(node_field, 
GLOM_ATTRIBUTE_UNIQUE) );
+                field->set_auto_increment( XmlUtils::get_node_attribute_value_as_bool(node_field, 
GLOM_ATTRIBUTE_AUTOINCREMENT) );
 
                 //Get lookup information, if present.
-                xmlpp::Element* nodeLookup = XmlUtils::get_node_child_named(nodeChild, 
GLOM_NODE_FIELD_LOOKUP);
+                xmlpp::Element* nodeLookup = XmlUtils::get_node_child_named(node_field, 
GLOM_NODE_FIELD_LOOKUP);
                 if(nodeLookup)
                 {
                   const auto lookup_relationship_name = XmlUtils::get_node_attribute_value(nodeLookup, 
GLOM_ATTRIBUTE_RELATIONSHIP_NAME);
@@ -2743,20 +2743,20 @@ bool Document::load_after(int& failure_code)
                   field->set_lookup_field( XmlUtils::get_node_attribute_value(nodeLookup, 
GLOM_ATTRIBUTE_FIELD) );
                 }
 
-                field->set_calculation( XmlUtils::get_child_text_node(nodeChild, GLOM_NODE_CALCULATION) );
+                field->set_calculation( XmlUtils::get_child_text_node(node_field, GLOM_NODE_CALCULATION) );
                 if(!(field->get_has_calculation())) //Try the deprecated attribute instead
-                  field->set_calculation( XmlUtils::get_node_attribute_value(nodeChild, 
GLOM_DEPRECATED_ATTRIBUTE_CALCULATION) );
+                  field->set_calculation( XmlUtils::get_node_attribute_value(node_field, 
GLOM_DEPRECATED_ATTRIBUTE_CALCULATION) );
 
                 //Field Type:
-                const auto field_type = XmlUtils::get_node_attribute_value(nodeChild, GLOM_ATTRIBUTE_TYPE);
+                const auto field_type = XmlUtils::get_node_attribute_value(node_field, GLOM_ATTRIBUTE_TYPE);
 
                 //Get the type enum for this string representation of the type:
                 Field::glom_field_type field_type_enum = Field::TYPE_INVALID;
-                for(const auto& the_pair : type_names)
+                for(const auto& type_pair : type_names)
                 {
-                  if(the_pair.second == field_type)
+                  if(type_pair.second == field_type)
                   {
-                    field_type_enum = the_pair.first;
+                    field_type_enum = type_pair.first;
                     break;
                   }
                 }
@@ -2765,15 +2765,15 @@ bool Document::load_after(int& failure_code)
                 //We set this after set_field_info(), because that gets a glom type from the (not-specified) 
gdatype. Yes, that's strange, and should probably be more explicit.
                 field->set_glom_type(field_type_enum);
 
-                field->set_default_value( XmlUtils::get_node_attribute_value_as_value(nodeChild, 
GLOM_ATTRIBUTE_DEFAULT_VALUE, field_type_enum) );
+                field->set_default_value( XmlUtils::get_node_attribute_value_as_value(node_field, 
GLOM_ATTRIBUTE_DEFAULT_VALUE, field_type_enum) );
 
                 //Default Formatting:
-                const auto elementFormatting = XmlUtils::get_node_child_named(nodeChild, GLOM_NODE_FORMAT);
+                const auto elementFormatting = XmlUtils::get_node_child_named(node_field, GLOM_NODE_FORMAT);
                 if(elementFormatting)
                   load_after_layout_item_formatting(elementFormatting, field->m_default_formatting, 
field_type_enum, table_name, strName);
 
                 //Translations:
-                load_after_translations(nodeChild, field);
+                load_after_translations(node_field, field);
 
                 doctableinfo->m_fields.push_back(field);
               }
@@ -2789,20 +2789,20 @@ bool Document::load_after(int& failure_code)
           {
             //Loop through example_row child nodes:
             xmlpp::Node::NodeList listExampleRows = nodeExampleRows->get_children(GLOM_NODE_EXAMPLE_ROW);
-            for(const auto& node : listExampleRows)
+            for(const auto& item_row : listExampleRows)
             {
-              const auto nodeChild = dynamic_cast<xmlpp::Element*>(node);
-              if(nodeChild)
+              const auto node_row = dynamic_cast<xmlpp::Element*>(item_row);
+              if(node_row)
               {
                 type_row_data field_values(doctableinfo->m_fields.size());
                 //Loop through value child nodes
-                xmlpp::Node::NodeList listNodes = nodeChild->get_children(GLOM_NODE_VALUE);
-                for(const auto& node : listNodes)
+                xmlpp::Node::NodeList list_nodes_values = node_row->get_children(GLOM_NODE_VALUE);
+                for(const auto& item_value : list_nodes_values)
                 {
-                  const auto nodeChild = dynamic_cast<xmlpp::Element*>(node);
-                  if(nodeChild)
+                  const auto node_value = dynamic_cast<xmlpp::Element*>(item_value);
+                  if(node_value)
                   {
-                    const auto column_name = nodeChild->get_attribute(GLOM_ATTRIBUTE_COLUMN);
+                    const auto column_name = node_value->get_attribute(GLOM_ATTRIBUTE_COLUMN);
                     if(column_name)
                     {
                       //std::cout << "DEBUG: column_name = " << column_name->get_value() << " fields size=" 
<< doctableinfo->m_fields.size() << std::endl;
@@ -2815,7 +2815,7 @@ bool Document::load_after(int& failure_code)
                         //std::cout << "  DEBUG: searching: field i=" << i << " =" << field->get_name() << 
std::endl;
                         if(field && (field->get_name() == column_name->get_value()))
                         {
-                          field_values[i] = XmlUtils::get_node_text_child_as_value(nodeChild, 
field->get_glom_type());
+                          field_values[i] = XmlUtils::get_node_text_child_as_value(node_value, 
field->get_glom_type());
                           //std::cout << "    DEBUG: document example value: field=" << field->get_name() << 
", value=" << field_values[i].to_string() << std::endl;
                           break;
                         }
@@ -2838,9 +2838,9 @@ bool Document::load_after(int& failure_code)
       //Look at each "table" node.
       //We do load the layouts separately, because we needed to load all the tables' relationships and tables
       //before we can load layouts that can use them.
-      for(const auto& node : listNodes)
+      for(const auto& node_table : list_nodes_tables)
       {
-        xmlpp::Element* nodeTable = dynamic_cast<xmlpp::Element*>(node);
+        xmlpp::Element* nodeTable = dynamic_cast<xmlpp::Element*>(node_table);
         if(nodeTable)
         {
           const auto table_name = XmlUtils::get_node_attribute_value(nodeTable, GLOM_ATTRIBUTE_NAME);
@@ -2850,32 +2850,32 @@ bool Document::load_after(int& failure_code)
           const auto nodeDataLayouts = XmlUtils::get_node_child_named(nodeTable, GLOM_NODE_DATA_LAYOUTS);
           if(nodeDataLayouts)
           {
-            xmlpp::Node::NodeList listNodes = nodeDataLayouts->get_children(GLOM_NODE_DATA_LAYOUT);
-            for(const auto& item : listNodes)
+            xmlpp::Node::NodeList list_nodes_data_layout = 
nodeDataLayouts->get_children(GLOM_NODE_DATA_LAYOUT);
+            for(const auto& item : list_nodes_data_layout)
             {
-              xmlpp::Element* node = dynamic_cast<xmlpp::Element*>(item);
-              if(node)
+              xmlpp::Element* node_data_layout = dynamic_cast<xmlpp::Element*>(item);
+              if(node_data_layout)
               {
-                const auto layout_name = XmlUtils::get_node_attribute_value(node, GLOM_ATTRIBUTE_NAME);
-                const auto layout_platform = XmlUtils::get_node_attribute_value(node, 
GLOM_ATTRIBUTE_LAYOUT_PLATFORM);
+                const auto layout_name = XmlUtils::get_node_attribute_value(node_data_layout, 
GLOM_ATTRIBUTE_NAME);
+                const auto layout_platform = XmlUtils::get_node_attribute_value(node_data_layout, 
GLOM_ATTRIBUTE_LAYOUT_PLATFORM);
 
                 type_list_layout_groups layout_groups;
 
-                const auto nodeGroups = XmlUtils::get_node_child_named(node, GLOM_NODE_DATA_LAYOUT_GROUPS);
-                if(nodeGroups)
+                const auto node_group = XmlUtils::get_node_child_named(node_data_layout, 
GLOM_NODE_DATA_LAYOUT_GROUPS);
+                if(node_group)
                 {
                   //Look at all its children:
-                  xmlpp::Node::NodeList listNodes = nodeGroups->get_children(GLOM_NODE_DATA_LAYOUT_GROUP);
-                  for(const auto& item : listNodes)
+                  xmlpp::Node::NodeList list_nodes_groups = 
node_group->get_children(GLOM_NODE_DATA_LAYOUT_GROUP);
+                  for(const auto& item_group : list_nodes_groups)
                   {
-                    const auto node = dynamic_cast<const xmlpp::Element*>(item);
-                    if(node)
+                    const auto node_layout_group = dynamic_cast<const xmlpp::Element*>(item_group);
+                    if(node_layout_group)
                     {
-                      const auto group_name = XmlUtils::get_node_attribute_value(node, GLOM_ATTRIBUTE_NAME);
+                      const auto group_name = XmlUtils::get_node_attribute_value(node_layout_group, 
GLOM_ATTRIBUTE_NAME);
                       if(!group_name.empty())
                       {
                         std::shared_ptr<LayoutGroup> group(new LayoutGroup());
-                        load_after_layout_group(node, table_name, group);
+                        load_after_layout_group(node_layout_group, table_name, group);
 
                         layout_groups.push_back(group);
                       }
@@ -2897,14 +2897,14 @@ bool Document::load_after(int& failure_code)
           const auto nodeReports = XmlUtils::get_node_child_named(nodeTable, GLOM_NODE_REPORTS);
           if(nodeReports)
           {
-            xmlpp::Node::NodeList listNodes = nodeReports->get_children(GLOM_NODE_REPORT);
-            for(const auto& item : listNodes)
+            xmlpp::Node::NodeList list_nodes_reports = nodeReports->get_children(GLOM_NODE_REPORT);
+            for(const auto& item_report : list_nodes_reports)
             {
-              xmlpp::Element* node = dynamic_cast<xmlpp::Element*>(item);
-              if(node)
+              xmlpp::Element* node_report = dynamic_cast<xmlpp::Element*>(item_report);
+              if(node_report)
               {
-                const auto report_name = XmlUtils::get_node_attribute_value(node, GLOM_ATTRIBUTE_NAME);
-                const auto show_table_title = XmlUtils::get_node_attribute_value_as_bool(node, 
GLOM_ATTRIBUTE_REPORT_SHOW_TABLE_TITLE);
+                const auto report_name = XmlUtils::get_node_attribute_value(node_report, 
GLOM_ATTRIBUTE_NAME);
+                const auto show_table_title = XmlUtils::get_node_attribute_value_as_bool(node_report, 
GLOM_ATTRIBUTE_REPORT_SHOW_TABLE_TITLE);
 
                 //type_list_layout_groups layout_groups;
 
@@ -2912,19 +2912,19 @@ bool Document::load_after(int& failure_code)
                 report->set_name(report_name);
                 report->set_show_table_title(show_table_title);
 
-                const auto nodeGroups = XmlUtils::get_node_child_named(node, GLOM_NODE_DATA_LAYOUT_GROUPS);
-                if(nodeGroups)
+                const auto node_group = XmlUtils::get_node_child_named(node_report, 
GLOM_NODE_DATA_LAYOUT_GROUPS);
+                if(node_group)
                 {
                   //Look at all its children:
-                  xmlpp::Node::NodeList listNodes = nodeGroups->get_children(GLOM_NODE_DATA_LAYOUT_GROUP);
-                  for(const auto& item : listNodes)
+                  xmlpp::Node::NodeList list_nodes_groups = 
node_group->get_children(GLOM_NODE_DATA_LAYOUT_GROUP);
+                  for(const auto& item_group : list_nodes_groups)
                   {
-                    const auto node = dynamic_cast<const xmlpp::Element*>(item);
-                    if(node)
+                    const auto node_layout_group = dynamic_cast<const xmlpp::Element*>(item_group);
+                    if(node_layout_group)
                     {
                       std::shared_ptr<LayoutGroup> group = report->get_layout_group();
                       group->remove_all_items();
-                      load_after_layout_group(node, table_name, group);
+                      load_after_layout_group(node_layout_group, table_name, group);
 
                       fill_layout_field_details(table_name, group); //Get full field details from the field 
names.
                     }
@@ -2932,7 +2932,7 @@ bool Document::load_after(int& failure_code)
                 }
 
                 //Translations:
-                load_after_translations(node, report);
+                load_after_translations(node_report, report);
 
                 doctableinfo->m_reports[report->get_name()] = report;
               }
@@ -2944,76 +2944,76 @@ bool Document::load_after(int& failure_code)
           const auto nodePrintLayouts = XmlUtils::get_node_child_named(nodeTable, GLOM_NODE_PRINT_LAYOUTS);
           if(nodePrintLayouts)
           {
-            xmlpp::Node::NodeList listNodes = nodePrintLayouts->get_children(GLOM_NODE_PRINT_LAYOUT);
-            for(const auto& item : listNodes)
+            xmlpp::Node::NodeList list_nodes_print_layout = 
nodePrintLayouts->get_children(GLOM_NODE_PRINT_LAYOUT);
+            for(const auto& item_print_layout : list_nodes_print_layout)
             {
-              xmlpp::Element* node = dynamic_cast<xmlpp::Element*>(item);
-              if(node)
+              xmlpp::Element* node_print_layout = dynamic_cast<xmlpp::Element*>(item_print_layout);
+              if(node_print_layout)
               {
-                const auto name = XmlUtils::get_node_attribute_value(node, GLOM_ATTRIBUTE_NAME);
-                const auto show_table_title = XmlUtils::get_node_attribute_value_as_bool(node, 
GLOM_ATTRIBUTE_REPORT_SHOW_TABLE_TITLE);
+                const auto name = XmlUtils::get_node_attribute_value(node_print_layout, GLOM_ATTRIBUTE_NAME);
+                const auto show_table_title = XmlUtils::get_node_attribute_value_as_bool(node_print_layout, 
GLOM_ATTRIBUTE_REPORT_SHOW_TABLE_TITLE);
 
                 std::shared_ptr<PrintLayout> print_layout(new PrintLayout());
                 print_layout->set_name(name);
                 print_layout->set_show_table_title(show_table_title);
 
                 print_layout->set_show_grid(
-                  XmlUtils::get_node_attribute_value_as_bool(node, GLOM_ATTRIBUTE_PRINT_LAYOUT_SHOW_GRID) );
+                  XmlUtils::get_node_attribute_value_as_bool(node_print_layout, 
GLOM_ATTRIBUTE_PRINT_LAYOUT_SHOW_GRID) );
                 print_layout->set_show_rules(
-                  XmlUtils::get_node_attribute_value_as_bool(node, GLOM_ATTRIBUTE_PRINT_LAYOUT_SHOW_RULES) );
+                  XmlUtils::get_node_attribute_value_as_bool(node_print_layout, 
GLOM_ATTRIBUTE_PRINT_LAYOUT_SHOW_RULES) );
                 print_layout->set_show_outlines(
-                  XmlUtils::get_node_attribute_value_as_bool(node, 
GLOM_ATTRIBUTE_PRINT_LAYOUT_SHOW_OUTLINES) );
+                  XmlUtils::get_node_attribute_value_as_bool(node_print_layout, 
GLOM_ATTRIBUTE_PRINT_LAYOUT_SHOW_OUTLINES) );
 
                 //Get the horizontal and vertical rules:
                 PrintLayout::type_vec_doubles vec_rules_h;
-                xmlpp::Node::NodeList listRules = node->get_children(GLOM_NODE_HORIZONTAL_RULE);
-                for(const auto& item : listRules)
+                xmlpp::Node::NodeList listRules = node_print_layout->get_children(GLOM_NODE_HORIZONTAL_RULE);
+                for(const auto& item_rule : listRules)
                 {
-                  const auto node = dynamic_cast<const xmlpp::Element*>(item);
-                  if(!node)
+                  const auto node_rule = dynamic_cast<const xmlpp::Element*>(item_rule);
+                  if(!node_rule)
                     continue;
 
-                  const auto pos = XmlUtils::get_node_attribute_value_as_decimal(node, 
GLOM_ATTRIBUTE_RULE_POSITION);
+                  const auto pos = XmlUtils::get_node_attribute_value_as_decimal(node_rule, 
GLOM_ATTRIBUTE_RULE_POSITION);
                   vec_rules_h.push_back(pos);
                 }
-               print_layout->set_horizontal_rules(vec_rules_h);
+                print_layout->set_horizontal_rules(vec_rules_h);
 
-               PrintLayout::type_vec_doubles vec_rules_v;
-                listRules = node->get_children(GLOM_NODE_VERTICAL_RULE);
-                for(const auto& item : listRules)
+                PrintLayout::type_vec_doubles vec_rules_v;
+                listRules = node_print_layout->get_children(GLOM_NODE_VERTICAL_RULE);
+                for(const auto& item_rule : listRules)
                 {
-                  const auto node = dynamic_cast<const xmlpp::Element*>(item);
-                  if(!node)
+                  const auto node_rule = dynamic_cast<const xmlpp::Element*>(item_rule);
+                  if(!node_rule)
                     continue;
 
-                  const auto pos = XmlUtils::get_node_attribute_value_as_decimal(node, 
GLOM_ATTRIBUTE_RULE_POSITION);
+                  const auto pos = XmlUtils::get_node_attribute_value_as_decimal(node_rule, 
GLOM_ATTRIBUTE_RULE_POSITION);
                   vec_rules_v.push_back(pos);
                 }
-               print_layout->set_vertical_rules(vec_rules_v);
+                print_layout->set_vertical_rules(vec_rules_v);
 
 
                 //Page Setup:
-                const auto key_file_text = XmlUtils::get_child_text_node(node, GLOM_NODE_PAGE_SETUP);
+                const auto key_file_text = XmlUtils::get_child_text_node(node_print_layout, 
GLOM_NODE_PAGE_SETUP);
                 print_layout->set_page_setup(key_file_text);
                 
                 print_layout->set_page_count(
-                  XmlUtils::get_node_attribute_value_as_decimal(node, 
GLOM_ATTRIBUTE_PRINT_LAYOUT_PAGE_COUNT, 1));
+                  XmlUtils::get_node_attribute_value_as_decimal(node_print_layout, 
GLOM_ATTRIBUTE_PRINT_LAYOUT_PAGE_COUNT, 1));
                  
 
                 //Layout Groups:
-                const auto nodeGroups = XmlUtils::get_node_child_named(node, GLOM_NODE_DATA_LAYOUT_GROUPS);
+                const auto nodeGroups = XmlUtils::get_node_child_named(node_print_layout, 
GLOM_NODE_DATA_LAYOUT_GROUPS);
                 if(nodeGroups)
                 {
                   //Look at all its children:
-                  xmlpp::Node::NodeList listNodes = nodeGroups->get_children(GLOM_NODE_DATA_LAYOUT_GROUP);
-                  for(const auto& item : listNodes)
+                  xmlpp::Node::NodeList list_nodes_data_layout_group = 
nodeGroups->get_children(GLOM_NODE_DATA_LAYOUT_GROUP);
+                  for(const auto& item_group : list_nodes_data_layout_group)
                   {
-                    const auto node = dynamic_cast<const xmlpp::Element*>(item);
-                    if(node)
+                    const auto node_layout_group = dynamic_cast<const xmlpp::Element*>(item_group);
+                    if(node_layout_group)
                     {
                       std::shared_ptr<LayoutGroup> group = print_layout->get_layout_group();
                       group->remove_all_items();
-                      load_after_layout_group(node, table_name, group, true /* load positions too. */);
+                      load_after_layout_group(node_layout_group, table_name, group, true /* load positions 
too. */);
 
                       fill_layout_field_details(table_name, group); //Get full field details from the field 
names.
                     }
@@ -3021,7 +3021,7 @@ bool Document::load_after(int& failure_code)
                 }
 
                 //Translations:
-                load_after_translations(node, print_layout);
+                load_after_translations(node_print_layout, print_layout);
 
                 doctableinfo->m_print_layouts[print_layout->get_name()] = print_layout;
               }
@@ -3036,32 +3036,32 @@ bool Document::load_after(int& failure_code)
           const auto nodeGroups = XmlUtils::get_node_child_named(nodeRoot, GLOM_NODE_GROUPS);
           if(nodeGroups)
           {
-            xmlpp::Node::NodeList listNodes = nodeGroups->get_children(GLOM_NODE_GROUP);
-            for(const auto& item : listNodes)
+            xmlpp::Node::NodeList list_nodes_groups = nodeGroups->get_children(GLOM_NODE_GROUP);
+            for(const auto& item_group : list_nodes_groups)
             {
-              xmlpp::Element* node = dynamic_cast<xmlpp::Element*>(item);
-              if(node)
+              xmlpp::Element* node_group = dynamic_cast<xmlpp::Element*>(item_group);
+              if(node_group)
               {
                 GroupInfo group_info;
 
-                group_info.set_name( XmlUtils::get_node_attribute_value(node, GLOM_ATTRIBUTE_NAME) );
-                group_info.m_developer = XmlUtils::get_node_attribute_value_as_bool(node, 
GLOM_ATTRIBUTE_DEVELOPER);
+                group_info.set_name( XmlUtils::get_node_attribute_value(node_group, GLOM_ATTRIBUTE_NAME) );
+                group_info.m_developer = XmlUtils::get_node_attribute_value_as_bool(node_group, 
GLOM_ATTRIBUTE_DEVELOPER);
 
-                xmlpp::Node::NodeList listTablePrivs = node->get_children(GLOM_NODE_TABLE_PRIVS);
-                for(const auto& item : listTablePrivs)
+                xmlpp::Node::NodeList listTablePrivs = node_group->get_children(GLOM_NODE_TABLE_PRIVS);
+                for(const auto& item_priv : listTablePrivs)
                 {
-                  xmlpp::Element* node = dynamic_cast<xmlpp::Element*>(item);
-                  if(node)
+                  xmlpp::Element* node_priv = dynamic_cast<xmlpp::Element*>(item_priv);
+                  if(node_priv)
                   {
-                    const auto table_name = XmlUtils::get_node_attribute_value(node, 
GLOM_ATTRIBUTE_TABLE_NAME);
+                    const auto priv_table_name = XmlUtils::get_node_attribute_value(node_priv, 
GLOM_ATTRIBUTE_TABLE_NAME);
 
                     Privileges privs;
-                    privs.m_view = XmlUtils::get_node_attribute_value_as_bool(node, 
GLOM_ATTRIBUTE_PRIV_VIEW);
-                    privs.m_edit = XmlUtils::get_node_attribute_value_as_bool(node, 
GLOM_ATTRIBUTE_PRIV_EDIT);
-                    privs.m_create = XmlUtils::get_node_attribute_value_as_bool(node, 
GLOM_ATTRIBUTE_PRIV_CREATE);
-                    privs.m_delete = XmlUtils::get_node_attribute_value_as_bool(node, 
GLOM_ATTRIBUTE_PRIV_DELETE);
+                    privs.m_view = XmlUtils::get_node_attribute_value_as_bool(node_priv, 
GLOM_ATTRIBUTE_PRIV_VIEW);
+                    privs.m_edit = XmlUtils::get_node_attribute_value_as_bool(node_priv, 
GLOM_ATTRIBUTE_PRIV_EDIT);
+                    privs.m_create = XmlUtils::get_node_attribute_value_as_bool(node_priv, 
GLOM_ATTRIBUTE_PRIV_CREATE);
+                    privs.m_delete = XmlUtils::get_node_attribute_value_as_bool(node_priv, 
GLOM_ATTRIBUTE_PRIV_DELETE);
 
-                    group_info.m_map_privileges[table_name] = privs;
+                    group_info.m_map_privileges[priv_table_name] = privs;
                   }
                 }
 
@@ -3077,25 +3077,25 @@ bool Document::load_after(int& failure_code)
           const auto nodeModules = XmlUtils::get_node_child_named(nodeRoot, GLOM_NODE_LIBRARY_MODULES);
           if(nodeModules)
           {
-            xmlpp::Node::NodeList listNodes = nodeModules->get_children(GLOM_NODE_LIBRARY_MODULE);
-            for(const auto& item : listNodes)
+            xmlpp::Node::NodeList nodes_lib_modules = nodeModules->get_children(GLOM_NODE_LIBRARY_MODULE);
+            for(const auto& item : nodes_lib_modules)
             {
-              xmlpp::Element* node = dynamic_cast<xmlpp::Element*>(item);
-              if(node)
+              xmlpp::Element* node_lib_module = dynamic_cast<xmlpp::Element*>(item);
+              if(node_lib_module)
               {
                 //The name is in an attribute:
-                const auto module_name = XmlUtils::get_node_attribute_value(node, 
GLOM_ATTRIBUTE_LIBRARY_MODULE_NAME);
+                const auto module_name = XmlUtils::get_node_attribute_value(node_lib_module, 
GLOM_ATTRIBUTE_LIBRARY_MODULE_NAME);
 
                 //The string is in a child text node:
                 Glib::ustring script;
 
-                const auto text_child = node->get_child_text();
+                const auto text_child = node_lib_module->get_child_text();
                 if(text_child)
                   script = text_child->get_content();
 
                 //Fall back to the deprecated attribute:
                 if(script.empty())
-                  script = XmlUtils::get_node_attribute_value(node, GLOM_ATTRIBUTE_LIBRARY_MODULE_SCRIPT);
+                  script = XmlUtils::get_node_attribute_value(node_lib_module, 
GLOM_ATTRIBUTE_LIBRARY_MODULE_SCRIPT);
 
                 m_map_library_scripts[module_name] = script;
               }
@@ -3259,14 +3259,14 @@ void Document::save_before_sort_by(xmlpp::Element* node, const LayoutItem_GroupB
   if(!node)
     return;
 
-  for(const auto& the_pair : list_fields)
+  for(const auto& field_pair : list_fields)
   {
-    std::shared_ptr<const LayoutItem_Field> field = the_pair.first;
+    std::shared_ptr<const LayoutItem_Field> field = field_pair.first;
 
     xmlpp::Element* nodeChild = node->add_child(GLOM_NODE_DATA_LAYOUT_ITEM_FIELD);
     save_before_layout_item_field(nodeChild, field);
 
-    XmlUtils::set_node_attribute_value_as_bool(nodeChild, GLOM_ATTRIBUTE_SORT_ASCENDING, the_pair.second);
+    XmlUtils::set_node_attribute_value_as_bool(nodeChild, GLOM_ATTRIBUTE_SORT_ASCENDING, field_pair.second);
   }
 }
 
@@ -3576,11 +3576,11 @@ void Document::save_before_translations(xmlpp::Element* element, const std::shar
   xmlpp::Element* child = element->add_child(GLOM_NODE_TRANSLATIONS_SET);
 
   const auto map_translations = item->_get_translations_map();
-  for(const auto& the_pair : map_translations)
+  for(const auto& translation_pair : map_translations)
   {
     xmlpp::Element* childItem = child->add_child(GLOM_NODE_TRANSLATION);
-    XmlUtils::set_node_attribute_value(childItem, GLOM_ATTRIBUTE_TRANSLATION_LOCALE, the_pair.first);
-    XmlUtils::set_node_attribute_value(childItem, GLOM_ATTRIBUTE_TRANSLATION_VALUE, the_pair.second);
+    XmlUtils::set_node_attribute_value(childItem, GLOM_ATTRIBUTE_TRANSLATION_LOCALE, translation_pair.first);
+    XmlUtils::set_node_attribute_value(childItem, GLOM_ATTRIBUTE_TRANSLATION_VALUE, translation_pair.second);
   }
 
   //If it has a singular title, then save that too:
@@ -3694,14 +3694,14 @@ bool Document::save_before()
     XmlUtils::set_node_attribute_value(nodeConnection, GLOM_ATTRIBUTE_CONNECTION_DATABASE, 
m_connection_database);
 
     //Remove existing tables:
-    xmlpp::Node::NodeList listNodes = nodeRoot->get_children(GLOM_NODE_TABLE);
-    for(const auto& item : listNodes)
+    xmlpp::Node::NodeList list_nodes_tables = nodeRoot->get_children(GLOM_NODE_TABLE);
+    for(const auto& item : list_nodes_tables)
       nodeRoot->remove_child(item);
 
     //Add tables:
-  for(const auto& the_pair : m_tables)
+  for(const auto& table_pair : m_tables)
     {
-      const std::shared_ptr<const DocumentTableInfo> doctableinfo = the_pair.second;
+      const std::shared_ptr<const DocumentTableInfo> doctableinfo = table_pair.second;
       if(!doctableinfo || !doctableinfo->m_info)
         continue;
 
@@ -3837,11 +3837,11 @@ bool Document::save_before()
         xmlpp::Element* nodeReports = nodeTable->add_child(GLOM_NODE_REPORTS);
 
         //Add the groups:
-        for(const auto& the_pair : doctableinfo->m_reports)
+        for(const auto& report_pair : doctableinfo->m_reports)
         {
           xmlpp::Element* nodeReport = nodeReports->add_child(GLOM_NODE_REPORT);
 
-          std::shared_ptr<const Report> report = the_pair.second;
+          std::shared_ptr<const Report> report = report_pair.second;
           XmlUtils::set_node_attribute_value(nodeReport, GLOM_ATTRIBUTE_NAME, report->get_name());
           XmlUtils::set_node_attribute_value_as_bool(nodeReport, GLOM_ATTRIBUTE_REPORT_SHOW_TABLE_TITLE, 
report->get_show_table_title());
 
@@ -3856,11 +3856,11 @@ bool Document::save_before()
         xmlpp::Element* nodePrintLayouts = nodeTable->add_child(GLOM_NODE_PRINT_LAYOUTS);
 
         //Add the print :
-        for(const auto& the_pair : doctableinfo->m_print_layouts)
+        for(const auto& print_layout_pair : doctableinfo->m_print_layouts)
         {
           xmlpp::Element* nodePrintLayout = nodePrintLayouts->add_child(GLOM_NODE_PRINT_LAYOUT);
 
-          std::shared_ptr<const PrintLayout> print_layout = the_pair.second;
+          std::shared_ptr<const PrintLayout> print_layout = print_layout_pair.second;
           XmlUtils::set_node_attribute_value(nodePrintLayout, GLOM_ATTRIBUTE_NAME, print_layout->get_name());
           XmlUtils::set_node_attribute_value_as_bool(nodePrintLayout, 
GLOM_ATTRIBUTE_REPORT_SHOW_TABLE_TITLE, print_layout->get_show_table_title());
 
@@ -3906,8 +3906,8 @@ bool Document::save_before()
 
 
     //Remove existing groups:
-    listNodes = nodeRoot->get_children(GLOM_NODE_GROUPS);
-    for(const auto& item : listNodes)
+    auto list_nodes_groups = nodeRoot->get_children(GLOM_NODE_GROUPS);
+    for(const auto& item : list_nodes_groups)
       nodeRoot->remove_child(item);
 
     //Add groups:
@@ -3915,9 +3915,9 @@ bool Document::save_before()
 
     nodeGroups->add_child_comment("These are only used when recreating a database from an example file. The 
actual access-control is on the server, of course.");
 
-    for(const auto& the_pair : m_groups)
+    for(const auto& group_pair : m_groups)
     {
-      const GroupInfo& group_info = the_pair.second;
+      const GroupInfo& group_info = group_pair.second;
 
       const auto group_name = group_info.get_name();
       if(group_name.empty())
@@ -3932,13 +3932,13 @@ bool Document::save_before()
       XmlUtils::set_node_attribute_value_as_bool(nodeGroup, GLOM_ATTRIBUTE_DEVELOPER, 
group_info.m_developer);
 
       //The privileges for each table, for this group:
-      for(const auto& the_pair : group_info.m_map_privileges)
+      for(const auto& priv_pair : group_info.m_map_privileges)
       {
         xmlpp::Element* nodeTablePrivs = nodeGroup->add_child(GLOM_NODE_TABLE_PRIVS);
 
-        XmlUtils::set_node_attribute_value(nodeTablePrivs, GLOM_ATTRIBUTE_TABLE_NAME, the_pair.first);
+        XmlUtils::set_node_attribute_value(nodeTablePrivs, GLOM_ATTRIBUTE_TABLE_NAME, priv_pair.first);
 
-        const Privileges& privs = the_pair.second;
+        const Privileges& privs = priv_pair.second;
         XmlUtils::set_node_attribute_value_as_bool(nodeTablePrivs, GLOM_ATTRIBUTE_PRIV_VIEW, privs.m_view);
         XmlUtils::set_node_attribute_value_as_bool(nodeTablePrivs, GLOM_ATTRIBUTE_PRIV_EDIT, privs.m_edit);
         XmlUtils::set_node_attribute_value_as_bool(nodeTablePrivs, GLOM_ATTRIBUTE_PRIV_CREATE, 
privs.m_create);
@@ -3947,17 +3947,17 @@ bool Document::save_before()
     }
 
     //Remove existing library modules::
-    listNodes = nodeRoot->get_children(GLOM_NODE_LIBRARY_MODULES);
-    for(const auto& item : listNodes)
+    auto list_nodes_lib_modules = nodeRoot->get_children(GLOM_NODE_LIBRARY_MODULES);
+    for(const auto& item : list_nodes_lib_modules)
       nodeRoot->remove_child(item);
 
     //Add groups:
     xmlpp::Element* nodeModules = nodeRoot->add_child(GLOM_NODE_LIBRARY_MODULES);
 
-    for(const auto& the_pair : m_map_library_scripts)
+    for(const auto& script_pair : m_map_library_scripts)
     {
-      const Glib::ustring& name = the_pair.first;
-      const Glib::ustring& script = the_pair.second;
+      const Glib::ustring& name = script_pair.first;
+      const Glib::ustring& script = script_pair.second;
 
       xmlpp::Element* nodeModule = nodeModules->add_child(GLOM_NODE_LIBRARY_MODULE);
 
@@ -4011,9 +4011,9 @@ Glib::ustring Document::get_name() const
 Document::type_list_groups Document::get_groups() const
 {
   type_list_groups result;
-  for(const auto& the_pair : m_groups)
+  for(const auto& group_pair : m_groups)
   {
-    result.push_back(the_pair.second);
+    result.push_back(group_pair.second);
   }
 
   return result;
@@ -4057,9 +4057,9 @@ std::vector<Glib::ustring> Document::get_report_names(const Glib::ustring& table
   if(info)
   {
     std::vector<Glib::ustring> result;
-    for(const auto& the_pair : info->m_reports)
+    for(const auto& report_pair : info->m_reports)
     {
-      result.push_back(the_pair.second->get_name());
+      result.push_back(report_pair.second->get_name());
     }
 
     return result;
@@ -4115,9 +4115,9 @@ std::vector<Glib::ustring> Document::get_print_layout_names(const Glib::ustring&
   if(info)
   {
     std::vector<Glib::ustring> result;
-    for(const auto& the_pair : info->m_print_layouts)
+    for(const auto& print_layout_pair : info->m_print_layouts)
     {
-      result.push_back(the_pair.second->get_name());
+      result.push_back(print_layout_pair.second->get_name());
     }
 
     return result;
@@ -4695,9 +4695,9 @@ guint Document::get_latest_known_document_format_version()
 std::vector<Glib::ustring> Document::get_library_module_names() const
 {
   std::vector<Glib::ustring> result;
-  for(const auto& the_pair : m_map_library_scripts)
+  for(const auto& script_pair : m_map_library_scripts)
   {
-    result.push_back(the_pair.first);
+    result.push_back(script_pair.first);
   }
 
   return result;
diff --git a/glom/libglom/privs.cc b/glom/libglom/privs.cc
index b9ddb97..6a85657 100644
--- a/glom/libglom/privs.cc
+++ b/glom/libglom/privs.cc
@@ -134,47 +134,47 @@ Privs::type_vec_strings Privs::get_database_users(const Glib::ustring& group_nam
   }
   else
   {
-    Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+    Glib::RefPtr<Gnome::Gda::SqlBuilder> builderGroup =
       Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
-    builder->select_add_field("groname", "pg_group");
-    builder->select_add_field("grolist", "pg_group");
-    builder->select_add_target("pg_group");
-    builder->set_where(
-      builder->add_cond(Gnome::Gda::SQL_OPERATOR_TYPE_EQ,
-        builder->add_field_id("groname", "pg_group"),
-        builder->add_expr(group_name)));
+    builderGroup->select_add_field("groname", "pg_group");
+    builderGroup->select_add_field("grolist", "pg_group");
+    builderGroup->select_add_target("pg_group");
+    builderGroup->set_where(
+      builderGroup->add_cond(Gnome::Gda::SQL_OPERATOR_TYPE_EQ,
+        builderGroup->add_field_id("groname", "pg_group"),
+        builderGroup->add_expr(group_name)));
     //TODO: Show SQL.
-    Glib::RefPtr<Gnome::Gda::DataModel> data_model = DbUtils::query_execute_select(builder);
-    if(data_model && data_model->get_n_rows())
+    Glib::RefPtr<Gnome::Gda::DataModel> data_model_group = DbUtils::query_execute_select(builderGroup);
+    if(data_model_group && data_model_group->get_n_rows())
     {
-      const auto rows_count = data_model->get_n_rows();
+      const auto rows_count = data_model_group->get_n_rows();
       for(int row = 0; row < rows_count; ++row)
       {
-        const auto value = data_model->get_value_at(1, row); //Column 1 is the /* the user list.
+        const auto value_group = data_model_group->get_value_at(1, row); //Column 1 is the /* the user list.
         //pg_group is a string, formatted, bizarrely, like so: "{100, 101}".
 
         Glib::ustring group_list;
-        if(!value.is_null())
-          group_list = value.get_string();
+        if(!value_group.is_null())
+          group_list = value_group.get_string();
 
         type_vec_strings vecUserIds = pg_list_separate(group_list);
         for(const auto& userId: vecUserIds)
         {
           //TODO_Performance: Can we do this in one SQL SELECT?
-          Glib::RefPtr<Gnome::Gda::SqlBuilder> builder =
+          Glib::RefPtr<Gnome::Gda::SqlBuilder> builderUser =
             Gnome::Gda::SqlBuilder::create(Gnome::Gda::SQL_STATEMENT_SELECT);
-          builder->select_add_field("usename", "pg_user");
-          builder->select_add_target("pg_user");
-          builder->set_where(
-            builder->add_cond(Gnome::Gda::SQL_OPERATOR_TYPE_EQ,
-              builder->add_field_id("usesysid", "pg_user"),
-              builder->add_expr(userId)));
-          Glib::RefPtr<Gnome::Gda::DataModel> data_model = DbUtils::query_execute_select(builder);
-          if(data_model && data_model->get_n_rows() && data_model->get_n_columns())
+          builderUser->select_add_field("usename", "pg_user");
+          builderUser->select_add_target("pg_user");
+          builderUser->set_where(
+            builderUser->add_cond(Gnome::Gda::SQL_OPERATOR_TYPE_EQ,
+              builderUser->add_field_id("usesysid", "pg_user"),
+              builderUser->add_expr(userId)));
+          Glib::RefPtr<Gnome::Gda::DataModel> data_model_user = DbUtils::query_execute_select(builderUser);
+          if(data_model_user && data_model_user->get_n_rows() && data_model_user->get_n_columns())
           {
-            const auto value = data_model->get_value_at(0, 0);
+            const auto value_user = data_model_user->get_value_at(0, 0);
             //std::cout << G_STRFUNC << "DEBUG:  username=" << value.get_string() << std::endl; 
-            result.push_back(value.get_string());
+            result.push_back(value_user.get_string());
           }
           else
           {
diff --git a/glom/libglom/python_embed/py_glom_related.cc b/glom/libglom/python_embed/py_glom_related.cc
index 19e86e1..76614cb 100644
--- a/glom/libglom/python_embed/py_glom_related.cc
+++ b/glom/libglom/python_embed/py_glom_related.cc
@@ -46,10 +46,10 @@ PyGlomRelated::type_map_relationships::size_type PyGlomRelated::len() const
 
 boost::python::object PyGlomRelated::getitem(const boost::python::object& cppitem)
 {
-  boost::python::extract<std::string> extractor(cppitem);
-  if(extractor.check())
+  boost::python::extract<std::string> extractor_item(cppitem);
+  if(extractor_item.check())
   {
-    const std::string key = extractor;
+    const std::string key = extractor_item;
     if(!key.empty())
     {
       //Return a cached item if possible:
@@ -70,10 +70,10 @@ boost::python::object PyGlomRelated::getitem(const boost::python::object& cppite
           std::shared_ptr<Relationship> relationship = iterFind->second;
           const auto from_key = relationship->get_from_field();
 
-          boost::python::extract<PyGlomRecord*> extractor(m_record);
-          if(extractor.check())
+          boost::python::extract<PyGlomRecord*> extractor_record(m_record);
+          if(extractor_record.check())
           {
-            PyGlomRecord* record = extractor;
+            PyGlomRecord* record = extractor_record;
             PyGlomRecord::type_map_field_values::const_iterator iterFromKey = 
record->m_map_field_values.find(from_key);
             if(iterFromKey != record->m_map_field_values.end())
             {
diff --git a/glom/libglom/report_builder.cc b/glom/libglom/report_builder.cc
index 478150e..d63a8a1 100644
--- a/glom/libglom/report_builder.cc
+++ b/glom/libglom/report_builder.cc
@@ -461,7 +461,6 @@ bool ReportBuilder::report_build_records_field(const FoundSet& found_set, xmlpp:
     nodeField->set_attribute("vertical", "true");
 
   Gnome::Gda::Value value;
-  Glib::ustring text_value;
 
   if(!datamodel) //We call this for headers and footers too.
   {
@@ -471,15 +470,15 @@ bool ReportBuilder::report_build_records_field(const FoundSet& found_set, xmlpp:
     builder->set_table(field->get_table_used(found_set.m_table_name));
     builder->select_add_field(field->get_name(), found_set.m_table_name);
     builder->select_set_limit(1);
-    Glib::RefPtr<Gnome::Gda::DataModel> datamodel = DbUtils::query_execute_select(builder);
+    Glib::RefPtr<Gnome::Gda::DataModel> datamodel_syspref = DbUtils::query_execute_select(builder);
 
-    if(!datamodel)
+    if(!datamodel_syspref)
     {
       std::cerr << G_STRFUNC << ": The SQL query failed." << std::endl;
       return false;
     }
 
-    value = datamodel->get_value_at(colField, row); //TODO: Catch exceptions.
+    value = datamodel_syspref->get_value_at(colField, row); //TODO: Catch exceptions.
     colField = 0;
   }
   else
@@ -500,8 +499,8 @@ bool ReportBuilder::report_build_records_field(const FoundSet& found_set, xmlpp:
     if(text_value.empty() && std::dynamic_pointer_cast<const LayoutItem_FieldSummary>(field) && (field_type 
== Field::TYPE_NUMERIC))
     {
       //Use get_text_for_gda_value() instead of "0" so we get the correct numerical formatting:
-      const auto value = Conversions::parse_value(0);
-      text_value = Conversions::get_text_for_gda_value(field_type, value, m_locale, 
field->get_formatting_used().m_numeric_format);
+      const auto value_zero = Conversions::parse_value(0);
+      text_value = Conversions::get_text_for_gda_value(field_type, value_zero, m_locale, 
field->get_formatting_used().m_numeric_format);
     }
 
     nodeField->set_attribute("value", text_value);
diff --git a/glom/libglom/utils.cc b/glom/libglom/utils.cc
index 8c0e471..d2c9093 100644
--- a/glom/libglom/utils.cc
+++ b/glom/libglom/utils.cc
@@ -338,7 +338,6 @@ static void builder_add_join(const Glib::RefPtr<Gnome::Gda::SqlBuilder>& builder
 void Utils::build_sql_select_add_fields_to_get(const Glib::RefPtr<Gnome::Gda::SqlBuilder>& builder, const 
Glib::ustring& table_name, const type_vecConstLayoutFields& fieldsToGet, const type_sort_clause& sort_clause, 
bool extra_join)
 {
   //Get all relationships used in the query:
-  typedef std::list< std::shared_ptr<const UsesRelationship> > type_list_relationships;
   type_list_relationships list_relationships;
 
   for(const auto& layout_item : fieldsToGet)
diff --git a/glom/mode_data/box_data_calendar_related.cc b/glom/mode_data/box_data_calendar_related.cc
index 8889433..fb46ed8 100644
--- a/glom/mode_data/box_data_calendar_related.cc
+++ b/glom/mode_data/box_data_calendar_related.cc
@@ -366,7 +366,6 @@ void Box_Data_Calendar_Related::on_dialog_layout_hide()
   std::shared_ptr<LayoutItem_CalendarPortal> pLayoutItem = 
std::dynamic_pointer_cast<LayoutItem_CalendarPortal>(get_layout_item());
   if(pLayoutItem)
   {
-    std::shared_ptr<LayoutItem_CalendarPortal> derived_portal = 
std::dynamic_pointer_cast<LayoutItem_CalendarPortal>(m_portal);
     if(derived_portal)
       *pLayoutItem = *derived_portal;
 
diff --git a/glom/mode_data/box_data_details.cc b/glom/mode_data/box_data_details.cc
index 8926703..5407a39 100644
--- a/glom/mode_data/box_data_details.cc
+++ b/glom/mode_data/box_data_details.cc
@@ -297,17 +297,17 @@ bool Box_Data_Details::fill_from_database()
       if(table_privs.m_view)
       {
         //Add extra possibly-non-visible columns that we need:
-        std::shared_ptr<LayoutItem_Field> layout_item = std::make_shared<LayoutItem_Field>();
-        layout_item->set_full_field_details(m_field_primary_key);
+        std::shared_ptr<LayoutItem_Field> layout_item_pk = std::make_shared<LayoutItem_Field>();
+        layout_item_pk->set_full_field_details(m_field_primary_key);
 
         //Get the primary key index, adding the primary key if necessary:
         //TODO_Performance: Do this for create_layout() only, instead of repeating it for each refresh?:
         int index_primary_key = -1; //Arbitrary default.
         //g_warning("primary_key name = %s", m_field_primary_key->get_name().c_str());
-        const auto iterFind = std::find_if(fieldsToGet.begin(), fieldsToGet.end(), 
predicate_LayoutItem_Field_IsSameField<LayoutItem_Field>(layout_item));
+        const auto iterFind = std::find_if(fieldsToGet.begin(), fieldsToGet.end(), 
predicate_LayoutItem_Field_IsSameField<LayoutItem_Field>(layout_item_pk));
         if(iterFind == fieldsToGet.end())
         {
-          fieldsToGet.push_back(layout_item);
+          fieldsToGet.push_back(layout_item_pk);
           index_primary_key = fieldsToGet.size() - 1;
         }
         else
@@ -321,11 +321,11 @@ bool Box_Data_Details::fill_from_database()
             if(!element)
               continue;
 
-            if(element->get_name() != layout_item->get_name())
+            if(element->get_name() != layout_item_pk->get_name())
               continue;
 
             //Compare the relationship and related relationship:
-            std::shared_ptr<const UsesRelationship> uses_a = layout_item;
+            std::shared_ptr<const UsesRelationship> uses_a = layout_item_pk;
             std::shared_ptr<const UsesRelationship> uses_b = element;
             if(*uses_a == *uses_b)
             {
@@ -853,10 +853,10 @@ void Box_Data_Details::on_flowtable_field_edited(const std::shared_ptr<const Lay
       else
       {
         //Make a new record, and show it:
-        const auto primary_key_value = DbUtils::get_next_auto_increment_value(m_table_name, 
m_field_primary_key->get_name());
+        const auto primary_key_value_autoincrement = DbUtils::get_next_auto_increment_value(m_table_name, 
m_field_primary_key->get_name());
 
-        record_new(true /* use entered field data */, primary_key_value);
-        refresh_data_from_database_with_primary_key(primary_key_value);
+        record_new(true /* use entered field data */, primary_key_value_autoincrement);
+        refresh_data_from_database_with_primary_key(primary_key_value_autoincrement);
       }
     }
     else
@@ -940,13 +940,13 @@ void Box_Data_Details::print_layout()
   //breaks because those spaces would be empty space on the page after
   //we have moved items down when expanding:
   //TODO: Squash that space when expanding custom layouts.
-  std::shared_ptr<PrintLayout> print_layout = 
+  std::shared_ptr<PrintLayout> layout = 
     PrintLayoutUtils::create_standard(page_setup, m_table_name, document,
       false /* do not avoid page margins */);
   
   //Show the print preview window:
   AppWindow* app = AppWindow::get_appwindow();
-  PrintLayoutUtils::do_print_layout(print_layout, m_found_set,
+  PrintLayoutUtils::do_print_layout(layout, m_found_set,
     false /* not preview */, document, true /* avoid page margins */, app);
 }
 
@@ -964,12 +964,12 @@ void Box_Data_Details::prepare_layout_dialog(Dialog_Layout* dialog)
     dialog->init(m_layout_name, m_layout_platform, get_document(), m_table_name, m_FieldsShown); //TODO: Use 
m_TableFields?
 }
 
-void Box_Data_Details::show_layout_toolbar(bool show)
+void Box_Data_Details::show_layout_toolbar(bool show_toolbar)
 {
   //Remember this so we can use it in the show_all() vfunc.
-  m_show_toolbar = show;
+  m_show_toolbar = show_toolbar;
 
-  if(show)
+  if(show_toolbar)
     m_Dragbar.show();
   else
     m_Dragbar.hide();
diff --git a/glom/mode_data/box_data_details.h b/glom/mode_data/box_data_details.h
index 03460cd..5187b25 100644
--- a/glom/mode_data/box_data_details.h
+++ b/glom/mode_data/box_data_details.h
@@ -64,7 +64,7 @@ public:
   type_signal_requested_related_details signal_requested_related_details();
 
 #ifndef GLOM_ENABLE_CLIENT_ONLY
-  void show_layout_toolbar(bool show = true);
+  void show_layout_toolbar(bool show_toolbar = true);
 #endif
 
   void do_new_record();
diff --git a/glom/mode_data/datawidget/combochoiceswithtreemodel.cc 
b/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
index d9a71d9..395fce7 100644
--- a/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
+++ b/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
@@ -447,11 +447,11 @@ int ComboChoicesWithTreeModel::get_fixed_cell_height(Gtk::Widget& widget)
     // when all columns are known.
 
     //Get a default:
-    const Glib::RefPtr<const Pango::Layout> refLayout = widget.create_pango_layout("example");
-    int width = 0;
-    int height = 0;
-    refLayout->get_pixel_size(width, height);
-    m_fixed_cell_height = height;
+    const Glib::RefPtr<const Pango::Layout> refLayoutDefault = widget.create_pango_layout("example");
+    int width_default = 0;
+    int height_default = 0;
+    refLayoutDefault->get_pixel_size(width_default, height_default);
+    m_fixed_cell_height = height_default;
 
     //Look at each column:
     for(const auto& item : m_db_layout_items)
diff --git a/glom/mode_data/datawidget/treemodel_db.cc b/glom/mode_data/datawidget/treemodel_db.cc
index 9ac698c..54693ab 100644
--- a/glom/mode_data/datawidget/treemodel_db.cc
+++ b/glom/mode_data/datawidget/treemodel_db.cc
@@ -751,8 +751,8 @@ DbTreeModel::iterator DbTreeModel::append()
 
   //Create the iterator to the new row:
   iterator iter;
-  const auto iter_is_valid = create_iterator(datamodel_row, iter);
-  if(iter_is_valid)
+  const auto the_iter_is_valid = create_iterator(datamodel_row, iter);
+  if(the_iter_is_valid)
   {
     row_inserted(get_path(iter), iter); //Allow the TreeView to respond to the addition.
   }
diff --git a/glom/mode_data/db_adddel/db_adddel.cc b/glom/mode_data/db_adddel/db_adddel.cc
index 2d0f41f..bb93f30 100644
--- a/glom/mode_data/db_adddel/db_adddel.cc
+++ b/glom/mode_data/db_adddel/db_adddel.cc
@@ -342,9 +342,9 @@ 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 = list_indexes.begin(); //Just get the first displayed 
instance of this field->
+        type_list_indexes::const_iterator iter_begin = list_indexes.begin(); //Just get the first displayed 
instance of this field->
 
-        const guint col_real = *iter + get_count_hidden_system_columns();
+        const guint col_real = *iter_begin + get_count_hidden_system_columns();
         treerow.get_value(col_real, value);
       }
     }
@@ -513,11 +513,11 @@ guint DbAddDel::get_fixed_cell_height()
     // when all columns are known.
 
     //Get a default:
-    Glib::RefPtr<Pango::Layout> refLayout = m_TreeView.create_pango_layout("ExampleEg");
-    int width = 0;
-    int height = 0;
-    refLayout->get_pixel_size(width, height);
-    m_fixed_cell_height = height;
+    Glib::RefPtr<Pango::Layout> refLayoutDefault = m_TreeView.create_pango_layout("ExampleEg");
+    int width_default = 0;
+    int height_default = 0;
+    refLayoutDefault->get_pixel_size(width_default, height_default);
+    m_fixed_cell_height = height_default;
 
     //Look at each column:
     for(auto iter = m_column_items.begin(); iter != m_column_items.end(); ++iter)
@@ -2087,9 +2087,8 @@ bool DbAddDel::start_new_record()
   if(fieldPrimaryKey && fieldPrimaryKey->get_auto_increment())
   {
     //Start editing in the first cell that is not auto_increment:
-    for(auto iter = m_column_items.begin(); iter != m_column_items.end(); ++iter)
+    for(const auto& layout_item : m_column_items)
     {
-      std::shared_ptr<LayoutItem> layout_item = *iter;
       std::shared_ptr<LayoutItem_Field> layout_item_field = 
std::dynamic_pointer_cast<LayoutItem_Field>(layout_item);
       if(!(layout_item_field->get_full_field_details()->get_auto_increment()))
       {
diff --git a/glom/mode_data/flowtablewithfields.cc b/glom/mode_data/flowtablewithfields.cc
index cb6c7a3..dac7f14 100644
--- a/glom/mode_data/flowtablewithfields.cc
+++ b/glom/mode_data/flowtablewithfields.cc
@@ -413,12 +413,12 @@ void FlowTableWithFields::add_layout_notebook(const std::shared_ptr<LayoutItem_N
         notebook_widget->append_page(*event_box, *tab_label);
 
         //Add child items:
-        LayoutGroup::type_list_items items = group->get_items();
-        for(const auto& item : items)
+        LayoutGroup::type_list_items child_items = group->get_items();
+        for(const auto& child_item : child_items)
         {
-          if(item)
+          if(child_item)
           {
-            flow_table->add_layout_item(item);
+            flow_table->add_layout_item(child_item);
           }
         }
 
@@ -1069,14 +1069,14 @@ void FlowTableWithFields::on_datawidget_layout_item_added(LayoutWidgetBase::enum
   //so the new item will be after that item, next to it.
 
   //Get the widget's layout item:
-  std::shared_ptr<const LayoutItem> layout_item = pDataWidget->get_layout_item();
-  if(!layout_item)
+  std::shared_ptr<const LayoutItem> layout_item_parent = pDataWidget->get_layout_item();
+  if(!layout_item_parent)
   {
-    std::cerr << G_STRFUNC << ": layout_item is null." << std::endl;
+    std::cerr << G_STRFUNC << ": layout_item_parent is null." << std::endl;
     return;
   }
 
-  //std::cout << "debug: layout_item name=" << layout_item->get_name() << std::endl;
+  //std::cout << "debug: layout_item_parent name=" << layout_item_parent->get_name() << std::endl;
 
   //Get the group that the widget's layout item is in:
   std::shared_ptr<LayoutGroup> layout_group = std::dynamic_pointer_cast<LayoutGroup>(get_layout_item());
@@ -1144,7 +1144,7 @@ void FlowTableWithFields::on_datawidget_layout_item_added(LayoutWidgetBase::enum
 
   if(layout_item_new)
   {
-    layout_group->add_item(layout_item_new, layout_item);
+    layout_group->add_item(layout_item_new, layout_item_parent);
 
     //We have changed the structure itself in the document, because we are using the same structure via 
std::shared_ptr.
     //So we just tell the parent widgets to rebuild the layout from the document:
diff --git a/glom/mode_design/fields/box_db_table_definition.cc 
b/glom/mode_design/fields/box_db_table_definition.cc
index c611d50..f18cda3 100644
--- a/glom/mode_design/fields/box_db_table_definition.cc
+++ b/glom/mode_design/fields/box_db_table_definition.cc
@@ -378,8 +378,8 @@ void Box_DB_Table_Definition::on_adddel_changed(const Gtk::TreeModel::iterator&
       std::cerr << G_STRFUNC << ": field not found: " << strFieldNameBeingEdited << std::endl;
     else
     {
-      std::shared_ptr<const Field> constfield = *iterFind;
-      m_Field_BeingEdited = constfield;
+      std::shared_ptr<const Field> const_field_found = *iterFind;
+      m_Field_BeingEdited = const_field_found;
 
       //Get new field definition:
       std::shared_ptr<Field> fieldNew = get_field_definition(row);
diff --git a/glom/mode_design/layout/combobox_relationship.cc 
b/glom/mode_design/layout/combobox_relationship.cc
index cd869ef..15f5fdb 100644
--- a/glom/mode_design/layout/combobox_relationship.cc
+++ b/glom/mode_design/layout/combobox_relationship.cc
@@ -129,9 +129,9 @@ void ComboBox_Relationship::set_selected_relationship(const Glib::ustring& relat
         {
           for(const auto& sub_row : row.children())
           {
-            std::shared_ptr<Relationship> relationship = sub_row[m_model_columns.m_relationship];
-            const auto this_name = glom_get_sharedptr_name(relationship);
-            if(this_name == related_relationship_name)
+            std::shared_ptr<Relationship> sub_relationship = sub_row[m_model_columns.m_relationship];
+            const auto rel_name = glom_get_sharedptr_name(sub_relationship);
+            if(rel_name == related_relationship_name)
             {
               set_active(sub_row);
               return; //success
@@ -175,13 +175,13 @@ void ComboBox_Relationship::set_relationships(Document* document, const Glib::us
     if(show_related_relationships && !Document::get_relationship_is_system_properties(rel))
     {
       const auto sub_relationships = document->get_relationships(rel->get_to_table(), false /* plus system 
properties */);
-      for(const auto& rel : sub_relationships)
+      for(const auto& sub_rel : sub_relationships)
       {
         auto tree_iter_child = m_model->append(tree_iter->children());
-        Gtk::TreeModel::Row row = *tree_iter_child;
+        Gtk::TreeModel::Row child_row = *tree_iter_child;
 
-        row[m_model_columns.m_relationship] = rel;
-        row[m_model_columns.m_separator] = false;
+        child_row[m_model_columns.m_relationship] = sub_rel;
+        child_row[m_model_columns.m_separator] = false;
       }
     }
   }
diff --git a/glom/mode_design/layout/dialog_layout_details.cc 
b/glom/mode_design/layout/dialog_layout_details.cc
index 9d05163..75af2b9 100644
--- a/glom/mode_design/layout/dialog_layout_details.cc
+++ b/glom/mode_design/layout/dialog_layout_details.cc
@@ -246,7 +246,6 @@ void Dialog_Layout_Details::fill_group(const Gtk::TreeModel::iterator& iter, std
       {
         //std::cout << "debug: " << G_STRFUNC << ": adding group." << std::endl;
         std::shared_ptr<LayoutGroup> layout_group = std::dynamic_pointer_cast<LayoutGroup>(layout_item);
-        std::shared_ptr<LayoutItem_Portal> layout_portal = 
std::dynamic_pointer_cast<LayoutItem_Portal>(layout_group);
         if(layout_group && !layout_portal)
         {
           //Recurse:
@@ -273,8 +272,8 @@ void Dialog_Layout_Details::add_group(const Gtk::TreeModel::iterator& parent, co
   if(!group)
    return;
 
-  std::shared_ptr<const LayoutItem_Portal> portal = std::dynamic_pointer_cast<const 
LayoutItem_Portal>(group);
-  if(portal)
+  std::shared_ptr<const LayoutItem_Portal> parent_portal = std::dynamic_pointer_cast<const 
LayoutItem_Portal>(group);
+  if(parent_portal)
     return; //This method is not for portals.
 
   Gtk::TreeModel::iterator iterNewGroup;
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 70cef17..6020168 100644
--- a/glom/mode_design/print_layouts/window_print_layout_edit.cc
+++ b/glom/mode_design/print_layouts/window_print_layout_edit.cc
@@ -525,9 +525,6 @@ void Window_PrintLayout_Edit::on_canvas_drag_data_received(const Glib::RefPtr<Gd
 
     Glib::RefPtr<CanvasLayoutItem> item =
       create_canvas_layout_item_and_add(layout_item);
-    double item_x = x;
-    double item_y = y;
-    canvas_convert_from_drag_pixels(item_x, item_y, true /* adjust for scrolling */);
     item->snap_position(item_x, item_y);
     item->set_xy(item_x, item_y);
    
diff --git a/glom/mode_design/relationships_overview/canvas_group_dbtable.cc 
b/glom/mode_design/relationships_overview/canvas_group_dbtable.cc
index 6d3c562..c2810b9 100644
--- a/glom/mode_design/relationships_overview/canvas_group_dbtable.cc
+++ b/glom/mode_design/relationships_overview/canvas_group_dbtable.cc
@@ -50,32 +50,32 @@ CanvasGroupDbTable::CanvasGroupDbTable(const Glib::ustring& table_name, const Gl
   m_table_height = field_height * (fields.size() + 1);
 
   
-  Glib::RefPtr<CanvasRectMovable> m_rect = CanvasRectMovable::create(x, y, m_table_width, m_table_height);
-  m_rect->property_line_width() = 2.0;
-  m_rect->property_radius_x() = 4.0,
-  m_rect->property_radius_y() = 4.0;
-  m_rect->property_stroke_color() = "black";
-  m_rect->property_fill_color() = "white";
-  m_rect->set_movement_allowed(false, false); //Move only as part of the parent group.
-  add_child(m_rect);
+  Glib::RefPtr<CanvasRectMovable> rect = CanvasRectMovable::create(x, y, m_table_width, m_table_height);
+  rect->property_line_width() = 2.0;
+  rect->property_radius_x() = 4.0,
+  rect->property_radius_y() = 4.0;
+  rect->property_stroke_color() = "black";
+  rect->property_fill_color() = "white";
+  rect->set_movement_allowed(false, false); //Move only as part of the parent group.
+  add_child(rect);
 
   const Glib::ustring title = "<b>" + table_title + "</b>";
-  Glib::RefPtr<CanvasTextMovable> m_text = CanvasTextMovable::create(title,
+  Glib::RefPtr<CanvasTextMovable> text = CanvasTextMovable::create(title,
     x + margin, y + margin, m_table_width - margin*2,
     Goocanvas::ANCHOR_NORTH_WEST);
-  m_text->property_font() = "Sans 12"; //TODO: Let the user specify this.
-  m_text->property_use_markup() = true;
-  m_text->set_movement_allowed(false, false); //Move only as part of the parent group.
-  add_child(m_text);
+  text->property_font() = "Sans 12"; //TODO: Let the user specify this.
+  text->property_use_markup() = true;
+  text->set_movement_allowed(false, false); //Move only as part of the parent group.
+  add_child(text);
 
-  Glib::RefPtr<CanvasLineMovable> m_line = CanvasLineMovable::create();
+  Glib::RefPtr<CanvasLineMovable> line = CanvasLineMovable::create();
   double points_coordinates[] = {x, y + field_height, x + m_table_width, y + field_height};
   Goocanvas::Points points(2, points_coordinates);
-  m_line->property_points() = points;
-  m_line->property_stroke_color() = "black";
-  m_line->property_line_width() = 1.0;
-  m_line->set_movement_allowed(false, false); //Move only as part of the parent group.
-  add_child(m_line);
+  line->property_points() = points;
+  line->property_stroke_color() = "black";
+  line->property_line_width() = 1.0;
+  line->set_movement_allowed(false, false); //Move only as part of the parent group.
+  add_child(line);
 
 
   //Add the table's fields:
@@ -83,13 +83,13 @@ CanvasGroupDbTable::CanvasGroupDbTable(const Glib::ustring& table_name, const Gl
   for(const auto& field : fields)
   {
     //Show the primary key as bold:
-    Glib::ustring title;
+    Glib::ustring title_field;
     if(field->get_primary_key())
-      title = "<u>" + item_get_title_or_name(field) + "</u>";
+      title_field = "<u>" + item_get_title_or_name(field) + "</u>";
     else
-      title = item_get_title_or_name(field);
+      title_field = item_get_title_or_name(field);
 
-    Glib::RefPtr<CanvasTextMovable> text_item = CanvasTextMovable::create(title, 
+    Glib::RefPtr<CanvasTextMovable> text_item = CanvasTextMovable::create(title_field, 
       x + margin, y + margin + field_y, m_table_width - margin*2,
       Goocanvas::ANCHOR_NORTH_WEST);
     text_item->property_font() = "Sans 12"; //TODO: Let the user specify this.
diff --git a/glom/mode_design/relationships_overview/canvas_group_dbtable.h 
b/glom/mode_design/relationships_overview/canvas_group_dbtable.h
index 2b73809..2d00849 100644
--- a/glom/mode_design/relationships_overview/canvas_group_dbtable.h
+++ b/glom/mode_design/relationships_overview/canvas_group_dbtable.h
@@ -45,10 +45,6 @@ public:
   double get_field_y(const Glib::ustring& field_name) const;
 
 private:
-   Glib::RefPtr<Goocanvas::Item> m_rect;
-   Glib::RefPtr<Goocanvas::Item> m_text;
-   Glib::RefPtr<Goocanvas::Item> m_line;
-
    Glib::ustring m_table_name;
    double m_table_height;
    static double m_table_width;
diff --git a/glom/mode_design/report_layout/dialog_layout_report.cc 
b/glom/mode_design/report_layout/dialog_layout_report.cc
index 94b1658..4eff5ca 100644
--- a/glom/mode_design/report_layout/dialog_layout_report.cc
+++ b/glom/mode_design/report_layout/dialog_layout_report.cc
@@ -282,20 +282,20 @@ void Dialog_Layout_Report::add_group_children(const Glib::RefPtr<type_model>& mo
 {
   for(const auto& item : group->m_list_items)
   {
-    std::shared_ptr<const LayoutGroup> group = std::dynamic_pointer_cast<const LayoutGroup>(item);
-    if(group)
+    std::shared_ptr<const LayoutGroup> child_group = std::dynamic_pointer_cast<const LayoutGroup>(item);
+    if(child_group)
     {
       std::shared_ptr<const LayoutItem_Header> header = std::dynamic_pointer_cast<const 
LayoutItem_Header>(item);
       std::shared_ptr<const LayoutItem_Footer> footer = std::dynamic_pointer_cast<const 
LayoutItem_Footer>(item);
 
       //Special-case the header and footer so that their items go into the separate treeviews:
       if(header)
-        add_group_children(m_model_parts_header, parent, group); //Without the Header group being explicitly 
shown.
+        add_group_children(m_model_parts_header, parent, child_group); //Without the Header group being 
explicitly shown.
       else if(footer)
-        add_group_children(m_model_parts_footer, parent, group);  //Without the Footer group being 
explicitly shown.
+        add_group_children(m_model_parts_footer, parent, child_group);  //Without the Footer group being 
explicitly shown.
       else
       {
-        add_group(model_parts, parent, group);
+        add_group(model_parts, parent, child_group);
       }
     }
     else
diff --git a/glom/mode_design/users/dialog_groups_list.cc b/glom/mode_design/users/dialog_groups_list.cc
index b37b580..1329f6e 100644
--- a/glom/mode_design/users/dialog_groups_list.cc
+++ b/glom/mode_design/users/dialog_groups_list.cc
@@ -507,23 +507,19 @@ void Dialog_GroupsList::on_treeview_tables_toggled_view(const Glib::ustring& pat
     const auto group_name = get_selected_group();
     const Glib::ustring table_name = row[m_model_columns_tables.m_col_name];
 
-    bool test = set_table_privilege(table_name, group_name, bActive, PRIV_VIEW);
-    if(test)
+    if(set_table_privilege(table_name, group_name, bActive, PRIV_VIEW))
       row[m_model_columns_tables.m_col_view] = bActive;
 
     //If the group cannot view, then it should not do anything else either:
     if(!bActive)
     {
-      bool test = set_table_privilege(table_name, group_name, bActive, PRIV_EDIT);
-      if(test)
+     if(set_table_privilege(table_name, group_name, bActive, PRIV_EDIT))
         row[m_model_columns_tables.m_col_edit] = false;
 
-      test = set_table_privilege(table_name, group_name, bActive, PRIV_CREATE);
-      if(test)
+      if(set_table_privilege(table_name, group_name, bActive, PRIV_CREATE))
         row[m_model_columns_tables.m_col_create] = false;
 
-      test = set_table_privilege(table_name, group_name, bActive, PRIV_DELETE);
-      if(test)
+      if(set_table_privilege(table_name, group_name, bActive, PRIV_DELETE))
         row[m_model_columns_tables.m_col_delete] = false;
     }
   }
diff --git a/glom/mode_design/users/dialog_users_list.cc b/glom/mode_design/users/dialog_users_list.cc
index 43336be..247d55f 100644
--- a/glom/mode_design/users/dialog_users_list.cc
+++ b/glom/mode_design/users/dialog_users_list.cc
@@ -210,9 +210,8 @@ void Dialog_UsersList::on_button_user_add()
   if(!user.empty())
   {
     //Add it to the group:
-    const auto strQuery = DbUtils::build_query_add_user_to_group(m_combo_group->get_active_text(), user);
-    const auto test = DbUtils::query_execute_string(strQuery);
-    if(!test)
+    const auto query_add_user = DbUtils::build_query_add_user_to_group(m_combo_group->get_active_text(), 
user);
+    if(!DbUtils::query_execute_string(query_add_user))
       std::cerr << G_STRFUNC << ": ALTER GROUP failed." << std::endl;
 
     //Remove any user rights, so that all rights come from the user's presence in the group:
@@ -221,9 +220,8 @@ void Dialog_UsersList::on_button_user_add()
     for(const auto& table : table_list)
     {
       const auto table_name = table->get_name();
-      const Glib::ustring strQuery = "REVOKE ALL PRIVILEGES ON " + DbUtils::escape_sql_id(table_name) + " 
FROM " + DbUtils::escape_sql_id(user);
-      const auto test = DbUtils::query_execute_string(strQuery);
-      if(!test)
+      const Glib::ustring query_revoke = "REVOKE ALL PRIVILEGES ON " + DbUtils::escape_sql_id(table_name) + 
" FROM " + DbUtils::escape_sql_id(user);
+      if(!DbUtils::query_execute_string(query_revoke))
         std::cerr << G_STRFUNC << ": REVOKE failed." << std::endl;
     }
 
diff --git a/glom/navigation/box_tables.cc b/glom/navigation/box_tables.cc
index ab96c43..72e5ac2 100644
--- a/glom/navigation/box_tables.cc
+++ b/glom/navigation/box_tables.cc
@@ -378,9 +378,9 @@ void Box_Tables::on_adddel_changed(const Gtk::TreeModel::iterator& row, guint co
       {
         //Set all the other rows to false:
         Glib::RefPtr<Gtk::TreeModel> model = m_AddDel.get_model();
-        for(const auto& row : model->children())
+        for(const auto& child_row : model->children())
         {
-          m_AddDel.set_value(row, m_colDefault, false);
+          m_AddDel.set_value(child_row, m_colDefault, false);
         }
       }
 
diff --git a/glom/print_layout/canvas_layout_item.cc b/glom/print_layout/canvas_layout_item.cc
index 85d0645..4243afc 100644
--- a/glom/print_layout/canvas_layout_item.cc
+++ b/glom/print_layout/canvas_layout_item.cc
@@ -470,8 +470,8 @@ void CanvasLayoutItem::set_db_data(const Gnome::Gda::Value& value)
       if(text_value.empty() && std::dynamic_pointer_cast<const LayoutItem_FieldSummary>(field) && 
(field_type == Field::TYPE_NUMERIC))
       {
         //Use get_text_for_gda_value() instead of "0" so we get the correct numerical formatting:
-        const auto value = Conversions::parse_value(0);
-        text_value = Conversions::get_text_for_gda_value(field_type, value, 
field->get_formatting_used().m_numeric_format);
+        const auto value_zero = Conversions::parse_value(0);
+        text_value = Conversions::get_text_for_gda_value(field_type, value_zero, 
field->get_formatting_used().m_numeric_format);
       }
 
       canvas_item->set_text(text_value);
diff --git a/glom/print_layout/canvas_print_layout.cc b/glom/print_layout/canvas_print_layout.cc
index a7f3e20..09eb800 100644
--- a/glom/print_layout/canvas_print_layout.cc
+++ b/glom/print_layout/canvas_print_layout.cc
@@ -157,18 +157,18 @@ Glib::RefPtr<CanvasLayoutItem> Canvas_PrintLayout::create_canvas_item(const std:
 void Canvas_PrintLayout::add_layout_group_children(const std::shared_ptr<LayoutGroup>& group)
 {
   //TODO: Add them inside the group item (when we actually use this code):
-  for(const auto& item : group->m_list_items)
+  for(const auto& child_item : group->m_list_items)
   {
-    std::shared_ptr<LayoutItem_Portal> portal = std::dynamic_pointer_cast<LayoutItem_Portal>(item);
-    std::shared_ptr<LayoutGroup> group = std::dynamic_pointer_cast<LayoutGroup>(item);
-    if(group && !portal)
+    std::shared_ptr<LayoutItem_Portal> child_portal = 
std::dynamic_pointer_cast<LayoutItem_Portal>(child_item);
+    std::shared_ptr<LayoutGroup> child_group = std::dynamic_pointer_cast<LayoutGroup>(child_item);
+    if(child_group && !child_portal)
     {
-      add_layout_group(group);
+      add_layout_group(child_group);
       continue;
     }
     else
     {
-      create_canvas_layout_item_and_add(item);
+      create_canvas_layout_item_and_add(child_item);
     }
   }
 
diff --git a/glom/python_embed/glom_python.cc b/glom/python_embed/glom_python.cc
index e11a297..e2fbad9 100644
--- a/glom/python_embed/glom_python.cc
+++ b/glom/python_embed/glom_python.cc
@@ -107,9 +107,9 @@ static Glib::ustring get_traceback()
   }
   else
   {
-    boost::python::object traceback(boost::python::import("traceback"));
-    boost::python::object format_exception(traceback.attr("format_exception"));
-    boost::python::object formatted_list(format_exception(hexc,hval,htb));
+    boost::python::object cpp_traceback(boost::python::import("traceback"));
+    boost::python::object format_exception(cpp_traceback.attr("format_exception"));
+    boost::python::object formatted_list(format_exception(hexc, hval, htb));
     boost::python::object formatted(boost::python::str("").join(formatted_list));
     const std::string result = boost::python::extract<std::string>(formatted);
     return result;
diff --git a/glom/utility_widgets/adddel/adddel.cc b/glom/utility_widgets/adddel/adddel.cc
index 89b9435..8961362 100644
--- a/glom/utility_widgets/adddel/adddel.cc
+++ b/glom/utility_widgets/adddel/adddel.cc
@@ -609,19 +609,19 @@ void AddDel::construct_specified_columns()
         case(AddDelColumnInfo::STYLE_Choices):
         {
           //Use a custom CellRenderer:
-          CellRendererList* pCellRenderer = Gtk::manage( new CellRendererList() );
+          CellRendererList* pCellRendererList = Gtk::manage( new CellRendererList() );
 
           //Add the choices:
           const type_vec_strings vecStrings = m_ColumnTypes[model_column_index].m_choices;
           for(const auto& item : vecStrings)
           {
-            pCellRenderer->append_list_item(item);
+            pCellRendererList->append_list_item(item);
           }
 
           // Append the View column.
           // We use a derived Gtk::TreeViewColumn so that we can store extra information in it.
           // This means that we must reimplement the code from the convenience template methods from gtkmm.
-          treeview_append_column( Utils::string_escape_underscores(column_name), *pCellRenderer,  
*pModelColumn, column_id);
+          treeview_append_column( Utils::string_escape_underscores(column_name), *pCellRendererList,  
*pModelColumn, column_id);
 
           break;
         }
@@ -654,29 +654,29 @@ void AddDel::construct_specified_columns()
 
       if(m_ColumnTypes[model_column_index].m_editable)
       {
-        Gtk::CellRendererText* pCellRenderer = 
dynamic_cast<Gtk::CellRendererText*>(m_TreeView.get_column_cell_renderer(view_column_index));
-        if(pCellRenderer)
+        Gtk::CellRendererText* pCellRendererText = 
dynamic_cast<Gtk::CellRendererText*>(m_TreeView.get_column_cell_renderer(view_column_index));
+        if(pCellRendererText)
         {
           //Connect a signal handler:
-          if(pCellRenderer)
+          if(pCellRendererText)
           {
             //Make it editable:
-            pCellRenderer->property_editable() = true;
+            pCellRendererText->property_editable() = true;
 
             //Connect to its signal:
-            pCellRenderer->signal_edited().connect(
+            pCellRendererText->signal_edited().connect(
               sigc::bind( sigc::mem_fun(*this, &AddDel::on_treeview_cell_edited), model_column_index) );
           }
         }
         else
         {
-           Gtk::CellRendererToggle* pCellRenderer = 
dynamic_cast<Gtk::CellRendererToggle*>(m_TreeView.get_column_cell_renderer(view_column_index));
-           if(pCellRenderer)
+           Gtk::CellRendererToggle* pCellRendererToggle = 
dynamic_cast<Gtk::CellRendererToggle*>(m_TreeView.get_column_cell_renderer(view_column_index));
+           if(pCellRendererToggle)
            {
-             pCellRenderer->property_activatable() = true;
+             pCellRendererToggle->property_activatable() = true;
 
              //Connect to its signal:
-             pCellRenderer->signal_toggled().connect(
+             pCellRendererToggle->signal_toggled().connect(
                sigc::bind( sigc::mem_fun(*this, &AddDel::on_treeview_cell_edited_bool), model_column_index ) 
);
            }
         }
@@ -1234,9 +1234,9 @@ void AddDel::on_treeview_cell_edited(const Glib::ustring& path_string, const Gli
                 {
                   refTreeSelection->select(row); //TODO: This does not seem to work.
 
-                 Gtk::TreeModel::Path path = m_refListStore->get_path(row);
+                 Gtk::TreeModel::Path path_to_activate = m_refListStore->get_path(row);
                  Gtk::TreeView::Column* pColumn = m_TreeView.get_column(model_column_index); //TODO: This 
might the the view column index, not the model column index.
-                 m_TreeView.set_cursor(path, *pColumn, true /* start_editing */); //This highlights the 
cell, but does not seem to actually start the editing.
+                 m_TreeView.set_cursor(path_to_activate, *pColumn, true /* start_editing */); //This 
highlights the cell, but does not seem to actually start the editing.
                }
              }
 
diff --git a/glom/utility_widgets/canvas/canvas_editable.cc b/glom/utility_widgets/canvas/canvas_editable.cc
index 8d42098..2235ffe 100644
--- a/glom/utility_widgets/canvas/canvas_editable.cc
+++ b/glom/utility_widgets/canvas/canvas_editable.cc
@@ -62,8 +62,8 @@ void CanvasEditable::add_item(const Glib::RefPtr<Goocanvas::Item>& item, const G
     Glib::RefPtr<CanvasItemMovable> movable = Glib::RefPtr<CanvasItemMovable>::cast_dynamic(item);
     if(movable)
     {
-      Glib::RefPtr<CanvasGroupResizable> resizable = CanvasGroupResizable::create();
-      resizable->set_grid(m_grid);
+      Glib::RefPtr<CanvasGroupResizable> resizable_item = CanvasGroupResizable::create();
+      resizable_item->set_grid(m_grid);
 
       //Specify the resizable's position, using the child's position:
       double x = 0;
@@ -72,11 +72,11 @@ void CanvasEditable::add_item(const Glib::RefPtr<Goocanvas::Item>& item, const G
       double width = 0;
       double height = 0;
       movable->get_width_height(width, height);
-      resizable->set_xy(x, y);
-      resizable->set_width_height(width, height);
+      resizable_item->set_xy(x, y);
+      resizable_item->set_width_height(width, height);
 
-      group->add_child(resizable);
-      resizable->set_child(movable); //Puts draggable corners and edges around it.
+      group->add_child(resizable_item);
+      resizable_item->set_child(movable); //Puts draggable corners and edges around it.
 
       added = true;
     }
@@ -164,9 +164,9 @@ CanvasEditable::type_vec_doubles CanvasEditable::get_vertical_rules() const
   return m_grid->get_vertical_rules();
 }
 
-void CanvasEditable::show_temp_rule(double x, double y, bool show)
+void CanvasEditable::show_temp_rule(double x, double y, bool show_rule)
 {
-  m_grid->show_temp_rule(x, y, show);
+  m_grid->show_temp_rule(x, y, show_rule);
 }
 
 void CanvasEditable::set_grid_gap(double gap)
diff --git a/glom/utility_widgets/canvas/canvas_editable.h b/glom/utility_widgets/canvas/canvas_editable.h
index 74754ff..aee9ee1 100644
--- a/glom/utility_widgets/canvas/canvas_editable.h
+++ b/glom/utility_widgets/canvas/canvas_editable.h
@@ -67,7 +67,7 @@ public:
 
   /** Either @a x or @a y should be 0.
    */
-  void show_temp_rule(double x, double y, bool show = true);
+  void show_temp_rule(double x, double y, bool show_rule = true);
 
   /** For items not added directly via add_item(),
    * but which need to snap to the grid.
diff --git a/glom/utility_widgets/canvas/canvas_image_movable.cc 
b/glom/utility_widgets/canvas/canvas_image_movable.cc
index 7fb36ed..2df1127 100644
--- a/glom/utility_widgets/canvas/canvas_image_movable.cc
+++ b/glom/utility_widgets/canvas/canvas_image_movable.cc
@@ -153,12 +153,12 @@ void CanvasImageMovable::set_snap_corner(Corners corner)
   m_snap_corner = corner;
 }
 
-void CanvasImageMovable::set_image(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf, bool scale)
+void CanvasImageMovable::set_image(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf, bool scale_image)
 {
   property_pixbuf() = pixbuf;
   m_pixbuf = pixbuf;
 
-  if(scale)
+  if(scale_image)
     scale_to_size();
  
   m_image_empty = false;
diff --git a/glom/utility_widgets/flowtable.cc b/glom/utility_widgets/flowtable.cc
index 57e2ec5..80420aa 100644
--- a/glom/utility_widgets/flowtable.cc
+++ b/glom/utility_widgets/flowtable.cc
@@ -66,11 +66,12 @@ const Gtk::Box* FlowTable::get_parent_hbox(const Gtk::Widget* first) const
     if(box_children.empty())
       continue;
 
-    const auto iter_find = 
+    const auto iter_find_box = 
       std::find(box_children.begin(), box_children.end(), first);
-    if(iter_find != box_children.end())
+    if(iter_find_box != box_children.end())
       return hbox;
   }
+
   return 0;
 }
 
diff --git a/glom/utility_widgets/imageglom.cc b/glom/utility_widgets/imageglom.cc
index 797ee7b..8759767 100644
--- a/glom/utility_widgets/imageglom.cc
+++ b/glom/utility_widgets/imageglom.cc
@@ -402,11 +402,11 @@ void ImageGlom::show_image_data()
       
     bool use_gdkpixbuf = false;
     fill_gdkpixbuf_supported_mime_types();
-    const auto iterFind = 
+    const auto iter_find_mime_type = 
       std::find(m_gdkpixbuf_supported_mime_types.begin(),
         m_gdkpixbuf_supported_mime_types.end(),
         mime_type);
-    if(iterFind != m_gdkpixbuf_supported_mime_types.end())
+    if(iter_find_mime_type != m_gdkpixbuf_supported_mime_types.end())
     {
       use_gdkpixbuf = true;
     }
@@ -777,22 +777,22 @@ void ImageGlom::on_menupopup_activate_select_file()
     const auto uri = dialog.get_uri();
     if(!uri.empty())
     {
-      DialogImageLoadProgress* dialog;
-      Utils::get_glade_widget_derived_with_warning(dialog);
-      if(dialog)
+      DialogImageLoadProgress* dialog_progress = nullptr;
+      Utils::get_glade_widget_derived_with_warning(dialog_progress);
+      if(dialog_progress)
       {
         // Automatically delete the dialog when we no longer need it:
-        std::shared_ptr<Gtk::Dialog> dialog_keeper(dialog);
+        std::shared_ptr<Gtk::Dialog> dialog_keeper(dialog_progress);
 
         if(pApp)
-          dialog->set_transient_for(*pApp);
+          dialog_progress->set_transient_for(*pApp);
 
-        dialog->load(uri);
+        dialog_progress->load(uri);
 
-        if(dialog->run() == Gtk::RESPONSE_ACCEPT)
+        if(dialog_progress->run() == Gtk::RESPONSE_ACCEPT)
         {
           GdaBinary* bin = g_new(GdaBinary, 1);
-          std::shared_ptr<GdaBinary> image_data = dialog->get_image_data();
+          std::shared_ptr<GdaBinary> image_data = dialog_progress->get_image_data();
           bin->data = image_data->data;
           bin->binary_length = image_data->binary_length;
 
diff --git a/tests/test_document_load.cc b/tests/test_document_load.cc
index b9a0ca4..c83ba21 100644
--- a/tests/test_document_load.cc
+++ b/tests/test_document_load.cc
@@ -101,9 +101,9 @@ static std::shared_ptr<const Glom::LayoutItem_Portal> get_portal_from_details_la
       group->get_items_recursive_with_groups();
     for(const auto& layout_item : items)
     { 
-      const std::shared_ptr<const Glom::LayoutGroup> group =
+      const std::shared_ptr<const Glom::LayoutGroup> child_group =
         std::dynamic_pointer_cast<const Glom::LayoutGroup>(layout_item);
-      if(!group)
+      if(!child_group)
         continue;
 
       const std::shared_ptr<const Glom::LayoutItem_Portal> portal =
diff --git a/tests/test_document_load_and_change.cc b/tests/test_document_load_and_change.cc
index e2c0ad1..935c04c 100644
--- a/tests/test_document_load_and_change.cc
+++ b/tests/test_document_load_and_change.cc
@@ -139,10 +139,10 @@ int main()
 
   {
     //Change a relationship name:
-    const Glib::ustring table_name = "invoices";
+    const Glib::ustring table_name_invoices = "invoices";
     const Glib::ustring relationship_name_original = "contacts";
     const Glib::ustring relationship_name_new = "newrelationshipname";
-    document.change_relationship_name(table_name, 
+    document.change_relationship_name(table_name_invoices, 
       relationship_name_original, relationship_name_new);
     if(document.get_relationship(table_name, relationship_name_original))
     {


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