[glom] Document: get_field_used_in_relationship_to_one(): const correction.



commit ee8ee2b150f473636f519b27164faceda8826385
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue May 25 08:34:21 2010 +0200

    Document: get_field_used_in_relationship_to_one(): const correction.
    
    * glom/libglom/document/document.[h|cc]:
    get_field_used_in_relationship_to_one(): Make the relationship parameter
    const and adapt other code.

 ChangeLog                         |    8 ++++++++
 glom/libglom/document/document.cc |    6 +++---
 glom/libglom/document/document.h  |    2 +-
 3 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 303e9c0..f00df4b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2010-05-25  Murray Cumming  <murrayc murrayc-x61>
 
+	Document: get_field_used_in_relationship_to_one(): const correction.
+
+	* glom/libglom/document/document.[h|cc]: 
+	get_field_used_in_relationship_to_one(): Make the relationship parameter 
+	const and adapt other code.
+
+2010-05-25  Murray Cumming  <murrayc murrayc-x61>
+
 	libglom: build_sql_select_add_fields_to_get(): Define joins here.
 
 	* glom/libglom/data_structure/layout/usesrelationship.[h|cc]:
diff --git a/glom/libglom/document/document.cc b/glom/libglom/document/document.cc
index cb6ce3d..10a9fa8 100644
--- a/glom/libglom/document/document.cc
+++ b/glom/libglom/document/document.cc
@@ -3892,9 +3892,9 @@ bool Document::get_relationship_is_to_one(const Glib::ustring& table_name, const
   return false;
 }
 
-sharedptr<Relationship> Document::get_field_used_in_relationship_to_one(const Glib::ustring& table_name, const sharedptr<const LayoutItem_Field>& layout_field) const
+sharedptr<const Relationship> Document::get_field_used_in_relationship_to_one(const Glib::ustring& table_name, const sharedptr<const LayoutItem_Field>& layout_field) const
 {
-  sharedptr<Relationship> result;
+  sharedptr<const Relationship> result;
 
   if(!layout_field)
   {
@@ -3914,7 +3914,7 @@ sharedptr<Relationship> Document::get_field_used_in_relationship_to_one(const Gl
   const Glib::ustring field_name = layout_field->get_name();
   for(type_vec_relationships::const_iterator iterRel = iterFind->second.m_relationships.begin(); iterRel != iterFind->second.m_relationships.end(); ++iterRel)
   {
-    sharedptr<Relationship> relationship = *iterRel;
+    sharedptr<const Relationship> relationship = *iterRel;
     if(relationship)
     {
       //If the relationship uses the field
diff --git a/glom/libglom/document/document.h b/glom/libglom/document/document.h
index f60861a..03198db 100644
--- a/glom/libglom/document/document.h
+++ b/glom/libglom/document/document.h
@@ -182,7 +182,7 @@ public:
   /** Returns whether the field is the from-field in a to-one relationship.
    * @see get_relationship_is_to_one(). Ignores hidden tables.
    */
-  sharedptr<Relationship> get_field_used_in_relationship_to_one(const Glib::ustring& table_name, const sharedptr<const LayoutItem_Field>& layout_field) const;
+  sharedptr<const Relationship> get_field_used_in_relationship_to_one(const Glib::ustring& table_name, const sharedptr<const LayoutItem_Field>& layout_field) const;
 
   typedef std::vector< sharedptr<Field> > type_vec_fields;
   type_vec_fields get_table_fields(const Glib::ustring& table_name) const;



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