[glom] Correct implicit uses of (now) explicit operator bool().



commit 6d062263670de804c0c8a7f8040caaf1cf7cad26
Author: Murray Cumming <murrayc murrayc com>
Date:   Sun Apr 10 16:43:16 2016 +0200

    Correct implicit uses of (now) explicit operator bool().

 glom/libglom/connectionpool.cc                     |    2 +-
 glom/libglom/db_utils.cc                           |    3 ++-
 glom/mode_data/box_data_portal.cc                  |    3 ++-
 .../print_layouts/window_print_layout_edit.cc      |    4 ++--
 .../canvas/canvas_group_resizable.cc               |    2 +-
 5 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/glom/libglom/connectionpool.cc b/glom/libglom/connectionpool.cc
index ea3d51f..392603d 100644
--- a/glom/libglom/connectionpool.cc
+++ b/glom/libglom/connectionpool.cc
@@ -680,7 +680,7 @@ bool ConnectionPool::connect_nothrow()
     }
   }
 
-  return (m_gda_connection != 0);
+  return (bool)m_gda_connection;
 }
 
 //TODO: Why do we use noexcept here and on change_columns()?
diff --git a/glom/libglom/db_utils.cc b/glom/libglom/db_utils.cc
index dbc667d..efe1e45 100644
--- a/glom/libglom/db_utils.cc
+++ b/glom/libglom/db_utils.cc
@@ -2333,7 +2333,8 @@ type_map_fields get_record_field_values(const std::shared_ptr<const Document>& d
     }
     catch(const Glib::Exception& ex)
     {
-      std::cerr << G_STRFUNC << ": Exception while executing SQL: " << query << std::endl;
+      const auto sql_query = SqlUtils::sqlbuilder_get_full_query(query);
+      std::cerr << G_STRFUNC << ": Exception while executing SQL: " << sql_query << std::endl;
       handle_error(ex);
       return field_values;
     }
diff --git a/glom/mode_data/box_data_portal.cc b/glom/mode_data/box_data_portal.cc
index 057877a..64140f6 100644
--- a/glom/mode_data/box_data_portal.cc
+++ b/glom/mode_data/box_data_portal.cc
@@ -374,7 +374,8 @@ void Box_Data_Portal::get_suitable_record_to_view_details(const Gnome::Gda::Valu
       << ", key_field=" << key_field->get_name()
       << ", primary_key_value=" << primary_key_value.to_string() << std::endl;
 
-    std::cout << "  DEBUG: SQL was: " << query << std::endl;
+    const auto sql_query = SqlUtils::sqlbuilder_get_full_query(query);
+    std::cout << "  DEBUG: SQL was: " << sql_query << std::endl;
   }
 
   if(!value_found)
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 0761379..3ce1032 100644
--- a/glom/mode_design/print_layouts/window_print_layout_edit.cc
+++ b/glom/mode_design/print_layouts/window_print_layout_edit.cc
@@ -740,8 +740,8 @@ bool Window_PrintLayout_Edit::get_is_item_at(double x, double y)
   if(!item_hit)
    return false;
 
-  auto layout_item = Glib::RefPtr<CanvasLayoutItem>::cast_dynamic(item_hit);
-  return layout_item;
+  const auto layout_item = Glib::RefPtr<CanvasLayoutItem>::cast_dynamic(item_hit);
+  return (bool)layout_item;
 }
 
 void Window_PrintLayout_Edit::set_default_position(const std::shared_ptr<LayoutItem>& item)
diff --git a/glom/utility_widgets/canvas/canvas_group_resizable.cc 
b/glom/utility_widgets/canvas/canvas_group_resizable.cc
index 9bcc848..dd6550e 100644
--- a/glom/utility_widgets/canvas/canvas_group_resizable.cc
+++ b/glom/utility_widgets/canvas/canvas_group_resizable.cc
@@ -999,7 +999,7 @@ Goocanvas::Canvas* CanvasGroupResizable::get_parent_canvas_widget()
 bool CanvasGroupResizable::get_is_line() const
 {
   auto line = Glib::RefPtr<CanvasLineMovable>::cast_dynamic(m_child);
-  return line;
+  return (bool)line;
 }
 
 CanvasGroupResizable::type_signal_resized CanvasGroupResizable::signal_resized()


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