[glom/gtkmm4v4] C++11: Minor uses of auto.



commit 095c3735f9e2ae64241b55dd67a6454d7382b722
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Apr 28 08:53:28 2017 +0200

    C++11: Minor uses of auto.

 glom/base_db.cc                               |    2 +-
 glom/frame_glom.cc                            |    2 +-
 glom/libglom/report_builder.cc                |    2 +-
 glom/mode_data/datawidget/dialog_choose_id.cc |    2 +-
 tests/test_fake_connection.cc                 |    2 +-
 tests/test_selfhosting_new_then_image.cc      |    2 +-
 tests/test_selfhosting_sqlinjection.cc        |    8 ++++----
 tests/test_selfhosting_utils.cc               |    2 +-
 8 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/glom/base_db.cc b/glom/base_db.cc
index a48aedd..d601d8f 100644
--- a/glom/base_db.cc
+++ b/glom/base_db.cc
@@ -735,7 +735,7 @@ bool Base_DB::set_field_value_in_database(const LayoutFieldInRecord& layoutfield
   const auto field_name = field_in_record.m_field->get_name();
   if(!field_name.empty()) //This should not happen.
   {
-    const Gnome::Gda::SqlExpr where_clause =
+    const auto where_clause =
       SqlUtils::build_simple_where_expression(field_in_record.m_table_name,
         field_in_record.m_key, field_in_record.m_key_value);
     const Glib::RefPtr<const Gnome::Gda::SqlBuilder> builder =
diff --git a/glom/frame_glom.cc b/glom/frame_glom.cc
index dbbd2f8..ae03c09 100644
--- a/glom/frame_glom.cc
+++ b/glom/frame_glom.cc
@@ -1175,7 +1175,7 @@ void Frame_Glom::on_notebook_find_criteria(const Gnome::Gda::SqlExpr& where_clau
   }
 
   //Identify the where_clause:
-  Gnome::Gda::SqlExpr where_clause_to_use = where_clause;
+  auto where_clause_to_use = where_clause;
 
   //Prefer the quick find text if any was entered:
   const auto quickfind_criteria = m_entry_quick_find->get_text();
diff --git a/glom/libglom/report_builder.cc b/glom/libglom/report_builder.cc
index ea56740..849aeae 100644
--- a/glom/libglom/report_builder.cc
+++ b/glom/libglom/report_builder.cc
@@ -257,7 +257,7 @@ bool ReportBuilder::report_build_groupby(const FoundSet& found_set_parent, xmlpp
           Conversions::get_text_for_gda_value(field_group_by->get_glom_type(), group_value, m_locale, 
field_group_by->get_formatting_used().m_numeric_format) );
 
         //TODO: Use a SQL parameter instead of using sql().
-        Gnome::Gda::SqlExpr where_clause =
+        auto where_clause =
           SqlUtils::build_simple_where_expression(group_field_table_name, 
field_group_by->get_full_field_details(), group_value);
 
         if(!found_set_parent.m_where_clause.empty())
diff --git a/glom/mode_data/datawidget/dialog_choose_id.cc b/glom/mode_data/datawidget/dialog_choose_id.cc
index 97889e5..ea1dcfc 100644
--- a/glom/mode_data/datawidget/dialog_choose_id.cc
+++ b/glom/mode_data/datawidget/dialog_choose_id.cc
@@ -109,7 +109,7 @@ void Dialog_ChooseID::on_button_quickfind()
   }
   else
   {
-    const Gnome::Gda::SqlExpr where_clause =
+    const auto where_clause =
       SqlUtils::get_find_where_clause_quick(get_document(), m_table_name,
         Gnome::Gda::Value(criteria));
     on_box_find_criteria(where_clause);
diff --git a/tests/test_fake_connection.cc b/tests/test_fake_connection.cc
index 940444f..0dc776d 100644
--- a/tests/test_fake_connection.cc
+++ b/tests/test_fake_connection.cc
@@ -67,7 +67,7 @@ int main()
   //Build a SQL query and get the string for it:
   const Gnome::Gda::Value value("Born To Run");
   auto where_field = document->get_field("albums", "name");
-  const Gnome::Gda::SqlExpr where_clause =
+  const auto where_clause =
     Glom::SqlUtils::build_simple_where_expression("albums", where_field, value);
 
   Glom::SqlUtils::type_vecLayoutFields fieldsToGet;
diff --git a/tests/test_selfhosting_new_then_image.cc b/tests/test_selfhosting_new_then_image.cc
index 41d42ac..15de02c 100644
--- a/tests/test_selfhosting_new_then_image.cc
+++ b/tests/test_selfhosting_new_then_image.cc
@@ -57,7 +57,7 @@ static bool test(Glom::Document::HostingMode hosting_mode)
     return false;
   }
 
-  const Gnome::Gda::SqlExpr where_clause =
+  const auto where_clause =
     Glom::SqlUtils::build_simple_where_expression(table_name, key_field, Gnome::Gda::Value(1));
 
   //Set the value, from an image file:
diff --git a/tests/test_selfhosting_sqlinjection.cc b/tests/test_selfhosting_sqlinjection.cc
index e9d8351..20eef04 100644
--- a/tests/test_selfhosting_sqlinjection.cc
+++ b/tests/test_selfhosting_sqlinjection.cc
@@ -34,7 +34,7 @@ static bool check_get_extra_rows(const Glib::ustring& quote_char)
   //Try to get more rows than intended:
   const Gnome::Gda::Value value("Born To Run" + quote_char + " OR " + quote_char + "x" + quote_char + "=" + 
quote_char + "x");
   auto where_field = document->get_field("albums", "name");
-  const Gnome::Gda::SqlExpr where_clause =
+  const auto where_clause =
     Glom::SqlUtils::build_simple_where_expression("albums", where_field, value);
 
   Glom::SqlUtils::type_vecLayoutFields fieldsToGet;
@@ -67,7 +67,7 @@ static bool check_drop_table(const Glib::ustring& quote_char)
   const Gnome::Gda::Value value("True Blue" + quote_char + "; DROP TABLE songs; --");
   auto where_field =
     document->get_field("albums", "name");
-  const Gnome::Gda::SqlExpr where_clause =
+  const auto where_clause =
     Glom::SqlUtils::build_simple_where_expression("albums", where_field, value);
 
   Glom::SqlUtils::type_vecLayoutFields fieldsToGet;
@@ -107,7 +107,7 @@ static bool check_avoid_quotes_and_drop_table_with_false_value_type()
   const Gnome::Gda::Value value("1;DROP TABLE songs");
   auto where_field =
     document->get_field("albums", "album_id");
-  const Gnome::Gda::SqlExpr where_clause =
+  const auto where_clause =
     Glom::SqlUtils::build_simple_where_expression("albums", where_field, value);
 
   Glom::SqlUtils::type_vecLayoutFields fieldsToGet;
@@ -167,7 +167,7 @@ static bool check_avoid_quotes_and_drop_table_with_false_field_type()
   where_field->set_glom_type(Glom::Field::glom_field_type::NUMERIC);
   //const GType gda_type = Glom::Field::get_gda_type_for_glom_type(Glom::TYPE_NUMERIC);
 
-  const Gnome::Gda::SqlExpr where_clause =
+  const auto where_clause =
     Glom::SqlUtils::build_simple_where_expression("albums", where_field, value);
 
   Glom::SqlUtils::type_vecLayoutFields fieldsToGet;
diff --git a/tests/test_selfhosting_utils.cc b/tests/test_selfhosting_utils.cc
index 00f4325..3f083a8 100644
--- a/tests/test_selfhosting_utils.cc
+++ b/tests/test_selfhosting_utils.cc
@@ -513,7 +513,7 @@ bool test_example_musiccollection_data(const std::shared_ptr<const Glom::Documen
 
   //Check that some data is as expected:
   const Gnome::Gda::Value value("Born To Run");
-  const Gnome::Gda::SqlExpr where_clause =
+  const auto where_clause =
     Glom::SqlUtils::get_find_where_clause_quick(document, "albums", value);
 
   Glom::SqlUtils::type_vecLayoutFields fieldsToGet;


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