[glom] WindowPrintLayoutEdit: Minor const improvements.



commit 86a5fa635bf009e106a5a3942c9c51649ef4f10e
Author: Murray Cumming <murrayc murrayc com>
Date:   Sun Apr 10 17:04:14 2016 +0200

    WindowPrintLayoutEdit: Minor const improvements.

 .../print_layouts/window_print_layout_edit.cc      |    8 ++++----
 .../print_layouts/window_print_layout_edit.h       |    4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)
---
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 3ce1032..e6b8a65 100644
--- a/glom/mode_design/print_layouts/window_print_layout_edit.cc
+++ b/glom/mode_design/print_layouts/window_print_layout_edit.cc
@@ -734,13 +734,13 @@ void Window_PrintLayout_Edit::on_canvas_show_context_menu(guint button, guint32
     m_context_menu->popup(button, activate_time);
 }
 
-bool Window_PrintLayout_Edit::get_is_item_at(double x, double y)
+bool Window_PrintLayout_Edit::get_is_item_at(double x, double y) const
 {
-  auto item_hit = m_canvas.get_item_at(x, y, false);
+  const auto item_hit = m_canvas.get_item_at(x, y, false);
   if(!item_hit)
    return false;
 
-  const auto layout_item = Glib::RefPtr<CanvasLayoutItem>::cast_dynamic(item_hit);
+  const auto layout_item = Glib::RefPtr<const CanvasLayoutItem>::cast_dynamic(item_hit);
   return (bool)layout_item;
 }
 
@@ -1348,7 +1348,7 @@ bool Window_PrintLayout_Edit::on_configure_event(GdkEventConfigure* configure_ev
   return result;
 }
 
-void Window_PrintLayout_Edit::get_dimensions_of_multiple_selected_items(double& x, double& y, double& width, 
double& height)
+void Window_PrintLayout_Edit::get_dimensions_of_multiple_selected_items(double& x, double& y, double& width, 
double& height) const
 {
  //Get the selected items, and their dimensions as a group:
   x = 0;
diff --git a/glom/mode_design/print_layouts/window_print_layout_edit.h 
b/glom/mode_design/print_layouts/window_print_layout_edit.h
index fdb7844..df79d74 100644
--- a/glom/mode_design/print_layouts/window_print_layout_edit.h
+++ b/glom/mode_design/print_layouts/window_print_layout_edit.h
@@ -129,11 +129,11 @@ private:
   void setup_context_menu();
   void set_ruler_sizes();
 
-  bool get_is_item_at(double x, double y);
+  bool get_is_item_at(double x, double y) const;
   void set_default_position(const std::shared_ptr<LayoutItem>& item);
   
   void canvas_convert_from_drag_pixels(double& x, double& y, bool adjust_for_scrolling = false) const;
-  void get_dimensions_of_multiple_selected_items(double& x, double& y, double& width, double& height);
+  void get_dimensions_of_multiple_selected_items(double& x, double& y, double& width, double& height) const;
 
   Glib::RefPtr<CanvasLayoutItem> create_canvas_layout_item_and_add(const std::shared_ptr<LayoutItem>& 
layout_item);
 


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