[glom/glom-1-28] Correct implicit uses of (now) explicit operator bool().



commit 2925b8c2d85d2e2632f55cea70b80d314ed95d14
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      |    2 +-
 .../canvas/canvas_group_resizable.cc               |    2 +-
 5 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/glom/libglom/connectionpool.cc b/glom/libglom/connectionpool.cc
index 5cf9729..9c0f7e6 100644
--- a/glom/libglom/connectionpool.cc
+++ b/glom/libglom/connectionpool.cc
@@ -701,7 +701,7 @@ bool ConnectionPool::connect_nothrow()
     }
   }
 
-  return (m_refGdaConnection != 0);
+  return (bool)m_refGdaConnection;
 }
 
 //TODO: Why do we use throw() here and on change_columns()?
diff --git a/glom/libglom/db_utils.cc b/glom/libglom/db_utils.cc
index 3b84942..24cf118 100644
--- a/glom/libglom/db_utils.cc
+++ b/glom/libglom/db_utils.cc
@@ -2334,7 +2334,8 @@ type_map_fields get_record_field_values(const Document* document, const Glib::us
     }
     catch(const Glib::Exception& ex)
     {
-      std::cerr << G_STRFUNC << ": Exception while executing SQL: " << query << std::endl;
+      const Glib::ustring sql_query = Utils::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 fdd5a9f..9f92b0a 100644
--- a/glom/mode_data/box_data_portal.cc
+++ b/glom/mode_data/box_data_portal.cc
@@ -320,7 +320,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 Glib::ustring sql_query = Utils::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 9c096d7..b80c279 100644
--- a/glom/mode_design/print_layouts/window_print_layout_edit.cc
+++ b/glom/mode_design/print_layouts/window_print_layout_edit.cc
@@ -743,7 +743,7 @@ bool Window_PrintLayout_Edit::get_is_item_at(double x, double y)
    return false;
 
   Glib::RefPtr<CanvasLayoutItem> layout_item = Glib::RefPtr<CanvasLayoutItem>::cast_dynamic(item_hit);
-  return layout_item;
+  return (bool)layout_item;
 }
 
 void Window_PrintLayout_Edit::set_default_position(const sharedptr<LayoutItem>& item)
diff --git a/glom/utility_widgets/canvas/canvas_group_resizable.cc 
b/glom/utility_widgets/canvas/canvas_group_resizable.cc
index 59011e9..fd7dfb4 100644
--- a/glom/utility_widgets/canvas/canvas_group_resizable.cc
+++ b/glom/utility_widgets/canvas/canvas_group_resizable.cc
@@ -1002,7 +1002,7 @@ Goocanvas::Canvas* CanvasGroupResizable::get_parent_canvas_widget()
 bool CanvasGroupResizable::get_is_line() const
 {
   Glib::RefPtr<CanvasLineMovable> 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]