[glom] Fixed compiler warnings.



commit aa6ee308762ca0970914f4431e75667f5a76c35d
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Jan 22 23:32:58 2010 +0100

    Fixed compiler warnings.
    
    * glom/libglom/data_structure/layout/layoutitem_field.cc:
    get_formatting_used_horizontal_alignment():
    * glom/print_layout/canvas_layout_item.cc: apply_formatting(): Fixed
    compiler warnings.

 ChangeLog                                          |   11 +++++++++++
 .../data_structure/layout/layoutitem_field.cc      |    2 +-
 glom/print_layout/canvas_layout_item.cc            |    6 +++---
 3 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 59dde56..9028966 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2.13.1:
+
+2010-01-22  Murray Cumming  <murrayc murrayc com>
+
+  Fixed compiler warnings.
+  
+	* glom/libglom/data_structure/layout/layoutitem_field.cc: 
+	get_formatting_used_horizontal_alignment():
+	* glom/print_layout/canvas_layout_item.cc: apply_formatting(): Fixed 
+	compiler warnings.
+
 2010-01-22  Murray Cumming  <murrayc murrayc com>
 
 	Make libglom-1.14 install in parallel with libglom-1.12.
diff --git a/glom/libglom/data_structure/layout/layoutitem_field.cc b/glom/libglom/data_structure/layout/layoutitem_field.cc
index 5f205bc..e2463eb 100644
--- a/glom/libglom/data_structure/layout/layoutitem_field.cc
+++ b/glom/libglom/data_structure/layout/layoutitem_field.cc
@@ -228,7 +228,7 @@ FieldFormatting::HorizontalAlignment LayoutItem_Field::get_formatting_used_horiz
     if(m_field && !m_field->get_primary_key()) //TODO: Also prevent this when it is a foreign key.
     {
       //Align numbers to the right by default:
-      alignment == Field::TYPE_NUMERIC ? FieldFormatting::HORIZONTAL_ALIGNMENT_LEFT : FieldFormatting::HORIZONTAL_ALIGNMENT_RIGHT;
+      alignment = (m_field->get_glom_type() == Field::TYPE_NUMERIC ? FieldFormatting::HORIZONTAL_ALIGNMENT_RIGHT : FieldFormatting::HORIZONTAL_ALIGNMENT_LEFT);
     }
     else
       alignment = FieldFormatting::HORIZONTAL_ALIGNMENT_LEFT;
diff --git a/glom/print_layout/canvas_layout_item.cc b/glom/print_layout/canvas_layout_item.cc
index 972458c..c1f6aba 100644
--- a/glom/print_layout/canvas_layout_item.cc
+++ b/glom/print_layout/canvas_layout_item.cc
@@ -82,14 +82,14 @@ void CanvasLayoutItem::apply_formatting(const Glib::RefPtr<CanvasTextMovable>& c
   if(!layout_item)
     return;
 
-  //Horizontal alignment:
+  //Horizontal alignment:   
   const FieldFormatting::HorizontalAlignment alignment =
     layout_item->get_formatting_used_horizontal_alignment();
   const Pango::Alignment x_align = (alignment == FieldFormatting::HORIZONTAL_ALIGNMENT_LEFT ? Pango::ALIGN_LEFT : Pango::ALIGN_RIGHT);
 #ifdef GLIBMM_PROPERTIES_ENABLED  
-  //TODO: property_alignment() = x_align;
+  canvas_item->property_alignment() = x_align;
 #else    
-  //TODO: set_property("alignment", alignment);
+  canvas_item->set_property("alignment", alignment);
 #endif
 
   const FieldFormatting& formatting = layout_item->get_formatting_used();



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