[glom] Print Layout: Make text formatting work for field items.



commit 97dda39f0da5cb60e033b9185a7b96e03eac394b
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Aug 11 12:38:27 2011 +0200

    Print Layout: Make text formatting work for field items.
    
    * glom/print_layout/canvas_print_layout.cc: on_context_menu_edit(),
    on_dialog_format_hide(): Never use default formatting for fields,
    because that formatting is for regular layouts, and we do not
    even let the user toggle whether to use it.

 ChangeLog                                |    9 +++++++++
 glom/print_layout/canvas_print_layout.cc |   11 +++++++++++
 2 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 5bc0ce7..361832c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2011-08-11  Murray Cumming  <murrayc murrayc com>
 
+	Print Layout: Make text formatting work for field items.
+
+	* glom/print_layout/canvas_print_layout.cc: on_context_menu_edit(), 
+	on_dialog_format_hide(): Never use default formatting for fields, 
+	because that formatting is for regular layouts, and we do not 
+	even let the user toggle whether to use it.
+
+2011-08-11  Murray Cumming  <murrayc murrayc com>
+
 	Print Layout: Don't move fields to 0,0 when choosing the field.
 
 	* glom/mode_design/layout/dialog_choose_field.cc: get_field():
diff --git a/glom/print_layout/canvas_print_layout.cc b/glom/print_layout/canvas_print_layout.cc
index a94b090..a9558dc 100644
--- a/glom/print_layout/canvas_print_layout.cc
+++ b/glom/print_layout/canvas_print_layout.cc
@@ -358,7 +358,12 @@ void Canvas_PrintLayout::on_context_menu_edit()
   {
     sharedptr<LayoutItem_Field> field_chosen = offer_field_list_select_one_field(field, m_table_name, parent);
     if(field_chosen)
+    {
+      //Never use the default formatting for print layouts:
+      field_chosen->set_formatting_use_default(false);
+
       m_context_item->set_layout_item(field_chosen);
+    }
   }
   else
   {
@@ -459,10 +464,16 @@ void Canvas_PrintLayout::on_dialog_format_hide()
     return;
 
   if(layout_item_field)
+  {
     m_dialog_format->m_box_formatting->get_formatting(layout_item_field->m_formatting);
+
+    //Never use the default formatting for print layouts:
+    layout_item_field->set_formatting_use_default(false);
+  }
   else if(layout_item_text)
     m_dialog_format->m_box_formatting->get_formatting(layout_item_text->m_formatting);
 
+  
   m_context_item->set_layout_item(layout_item); //Redraw the child item with the new formatting.
 
   delete m_dialog_format;



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