[glom/glom-1-30] Correct implicit uses of (now) explicit operator bool().
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom/glom-1-30] Correct implicit uses of (now) explicit operator bool().
- Date: Wed, 8 Jun 2016 20:56:32 +0000 (UTC)
commit f9af89be0aae17e48a8db6c747c6fba797c80ab5
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 | 4 ++--
5 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/glom/libglom/connectionpool.cc b/glom/libglom/connectionpool.cc
index ff57101..b0372e0 100644
--- a/glom/libglom/connectionpool.cc
+++ b/glom/libglom/connectionpool.cc
@@ -692,7 +692,7 @@ bool ConnectionPool::connect_nothrow()
}
}
- return (m_refGdaConnection != 0);
+ return (bool)m_refGdaConnection;
}
//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 fbc634e..b7dd8c6 100644
--- a/glom/libglom/db_utils.cc
+++ b/glom/libglom/db_utils.cc
@@ -2329,7 +2329,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 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 f64e7aa..2218b59 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 auto 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 33546ec..c31d439 100644
--- a/glom/mode_design/print_layouts/window_print_layout_edit.cc
+++ b/glom/mode_design/print_layouts/window_print_layout_edit.cc
@@ -739,8 +739,8 @@ bool Window_PrintLayout_Edit::get_is_item_at(double x, double y)
if(!item_hit)
return false;
- Glib::RefPtr<CanvasLayoutItem> 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 b5b185b..2b4dde3 100644
--- a/glom/utility_widgets/canvas/canvas_group_resizable.cc
+++ b/glom/utility_widgets/canvas/canvas_group_resizable.cc
@@ -1002,8 +1002,8 @@ 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;
+ const auto line = Glib::RefPtr<CanvasLineMovable>::cast_dynamic(m_child);
+ return (bool)line;
}
CanvasGroupResizable::type_signal_resized CanvasGroupResizable::signal_resized()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]