[glom] Rename FieldFormatting to Formatting



commit e8845dc5dec65afcaa11b243b0e2d1c4f7640907
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Mar 29 11:04:06 2012 +0200

    Rename FieldFormatting to Formatting

 glom/libglom/data_structure/field.h                |    4 +-
 glom/libglom/data_structure/foundset.h             |    2 +-
 .../layout/{fieldformatting.cc => formatting.cc}   |   77 ++++++++++----------
 .../layout/{fieldformatting.h => formatting.h}     |   15 ++--
 glom/libglom/data_structure/layout/layoutgroup.cc  |    2 +-
 .../data_structure/layout/layoutitem_field.cc      |   16 ++--
 .../data_structure/layout/layoutitem_field.h       |    4 +-
 .../data_structure/layout/layoutitem_text.h        |    2 +-
 .../layout/layoutitem_withformatting.cc            |   12 ++--
 .../layout/layoutitem_withformatting.h             |    8 +-
 .../layout/report_parts/layoutitem_groupby.h       |    4 +-
 .../data_structure/layout/usesrelationship.cc      |    2 +-
 glom/libglom/document/document.cc                  |   46 ++++++------
 glom/libglom/document/document.h                   |    8 +-
 glom/libglom/filelist.am                           |    4 +-
 glom/libglom/utils.cc                              |    8 +-
 glom/libglom/utils.h                               |    2 +-
 glom/mode_data/datawidget/cellcreation.cc          |   14 ++--
 glom/mode_data/datawidget/cellrenderer_dblist.cc   |    2 +-
 glom/mode_data/datawidget/cellrenderer_dblist.h    |    2 +-
 glom/mode_data/datawidget/combo.cc                 |    2 +-
 glom/mode_data/datawidget/combo.h                  |    2 +-
 .../mode_data/datawidget/combo_as_radio_buttons.cc |    8 +-
 glom/mode_data/datawidget/combo_as_radio_buttons.h |    2 +-
 glom/mode_data/datawidget/combochoices.h           |    2 +-
 .../datawidget/combochoiceswithtreemodel.cc        |   12 ++--
 .../datawidget/combochoiceswithtreemodel.h         |    2 +-
 glom/mode_data/datawidget/datawidget.cc            |    2 +-
 glom/mode_data/datawidget/entry.cc                 |    6 +-
 glom/mode_data/db_adddel/db_adddel.cc              |    8 +-
 glom/mode_data/flowtablewithfields.cc              |   12 ++--
 .../layout/layout_item_dialogs/box_formatting.cc   |   28 ++++----
 .../layout/layout_item_dialogs/box_formatting.h    |   10 ++--
 glom/print_layout/canvas_layout_item.cc            |    6 +-
 glom/print_layout/canvas_layout_item.h             |    2 +-
 glom/print_layout/canvas_print_layout.cc           |    6 +-
 glom/print_layout/print_layout_utils.cc            |    2 +-
 glom/utility_widgets/layoutwidgetbase.cc           |    8 +-
 tests/test_document_load.cc                        |    6 +-
 tests/test_document_load_translations.cc           |    4 +-
 40 files changed, 182 insertions(+), 182 deletions(-)
---
diff --git a/glom/libglom/data_structure/field.h b/glom/libglom/data_structure/field.h
index 8430710..f45e74f 100644
--- a/glom/libglom/data_structure/field.h
+++ b/glom/libglom/data_structure/field.h
@@ -25,7 +25,7 @@
 #include <libgdamm/holder.h>
 #include <libgdamm/connection.h>
 #include <libglom/data_structure/translatable_item.h>
-#include <libglom/data_structure/layout/fieldformatting.h>
+#include <libglom/data_structure/layout/formatting.h>
 #include <libglom/sharedptr.h>
 
 //Predicate, for use with std::find_if():
@@ -230,7 +230,7 @@ public:
 
   static bool get_conversion_possible(glom_field_type field_type_src, glom_field_type field_type_dest);
 
-  FieldFormatting m_default_formatting;
+  Formatting m_default_formatting;
 
 private:
 
diff --git a/glom/libglom/data_structure/foundset.h b/glom/libglom/data_structure/foundset.h
index 9e08f18..0529945 100644
--- a/glom/libglom/data_structure/foundset.h
+++ b/glom/libglom/data_structure/foundset.h
@@ -47,7 +47,7 @@ public:
   sharedptr<const Relationship> m_extra_join; // Only used for doubly-related related records (portals), in which case the WHERE clause is also slightly different.
   Gnome::Gda::SqlExpr m_where_clause;
 
-  //TODO: Avoid duplication with types in FieldFormatting.
+  //TODO: Avoid duplication with types in Formatting.
   ///field, ascending
   typedef std::pair< sharedptr<const LayoutItem_Field>, bool> type_pair_sort_field;
   typedef std::vector<type_pair_sort_field> type_sort_clause;
diff --git a/glom/libglom/data_structure/layout/fieldformatting.cc b/glom/libglom/data_structure/layout/formatting.cc
similarity index 69%
rename from glom/libglom/data_structure/layout/fieldformatting.cc
rename to glom/libglom/data_structure/layout/formatting.cc
index ae6f358..57301fe 100644
--- a/glom/libglom/data_structure/layout/fieldformatting.cc
+++ b/glom/libglom/data_structure/layout/formatting.cc
@@ -18,8 +18,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "fieldformatting.h"
-#include <libglom/data_structure/layout/fieldformatting.h>
+#include <libglom/data_structure/layout/formatting.h>
 #include <libglom/data_structure/glomconversions.h>
 #include <libglom/document/document.h>
 #include <glibmm/i18n.h>
@@ -29,7 +28,7 @@ const guint MULTILINE_TEXT_DEFAULT_HEIGHT_LINES = 6;
 namespace Glom
 {
 
-FieldFormatting::FieldFormatting()
+Formatting::Formatting()
 : m_choices_restricted(false),
   m_choices_restricted_as_radio_buttons(false),
   m_choices_custom(false),
@@ -41,7 +40,7 @@ FieldFormatting::FieldFormatting()
 {
 }
 
-FieldFormatting::FieldFormatting(const FieldFormatting& src)
+Formatting::Formatting(const Formatting& src)
 : UsesRelationship(src),
   m_numeric_format(src.m_numeric_format),
   m_choices_custom_list(src.m_choices_custom_list),
@@ -62,11 +61,11 @@ FieldFormatting::FieldFormatting(const FieldFormatting& src)
 {
 }
 
-FieldFormatting::~FieldFormatting()
+Formatting::~Formatting()
 {
 }
 
-bool FieldFormatting::operator==(const FieldFormatting& src) const
+bool Formatting::operator==(const Formatting& src) const
 {
   return UsesRelationship::operator==(src) &&
     (m_numeric_format == src.m_numeric_format) &&
@@ -88,7 +87,7 @@ bool FieldFormatting::operator==(const FieldFormatting& src) const
 }
 
 
-FieldFormatting& FieldFormatting::operator=(const FieldFormatting& src)
+Formatting& Formatting::operator=(const Formatting& src)
 {
   UsesRelationship::operator=(src);
 
@@ -115,22 +114,22 @@ FieldFormatting& FieldFormatting::operator=(const FieldFormatting& src)
   return *this;
 }
 
-bool FieldFormatting::get_text_format_multiline() const
+bool Formatting::get_text_format_multiline() const
 {
   return m_text_format_multiline;
 }
 
-void FieldFormatting::set_text_format_multiline(bool value)
+void Formatting::set_text_format_multiline(bool value)
 {
   m_text_format_multiline = value;
 }
 
-guint FieldFormatting::get_text_format_multiline_height_lines() const
+guint Formatting::get_text_format_multiline_height_lines() const
 {
   return m_text_multiline_height_lines;
 }
 
-void FieldFormatting::set_text_format_multiline_height_lines(guint value)
+void Formatting::set_text_format_multiline_height_lines(guint value)
 {
   //Do not allow inappropriate values. TODO: Respond when they are entered, not later here.
   if(value < 2)
@@ -139,27 +138,27 @@ void FieldFormatting::set_text_format_multiline_height_lines(guint value)
   m_text_multiline_height_lines = value;
 }
 
-void FieldFormatting::set_text_format_font(const Glib::ustring& font_desc)
+void Formatting::set_text_format_font(const Glib::ustring& font_desc)
 {
   m_text_font = font_desc;
 }
 
-Glib::ustring FieldFormatting::get_text_format_font() const
+Glib::ustring Formatting::get_text_format_font() const
 {
   return m_text_font;
 }
 
-void FieldFormatting::set_text_format_color_foreground(const Glib::ustring& color)
+void Formatting::set_text_format_color_foreground(const Glib::ustring& color)
 {
   m_text_color_foreground = color;
 }
 
-Glib::ustring FieldFormatting::get_text_format_color_foreground() const
+Glib::ustring Formatting::get_text_format_color_foreground() const
 {
   return m_text_color_foreground;
 }
 
-Glib::ustring FieldFormatting::get_text_format_color_foreground_to_use(const Gnome::Gda::Value& value) const
+Glib::ustring Formatting::get_text_format_color_foreground_to_use(const Gnome::Gda::Value& value) const
 {
   if(m_numeric_format.m_alt_foreground_color_for_negatives)
   {
@@ -171,45 +170,45 @@ Glib::ustring FieldFormatting::get_text_format_color_foreground_to_use(const Gno
   return m_text_color_foreground;
 }
 
-void FieldFormatting::set_text_format_color_background(const Glib::ustring& color)
+void Formatting::set_text_format_color_background(const Glib::ustring& color)
 {
   m_text_color_background = color;
 }
 
-Glib::ustring FieldFormatting::get_text_format_color_background() const
+Glib::ustring Formatting::get_text_format_color_background() const
 {
   return m_text_color_background;
 }
 
-void FieldFormatting::set_horizontal_alignment(HorizontalAlignment alignment)
+void Formatting::set_horizontal_alignment(HorizontalAlignment alignment)
 {
   m_horizontal_alignment = alignment;
 }
 
-FieldFormatting::HorizontalAlignment FieldFormatting::get_horizontal_alignment() const
+Formatting::HorizontalAlignment Formatting::get_horizontal_alignment() const
 {
   return m_horizontal_alignment;
 }
 
-bool FieldFormatting::get_has_choices() const
+bool Formatting::get_has_choices() const
 {
   return ( m_choices_related && get_has_relationship_name() && m_choices_related_field ) ||
          ( m_choices_custom && !m_choices_custom_list.empty() );
 }
 
-FieldFormatting::type_list_values FieldFormatting::get_choices_custom() const
+Formatting::type_list_values Formatting::get_choices_custom() const
 {
   return m_choices_custom_list;
 }
 
-void FieldFormatting::set_choices_custom(const type_list_values& choices)
+void Formatting::set_choices_custom(const type_list_values& choices)
 {
   m_choices_custom_list = choices;
 }
 
-Glib::ustring FieldFormatting::get_custom_choice_original_for_translated_text(const Glib::ustring& text, const Glib::ustring& locale) const
+Glib::ustring Formatting::get_custom_choice_original_for_translated_text(const Glib::ustring& text, const Glib::ustring& locale) const
 {
-  for(FieldFormatting::type_list_values::const_iterator iter = m_choices_custom_list.begin(); iter != m_choices_custom_list.end(); ++iter)
+  for(Formatting::type_list_values::const_iterator iter = m_choices_custom_list.begin(); iter != m_choices_custom_list.end(); ++iter)
   {
     const sharedptr<const ChoiceValue> value = *iter;
     if(!value)
@@ -222,9 +221,9 @@ Glib::ustring FieldFormatting::get_custom_choice_original_for_translated_text(co
   return Glib::ustring();
 }
 
-Glib::ustring FieldFormatting::get_custom_choice_translated(const Glib::ustring& original_text, const Glib::ustring& locale) const
+Glib::ustring Formatting::get_custom_choice_translated(const Glib::ustring& original_text, const Glib::ustring& locale) const
 {
-  for(FieldFormatting::type_list_values::const_iterator iter = m_choices_custom_list.begin(); iter != m_choices_custom_list.end(); ++iter)
+  for(Formatting::type_list_values::const_iterator iter = m_choices_custom_list.begin(); iter != m_choices_custom_list.end(); ++iter)
   {
     const sharedptr<const ChoiceValue> value = *iter;
     if(!value)
@@ -238,46 +237,46 @@ Glib::ustring FieldFormatting::get_custom_choice_translated(const Glib::ustring&
 }
 
 
-bool FieldFormatting::get_choices_restricted(bool& as_radio_buttons) const
+bool Formatting::get_choices_restricted(bool& as_radio_buttons) const
 {
   as_radio_buttons = m_choices_restricted_as_radio_buttons;
   return m_choices_restricted;
 }
 
-void FieldFormatting::set_choices_restricted(bool val, bool as_radio_buttons)
+void Formatting::set_choices_restricted(bool val, bool as_radio_buttons)
 {
   m_choices_restricted = val;
   m_choices_restricted_as_radio_buttons = as_radio_buttons;
 }
 
-bool FieldFormatting::get_has_custom_choices() const
+bool Formatting::get_has_custom_choices() const
 {
   return m_choices_custom;
 }
 
-void FieldFormatting::set_has_custom_choices(bool val)
+void Formatting::set_has_custom_choices(bool val)
 {
   m_choices_custom = val;
 }
 
-bool FieldFormatting::get_has_related_choices() const
+bool Formatting::get_has_related_choices() const
 {
   return m_choices_related;
 }
 
-bool FieldFormatting::get_has_related_choices(bool& show_all, bool& with_second) const
+bool Formatting::get_has_related_choices(bool& show_all, bool& with_second) const
 {
   show_all = m_choices_related_show_all;
   with_second = m_choices_extra_layout_group;
   return m_choices_related;
 }
 
-void FieldFormatting::set_has_related_choices(bool val)
+void Formatting::set_has_related_choices(bool val)
 {
   m_choices_related = val;
 }
 
-void FieldFormatting::set_choices_related(const sharedptr<const Relationship>& relationship, const sharedptr<LayoutItem_Field>& field, const sharedptr<LayoutGroup>& extra_layout, const type_list_sort_fields& sort_fields, bool show_all)
+void Formatting::set_choices_related(const sharedptr<const Relationship>& relationship, const sharedptr<LayoutItem_Field>& field, const sharedptr<LayoutGroup>& extra_layout, const type_list_sort_fields& sort_fields, bool show_all)
 {
   set_relationship(relationship);
 
@@ -287,7 +286,7 @@ void FieldFormatting::set_choices_related(const sharedptr<const Relationship>& r
   m_choices_related_show_all = show_all;
 }
 
-void FieldFormatting::get_choices_related(sharedptr<const Relationship>& relationship, sharedptr<const LayoutItem_Field>& field, sharedptr<const LayoutGroup>& extra_layout, type_list_sort_fields& sort_fields, bool& show_all) const
+void Formatting::get_choices_related(sharedptr<const Relationship>& relationship, sharedptr<const LayoutItem_Field>& field, sharedptr<const LayoutGroup>& extra_layout, type_list_sort_fields& sort_fields, bool& show_all) const
 {
   relationship = get_relationship();
 
@@ -298,7 +297,7 @@ void FieldFormatting::get_choices_related(sharedptr<const Relationship>& relatio
 }
 
 
-void FieldFormatting::get_choices_related(sharedptr<const Relationship>& relationship, sharedptr<LayoutItem_Field>& field, sharedptr<LayoutGroup>& extra_layout, type_list_sort_fields& sort_fields, bool& show_all)
+void Formatting::get_choices_related(sharedptr<const Relationship>& relationship, sharedptr<LayoutItem_Field>& field, sharedptr<LayoutGroup>& extra_layout, type_list_sort_fields& sort_fields, bool& show_all)
 {
   relationship = get_relationship();
 
@@ -308,13 +307,13 @@ void FieldFormatting::get_choices_related(sharedptr<const Relationship>& relatio
   show_all = m_choices_related_show_all;
 }
 
-sharedptr<const Relationship> FieldFormatting::get_choices_related_relationship(bool& show_all) const
+sharedptr<const Relationship> Formatting::get_choices_related_relationship(bool& show_all) const
 {
   show_all = m_choices_related_show_all;
   return get_relationship();
 }
 
-bool FieldFormatting::change_field_item_name(const Glib::ustring& table_name, const Glib::ustring& field_name_old, const Glib::ustring& field_name_new)
+bool Formatting::change_field_item_name(const Glib::ustring& table_name, const Glib::ustring& field_name_old, const Glib::ustring& field_name_new)
 {
   if(!m_choices_related_field)
     return false; //Nothing changed.
diff --git a/glom/libglom/data_structure/layout/fieldformatting.h b/glom/libglom/data_structure/layout/formatting.h
similarity index 94%
rename from glom/libglom/data_structure/layout/fieldformatting.h
rename to glom/libglom/data_structure/layout/formatting.h
index 1826568..b0d1842 100644
--- a/glom/libglom/data_structure/layout/fieldformatting.h
+++ b/glom/libglom/data_structure/layout/formatting.h
@@ -34,17 +34,18 @@ namespace Glom
 class LayoutItem_Field;
 class LayoutGroup;
 
-//TODO: This should probably be renamed to Formatting, because it is used for static text items too.
-class FieldFormatting : public UsesRelationship //The UsesRelationship base has the relationship for the choices.
+/** This specifies how to display data for fields or static text items.
+ */
+class Formatting : public UsesRelationship //The UsesRelationship base has the relationship for the choices.
 {
 public:
 
-  FieldFormatting();
-  FieldFormatting(const FieldFormatting& src);
-  FieldFormatting& operator=(const FieldFormatting& src);
-  virtual ~FieldFormatting();
+  Formatting();
+  Formatting(const Formatting& src);
+  Formatting& operator=(const Formatting& src);
+  virtual ~Formatting();
 
-  bool operator==(const FieldFormatting& src) const;
+  bool operator==(const Formatting& src) const;
 
   bool get_has_choices() const;
 
diff --git a/glom/libglom/data_structure/layout/layoutgroup.cc b/glom/libglom/data_structure/layout/layoutgroup.cc
index 184fb82..73e4424 100644
--- a/glom/libglom/data_structure/layout/layoutgroup.cc
+++ b/glom/libglom/data_structure/layout/layoutgroup.cc
@@ -374,7 +374,7 @@ void LayoutGroup::change_field_item_name(const Glib::ustring& table_name, const
         sharedptr<LayoutItem_WithFormatting>::cast_dynamic(item);
       if(with_formatting)
       {
-        FieldFormatting& formatting = with_formatting->m_formatting;
+        Formatting& formatting = with_formatting->m_formatting;
         formatting.change_field_item_name(table_name, field_name, field_name_new);
       }
    
diff --git a/glom/libglom/data_structure/layout/layoutitem_field.cc b/glom/libglom/data_structure/layout/layoutitem_field.cc
index 2260b0d..ab71020 100644
--- a/glom/libglom/data_structure/layout/layoutitem_field.cc
+++ b/glom/libglom/data_structure/layout/layoutitem_field.cc
@@ -244,7 +244,7 @@ void LayoutItem_Field::set_formatting_use_default(bool use_default)
   m_formatting_use_default = use_default;
 }
 
-const FieldFormatting& LayoutItem_Field::get_formatting_used() const
+const Formatting& LayoutItem_Field::get_formatting_used() const
 {
   if(m_formatting_use_default && m_field_cache_valid && m_field)
     return m_field->m_default_formatting;
@@ -252,23 +252,23 @@ const FieldFormatting& LayoutItem_Field::get_formatting_used() const
     return m_formatting;
 }
 
-FieldFormatting::HorizontalAlignment LayoutItem_Field::get_formatting_used_horizontal_alignment(bool for_details_view) const
+Formatting::HorizontalAlignment LayoutItem_Field::get_formatting_used_horizontal_alignment(bool for_details_view) const
 {
-  const FieldFormatting& format = get_formatting_used();
-  FieldFormatting::HorizontalAlignment alignment = 
+  const Formatting& format = get_formatting_used();
+  Formatting::HorizontalAlignment alignment = 
     format.get_horizontal_alignment();
   
-  if(alignment == FieldFormatting::HORIZONTAL_ALIGNMENT_AUTO)
+  if(alignment == Formatting::HORIZONTAL_ALIGNMENT_AUTO)
   {
     //By default, right-align numbers on list views, unless they are ID fields.
     //And left-align them on details views, because that looks silly otherwise.
     if(!for_details_view && (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 = (m_field->get_glom_type() == Field::TYPE_NUMERIC ? FieldFormatting::HORIZONTAL_ALIGNMENT_RIGHT : FieldFormatting::HORIZONTAL_ALIGNMENT_LEFT);
+      alignment = (m_field->get_glom_type() == Field::TYPE_NUMERIC ? Formatting::HORIZONTAL_ALIGNMENT_RIGHT : Formatting::HORIZONTAL_ALIGNMENT_LEFT);
     }
     else
-      alignment = FieldFormatting::HORIZONTAL_ALIGNMENT_LEFT;
+      alignment = Formatting::HORIZONTAL_ALIGNMENT_LEFT;
   }
   
   return alignment;
@@ -276,7 +276,7 @@ FieldFormatting::HorizontalAlignment LayoutItem_Field::get_formatting_used_horiz
 
 bool LayoutItem_Field::get_formatting_used_has_translatable_choices() const
 {
-  const FieldFormatting& formatting = get_formatting_used();
+  const Formatting& formatting = get_formatting_used();
   if(!formatting.get_has_custom_choices())
     return false;
 
diff --git a/glom/libglom/data_structure/layout/layoutitem_field.h b/glom/libglom/data_structure/layout/layoutitem_field.h
index 6bfe86f..f822d0c 100644
--- a/glom/libglom/data_structure/layout/layoutitem_field.h
+++ b/glom/libglom/data_structure/layout/layoutitem_field.h
@@ -151,7 +151,7 @@ public:
   /** Get the field formatting used by this layout item, which 
    * may be either custom field formatting or the default field formatting.
    */
-  virtual const FieldFormatting& get_formatting_used() const;
+  virtual const Formatting& get_formatting_used() const;
 
   /** Get the alignment for the formatting used (see get_formatting_used()),
    * choosing an appropriate alignment if it is set to HORIZONTAL_ALIGNMENT_AUTO.
@@ -159,7 +159,7 @@ public:
    *
    * @param for_details_view This can change the effect of HORIZONTAL_ALIGNMENT_AUTO.
    */
-  virtual FieldFormatting::HorizontalAlignment get_formatting_used_horizontal_alignment(bool for_details_view = false) const;
+  virtual Formatting::HorizontalAlignment get_formatting_used_horizontal_alignment(bool for_details_view = false) const;
 
   /** A convenience method to discover whether the formatting that is used
    * has custom choices with the values restricted to those choices,
diff --git a/glom/libglom/data_structure/layout/layoutitem_text.h b/glom/libglom/data_structure/layout/layoutitem_text.h
index 3244f74..53060a3 100644
--- a/glom/libglom/data_structure/layout/layoutitem_text.h
+++ b/glom/libglom/data_structure/layout/layoutitem_text.h
@@ -22,7 +22,7 @@
 #define GLOM_DATASTRUCTURE_LAYOUTITEM_TEXT_H
 
 #include <libglom/data_structure/layout/layoutitem_withformatting.h>
-#include <libglom/data_structure/layout/fieldformatting.h>
+#include <libglom/data_structure/layout/formatting.h>
 
 namespace Glom
 {
diff --git a/glom/libglom/data_structure/layout/layoutitem_withformatting.cc b/glom/libglom/data_structure/layout/layoutitem_withformatting.cc
index 49aa5c2..086dac6 100644
--- a/glom/libglom/data_structure/layout/layoutitem_withformatting.cc
+++ b/glom/libglom/data_structure/layout/layoutitem_withformatting.cc
@@ -56,19 +56,19 @@ LayoutItem_WithFormatting& LayoutItem_WithFormatting::operator=(const LayoutItem
   return *this;
 }
 
-const FieldFormatting& LayoutItem_WithFormatting::get_formatting_used() const
+const Formatting& LayoutItem_WithFormatting::get_formatting_used() const
 {
   return m_formatting;
 }
 
-FieldFormatting::HorizontalAlignment LayoutItem_WithFormatting::get_formatting_used_horizontal_alignment(bool /* for_details_view */) const
+Formatting::HorizontalAlignment LayoutItem_WithFormatting::get_formatting_used_horizontal_alignment(bool /* for_details_view */) const
 {
-  const FieldFormatting& format = get_formatting_used();
-  FieldFormatting::HorizontalAlignment alignment = 
+  const Formatting& format = get_formatting_used();
+  Formatting::HorizontalAlignment alignment = 
     format.get_horizontal_alignment();
   
-  if(alignment == FieldFormatting::HORIZONTAL_ALIGNMENT_AUTO)
-    alignment = FieldFormatting::HORIZONTAL_ALIGNMENT_LEFT;
+  if(alignment == Formatting::HORIZONTAL_ALIGNMENT_AUTO)
+    alignment = Formatting::HORIZONTAL_ALIGNMENT_LEFT;
   
   return alignment;
 }
diff --git a/glom/libglom/data_structure/layout/layoutitem_withformatting.h b/glom/libglom/data_structure/layout/layoutitem_withformatting.h
index 9748d83..1f56f63 100644
--- a/glom/libglom/data_structure/layout/layoutitem_withformatting.h
+++ b/glom/libglom/data_structure/layout/layoutitem_withformatting.h
@@ -22,7 +22,7 @@
 #define GLOM_DATASTRUCTURE_LAYOUTITEM_WITHFORMATTING_H
 
 #include "layoutitem.h"
-#include "fieldformatting.h"
+#include "formatting.h"
 
 namespace Glom
 {
@@ -42,18 +42,18 @@ public:
 
   bool operator==(const LayoutItem_WithFormatting& src) const;
 
-  FieldFormatting m_formatting;
+  Formatting m_formatting;
 
   /** Get the field formatting used by this layout item, which 
    * may be either custom field formatting or the default field formatting.
    */
-  virtual const FieldFormatting& get_formatting_used() const;
+  virtual const Formatting& get_formatting_used() const;
 
   /** Get the alignment for the formatting used (see get_formatting_used()),
    * choosing an appropriate alignment if it is set to HORIZONTAL_ALIGNMENT_AUTO.
    * Note that this never returns HORIZONTAL_ALIGNMENT_AUTO.
    */
-  virtual FieldFormatting::HorizontalAlignment get_formatting_used_horizontal_alignment(bool for_details_view = false) const;
+  virtual Formatting::HorizontalAlignment get_formatting_used_horizontal_alignment(bool for_details_view = false) const;
 };
 
 } //namespace Glom
diff --git a/glom/libglom/data_structure/layout/report_parts/layoutitem_groupby.h b/glom/libglom/data_structure/layout/report_parts/layoutitem_groupby.h
index 40a4128..9a65b48 100644
--- a/glom/libglom/data_structure/layout/report_parts/layoutitem_groupby.h
+++ b/glom/libglom/data_structure/layout/report_parts/layoutitem_groupby.h
@@ -45,8 +45,8 @@ public:
 
   virtual LayoutItem* clone() const;
 
-  typedef FieldFormatting::type_pair_sort_field type_pair_sort_field;
-  typedef FieldFormatting::type_list_sort_fields type_list_sort_fields;
+  typedef Formatting::type_pair_sort_field type_pair_sort_field;
+  typedef Formatting::type_list_sort_fields type_list_sort_fields;
 
   sharedptr<LayoutItem_Field> get_field_group_by();
   sharedptr<const LayoutItem_Field> get_field_group_by() const;
diff --git a/glom/libglom/data_structure/layout/usesrelationship.cc b/glom/libglom/data_structure/layout/usesrelationship.cc
index 9928c31..49a44dc 100644
--- a/glom/libglom/data_structure/layout/usesrelationship.cc
+++ b/glom/libglom/data_structure/layout/usesrelationship.cc
@@ -18,7 +18,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <libglom/data_structure/layout/fieldformatting.h>
+#include <libglom/data_structure/layout/formatting.h>
 #include <glibmm/i18n.h>
 
 namespace Glom
diff --git a/glom/libglom/document/document.cc b/glom/libglom/document/document.cc
index f0027e1..4d30602 100644
--- a/glom/libglom/document/document.cc
+++ b/glom/libglom/document/document.cc
@@ -952,7 +952,7 @@ void Document::change_field_name(const Glib::ustring& table_name, const Glib::us
           continue;
 
         //Formatting:
-        FieldFormatting& formatting = field->m_default_formatting;
+        Formatting& formatting = field->m_default_formatting;
         formatting.change_field_item_name(table_name, strFieldNameOld, strFieldNameNew);
       }
 
@@ -1246,9 +1246,9 @@ void Document::set_tables(const type_listTableInfo& tables)
     set_modified();
 }
 
-void Document::fill_sort_field_details(const Glib::ustring& parent_table_name, FieldFormatting::type_list_sort_fields& sort_fields) const
+void Document::fill_sort_field_details(const Glib::ustring& parent_table_name, Formatting::type_list_sort_fields& sort_fields) const
 {
-  for(FieldFormatting::type_list_sort_fields::iterator iter = sort_fields.begin(); iter != sort_fields.end(); ++iter)
+  for(Formatting::type_list_sort_fields::iterator iter = sort_fields.begin(); iter != sort_fields.end(); ++iter)
   {
     sharedptr<const LayoutItem_Field> sort_field = iter->first;
     if(!sort_field)
@@ -1280,7 +1280,7 @@ void Document::fill_layout_field_details(const Glib::ustring& parent_table_name,
       sharedptr<const Relationship> choice_relationship;
       sharedptr<LayoutItem_Field> choice_layout_first;
       sharedptr<LayoutGroup> choice_extra_layouts;
-      FieldFormatting::type_list_sort_fields choice_sort_fields;
+      Formatting::type_list_sort_fields choice_sort_fields;
       bool choice_show_all = false;
       layout_withformatting->m_formatting.get_choices_related(choice_relationship, choice_layout_first, choice_extra_layouts, choice_sort_fields, choice_show_all);
       
@@ -1303,7 +1303,7 @@ void Document::fill_layout_field_details(const Glib::ustring& parent_table_name,
         sharedptr<const Relationship> choice_relationship;
         sharedptr<LayoutItem_Field> choice_layout_first;
         sharedptr<LayoutGroup> choice_extra_layouts;
-        FieldFormatting::type_list_sort_fields choice_sort_fields;
+        Formatting::type_list_sort_fields choice_sort_fields;
         bool choice_show_all = false;
         field->m_default_formatting.get_choices_related(choice_relationship, choice_layout_first, choice_extra_layouts, choice_sort_fields, choice_show_all);
         
@@ -1822,7 +1822,7 @@ void Document::load_after_layout_item_formatting(const xmlpp::Element* element,
   if(!layout_item)
     return;
 
-  FieldFormatting& format = layout_item->m_formatting;
+  Formatting& format = layout_item->m_formatting;
 
   sharedptr<LayoutItem_Field> field = sharedptr<LayoutItem_Field>::cast_dynamic(layout_item);
 
@@ -1837,7 +1837,7 @@ void Document::load_after_layout_item_formatting(const xmlpp::Element* element,
   load_after_layout_item_formatting(element, format, field_type, table_name, field_name);
 }
 
-void Document::load_after_layout_item_formatting(const xmlpp::Element* element, FieldFormatting& format, Field::glom_field_type field_type, const Glib::ustring& table_name, const Glib::ustring& field_name)
+void Document::load_after_layout_item_formatting(const xmlpp::Element* element, Formatting& format, Field::glom_field_type field_type, const Glib::ustring& table_name, const Glib::ustring& field_name)
 {
   //Numeric formatting:
   if(!field_name.empty() && (field_type == Field::TYPE_NUMERIC))
@@ -1863,12 +1863,12 @@ void Document::load_after_layout_item_formatting(const xmlpp::Element* element,
   format.set_text_format_color_background( XmlUtils::get_node_attribute_value (element, GLOM_ATTRIBUTE_FORMAT_TEXT_COLOR_BACKGROUND) );
 
   //Alignment. Not-specified means auto.
-  FieldFormatting::HorizontalAlignment alignment = FieldFormatting::HORIZONTAL_ALIGNMENT_AUTO;
+  Formatting::HorizontalAlignment alignment = Formatting::HORIZONTAL_ALIGNMENT_AUTO;
   const Glib::ustring alignment_str = XmlUtils::get_node_attribute_value (element, GLOM_ATTRIBUTE_FORMAT_HORIZONTAL_ALIGNMENT);
   if(alignment_str == GLOM_ATTRIBUTE_FORMAT_HORIZONTAL_ALIGNMENT_LEFT)
-    alignment = FieldFormatting::HORIZONTAL_ALIGNMENT_LEFT;
+    alignment = Formatting::HORIZONTAL_ALIGNMENT_LEFT;
   else if(alignment_str == GLOM_ATTRIBUTE_FORMAT_HORIZONTAL_ALIGNMENT_RIGHT)
-    alignment = FieldFormatting::HORIZONTAL_ALIGNMENT_RIGHT;
+    alignment = Formatting::HORIZONTAL_ALIGNMENT_RIGHT;
 
   format.set_horizontal_alignment(alignment);
 
@@ -1885,7 +1885,7 @@ void Document::load_after_layout_item_formatting(const xmlpp::Element* element,
       const xmlpp::Element* nodeChoiceList = XmlUtils::get_node_child_named(element, GLOM_ATTRIBUTE_FORMAT_CHOICES_CUSTOM_LIST);
       if(nodeChoiceList)
       {
-        FieldFormatting::type_list_values list_values;
+        Formatting::type_list_values list_values;
 
         xmlpp::Node::NodeList listNodesCustomChoices = nodeChoiceList->get_children(GLOM_NODE_FORMAT_CUSTOM_CHOICE);
         for(xmlpp::Node::NodeList::iterator iter = listNodesCustomChoices.begin(); iter != listNodesCustomChoices.end(); ++iter)
@@ -1967,7 +1967,7 @@ void Document::load_after_layout_item_formatting(const xmlpp::Element* element,
       }
 
       //Sort fields:
-      FieldFormatting::type_list_sort_fields sort_fields;
+      Formatting::type_list_sort_fields sort_fields;
       xmlpp::Element* elementSortBy = XmlUtils::get_node_child_named(element, GLOM_ATTRIBUTE_FORMAT_CHOICES_RELATED_SORTBY);
       if(elementSortBy)
       {
@@ -3014,7 +3014,7 @@ void Document::save_before_layout_item_formatting(xmlpp::Element* nodeItem, cons
   if(!layout_item)
     return;
 
-  const FieldFormatting& format = layout_item->m_formatting;
+  const Formatting& format = layout_item->m_formatting;
 
   sharedptr<const LayoutItem_Field> field = sharedptr<const LayoutItem_Field>::cast_dynamic(layout_item);
 
@@ -3025,7 +3025,7 @@ void Document::save_before_layout_item_formatting(xmlpp::Element* nodeItem, cons
   save_before_layout_item_formatting(nodeItem, format, field_type);
 }
 
-void Document::save_before_layout_item_formatting(xmlpp::Element* nodeItem, const FieldFormatting& format, Field::glom_field_type field_type)
+void Document::save_before_layout_item_formatting(xmlpp::Element* nodeItem, const Formatting& format, Field::glom_field_type field_type)
 {
   //Numeric format:
   if(field_type != Field::TYPE_INVALID)  //These options are only for fields:
@@ -3060,11 +3060,11 @@ void Document::save_before_layout_item_formatting(xmlpp::Element* nodeItem, cons
   XmlUtils::set_node_attribute_value(nodeItem, GLOM_ATTRIBUTE_FORMAT_TEXT_COLOR_BACKGROUND, format.get_text_format_color_background());
 
   //Alignment:
-  const FieldFormatting::HorizontalAlignment alignment = format.get_horizontal_alignment();
-  if(alignment != FieldFormatting::HORIZONTAL_ALIGNMENT_AUTO) //Save file-size by not even writing this.
+  const Formatting::HorizontalAlignment alignment = format.get_horizontal_alignment();
+  if(alignment != Formatting::HORIZONTAL_ALIGNMENT_AUTO) //Save file-size by not even writing this.
   {
     const Glib::ustring alignment_str =
-      (alignment == FieldFormatting::HORIZONTAL_ALIGNMENT_LEFT  ? GLOM_ATTRIBUTE_FORMAT_HORIZONTAL_ALIGNMENT_LEFT : GLOM_ATTRIBUTE_FORMAT_HORIZONTAL_ALIGNMENT_RIGHT);
+      (alignment == Formatting::HORIZONTAL_ALIGNMENT_LEFT  ? GLOM_ATTRIBUTE_FORMAT_HORIZONTAL_ALIGNMENT_LEFT : GLOM_ATTRIBUTE_FORMAT_HORIZONTAL_ALIGNMENT_RIGHT);
     XmlUtils::set_node_attribute_value(nodeItem, GLOM_ATTRIBUTE_FORMAT_HORIZONTAL_ALIGNMENT, alignment_str);
   }
 
@@ -3075,8 +3075,8 @@ void Document::save_before_layout_item_formatting(xmlpp::Element* nodeItem, cons
     {
       xmlpp::Element* child = nodeItem->add_child(GLOM_ATTRIBUTE_FORMAT_CHOICES_CUSTOM_LIST);
 
-      const FieldFormatting::type_list_values list_values = format.get_choices_custom();
-      for(FieldFormatting::type_list_values::const_iterator iter = list_values.begin(); iter != list_values.end(); ++iter)
+      const Formatting::type_list_values list_values = format.get_choices_custom();
+      for(Formatting::type_list_values::const_iterator iter = list_values.begin(); iter != list_values.end(); ++iter)
       {
         const sharedptr<const ChoiceValue> value = *iter; 
         xmlpp::Element* childChoice = child->add_child(GLOM_NODE_FORMAT_CUSTOM_CHOICE);
@@ -3089,7 +3089,7 @@ void Document::save_before_layout_item_formatting(xmlpp::Element* nodeItem, cons
     sharedptr<const Relationship> choice_relationship;
     sharedptr<const LayoutItem_Field> choice_layout_first;
     sharedptr<const LayoutGroup> choice_extra_layouts;
-    FieldFormatting::type_list_sort_fields choice_sort_fields;
+    Formatting::type_list_sort_fields choice_sort_fields;
     bool choice_show_all = false;
     format.get_choices_related(choice_relationship, choice_layout_first, choice_extra_layouts, choice_sort_fields, choice_show_all);
 
@@ -4356,13 +4356,13 @@ Document::type_list_translatables Document::get_translatable_report_items(const
   return the_list;
 }
 
-void Document::fill_translatable_custom_choices(FieldFormatting& formatting, type_list_translatables& the_list, const Glib::ustring& hint)
+void Document::fill_translatable_custom_choices(Formatting& formatting, type_list_translatables& the_list, const Glib::ustring& hint)
 {
   if(!formatting.get_has_custom_choices())
     return;
 
-  FieldFormatting::type_list_values values = formatting.get_choices_custom();
-  for(FieldFormatting::type_list_values::iterator iter = values.begin(); iter != values.end(); ++iter)
+  Formatting::type_list_values values = formatting.get_choices_custom();
+  for(Formatting::type_list_values::iterator iter = values.begin(); iter != values.end(); ++iter)
   {
     sharedptr<ChoiceValue> value = *iter;
 
diff --git a/glom/libglom/document/document.h b/glom/libglom/document/document.h
index 4bcef92..493133d 100644
--- a/glom/libglom/document/document.h
+++ b/glom/libglom/document/document.h
@@ -264,7 +264,7 @@ public:
   typedef std::vector<pair_translatable_item_and_hint> type_list_translatables;
   type_list_translatables get_translatable_items();
 
-  static void fill_translatable_custom_choices(FieldFormatting& formatting, type_list_translatables& the_list, const Glib::ustring& hint);
+  static void fill_translatable_custom_choices(Formatting& formatting, type_list_translatables& the_list, const Glib::ustring& hint);
 
 
   void fill_layout_field_details(const Glib::ustring& parent_table_name, const sharedptr<LayoutGroup>& layout_group) const;
@@ -491,7 +491,7 @@ private:
   void save_before_sort_by(xmlpp::Element* node, const LayoutItem_GroupBy::type_list_sort_fields& list_fields);
   void save_before_layout_item_usesrelationship(xmlpp::Element* nodeItem, const sharedptr<const UsesRelationship>& item);
   void save_before_layout_item_field(xmlpp::Element* nodeItem, const sharedptr<const LayoutItem_Field>& item);
-  void save_before_layout_item_formatting(xmlpp::Element* nodeItem, const FieldFormatting& format, Field::glom_field_type field_type = Field::TYPE_INVALID);
+  void save_before_layout_item_formatting(xmlpp::Element* nodeItem, const Formatting& format, Field::glom_field_type field_type = Field::TYPE_INVALID);
   void save_before_layout_item_formatting(xmlpp::Element* nodeItem, const sharedptr<const LayoutItem_WithFormatting>& layout_item);
 
   void save_before_translations(xmlpp::Element* nodeItem, const sharedptr<const TranslatableItem>& item);
@@ -505,7 +505,7 @@ private:
   void load_after_sort_by(const xmlpp::Element* node, const Glib::ustring& table_name, LayoutItem_GroupBy::type_list_sort_fields& list_fields);
   void load_after_layout_item_usesrelationship(const xmlpp::Element* element, const Glib::ustring& table_name, const sharedptr<UsesRelationship>& item);
   void load_after_layout_item_field(const xmlpp::Element* element, const Glib::ustring& table_name, const sharedptr<LayoutItem_Field>& item);
-  void load_after_layout_item_formatting(const xmlpp::Element* element, FieldFormatting& format, Field::glom_field_type field_type = Field::TYPE_INVALID, const Glib::ustring& table_name = Glib::ustring(), const Glib::ustring& field_name = Glib::ustring());
+  void load_after_layout_item_formatting(const xmlpp::Element* element, Formatting& format, Field::glom_field_type field_type = Field::TYPE_INVALID, const Glib::ustring& table_name = Glib::ustring(), const Glib::ustring& field_name = Glib::ustring());
  void load_after_layout_item_formatting(const xmlpp::Element* element, const sharedptr<LayoutItem_WithFormatting>& layout_item, const Glib::ustring& table_name = Glib::ustring());
 
   void load_after_translations(const xmlpp::Element* element, const sharedptr<TranslatableItem>& item);
@@ -517,7 +517,7 @@ private:
   static void fill_translatable_layout_items(const sharedptr<LayoutItem_Field>& layout_field, type_list_translatables& the_list, const Glib::ustring& hint);
   static void fill_translatable_layout_items(const sharedptr<LayoutGroup>& group, type_list_translatables& the_list, const Glib::ustring& hint);
 
-  void fill_sort_field_details(const Glib::ustring& parent_table_name, FieldFormatting::type_list_sort_fields& sort_fields) const;
+  void fill_sort_field_details(const Glib::ustring& parent_table_name, Formatting::type_list_sort_fields& sort_fields) const;
 
   type_list_translatables get_translatable_layout_items(const Glib::ustring& table_name, const Glib::ustring& hint);
   type_list_translatables get_translatable_report_items(const Glib::ustring& table_name, const Glib::ustring& report_title, const Glib::ustring& hint);
diff --git a/glom/libglom/filelist.am b/glom/libglom/filelist.am
index 55177b8..1881fe9 100644
--- a/glom/libglom/filelist.am
+++ b/glom/libglom/filelist.am
@@ -48,7 +48,7 @@ libglom_data_structure_headers =				\
 
 libglom_ds_layout_headers =						\
 	glom/libglom/data_structure/layout/custom_title.h		\
-	glom/libglom/data_structure/layout/fieldformatting.h		\
+	glom/libglom/data_structure/layout/formatting.h		\
 	glom/libglom/data_structure/layout/layoutgroup.h		\
 	glom/libglom/data_structure/layout/layoutitem.h			\
 	glom/libglom/data_structure/layout/layoutitem_button.h		\
@@ -141,7 +141,7 @@ libglom_sources =							\
 	glom/libglom/data_structure/tableinfo.cc			\
 	glom/libglom/data_structure/translatable_item.cc		\
 	glom/libglom/data_structure/layout/custom_title.cc		\
-	glom/libglom/data_structure/layout/fieldformatting.cc		\
+	glom/libglom/data_structure/layout/formatting.cc		\
 	glom/libglom/data_structure/layout/layoutgroup.cc		\
 	glom/libglom/data_structure/layout/layoutitem.cc		\
 	glom/libglom/data_structure/layout/layoutitem_button.cc		\
diff --git a/glom/libglom/utils.cc b/glom/libglom/utils.cc
index 209c4d5..bda82de 100644
--- a/glom/libglom/utils.cc
+++ b/glom/libglom/utils.cc
@@ -551,11 +551,11 @@ Utils::type_list_values_with_second Utils::get_choice_values(const Document* doc
   }
   */
 
-  const FieldFormatting& format = field->get_formatting_used();
+  const Formatting& format = field->get_formatting_used();
   sharedptr<const Relationship> choice_relationship;
   sharedptr<const LayoutItem_Field> layout_choice_first;
   sharedptr<const LayoutGroup> layout_choice_extra;
-  FieldFormatting::type_list_sort_fields choice_sort_fields;
+  Formatting::type_list_sort_fields choice_sort_fields;
   bool choice_show_all = false;
   format.get_choices_related(choice_relationship, layout_choice_first, layout_choice_extra, choice_sort_fields, choice_show_all);
 
@@ -1375,10 +1375,10 @@ Glib::ustring Utils::get_list_of_layout_items_for_display(const sharedptr<const
     return Glib::ustring();
 }
 
-Glib::ustring Utils::get_list_of_sort_fields_for_display(const FieldFormatting::type_list_sort_fields& sort_fields)
+Glib::ustring Utils::get_list_of_sort_fields_for_display(const Formatting::type_list_sort_fields& sort_fields)
 {
   Glib::ustring text;
-  for(FieldFormatting::type_list_sort_fields::const_iterator iter = sort_fields.begin(); iter != sort_fields.end(); ++iter)
+  for(Formatting::type_list_sort_fields::const_iterator iter = sort_fields.begin(); iter != sort_fields.end(); ++iter)
   {
     const sharedptr<const LayoutItem_Field> item = iter->first;
     if(!item)
diff --git a/glom/libglom/utils.h b/glom/libglom/utils.h
index cc48666..2e0c9b6 100644
--- a/glom/libglom/utils.h
+++ b/glom/libglom/utils.h
@@ -212,7 +212,7 @@ Glib::ustring get_list_of_layout_items_for_display(const sharedptr<const LayoutG
 
 /** Get a string to display to the user, as a representation of a sort order
  */
-Glib::ustring get_list_of_sort_fields_for_display(const FieldFormatting::type_list_sort_fields& sort_fields);
+Glib::ustring get_list_of_sort_fields_for_display(const Formatting::type_list_sort_fields& sort_fields);
 
 /** This returns the provided list of layout items,
  * plus the primary key, if the primary key is not already present in the list
diff --git a/glom/mode_data/datawidget/cellcreation.cc b/glom/mode_data/datawidget/cellcreation.cc
index 17784a8..db8e96f 100644
--- a/glom/mode_data/datawidget/cellcreation.cc
+++ b/glom/mode_data/datawidget/cellcreation.cc
@@ -46,12 +46,12 @@ static void apply_formatting(Gtk::CellRenderer* renderer, const sharedptr<const
   //Use the text formatting:
 
   //Horizontal alignment:
-  const FieldFormatting::HorizontalAlignment alignment =
+  const Formatting::HorizontalAlignment alignment =
     layout_item->get_formatting_used_horizontal_alignment();
-  const float x_align = (alignment == FieldFormatting::HORIZONTAL_ALIGNMENT_LEFT ? 0.0 : 1.0);
+  const float x_align = (alignment == Formatting::HORIZONTAL_ALIGNMENT_LEFT ? 0.0 : 1.0);
   text_renderer->property_xalign() = x_align;
 
-  const FieldFormatting& formatting = layout_item->get_formatting_used();
+  const Formatting& formatting = layout_item->get_formatting_used();
 
   const Glib::ustring font_desc = formatting.get_text_format_font();
   if(!font_desc.empty())
@@ -99,7 +99,7 @@ Gtk::CellRenderer* create_cell(const sharedptr<const LayoutItem>& layout_item, c
       }
       default:
       {
-        const FieldFormatting& formatting = item_field->get_formatting_used();
+        const Formatting& formatting = item_field->get_formatting_used();
         if(formatting.get_has_choices())
         {
           CellRendererDbList* rendererList = Gtk::manage( new CellRendererDbList() );
@@ -209,8 +209,8 @@ Gtk::CellRenderer* create_cell(const sharedptr<const LayoutItem>& layout_item, c
     {
       //set_choices_fixed() needs this, for the numeric layout:
       //pCellRendererCombo->set_layout_item(get_layout_item()->clone(), table_name); //TODO_Performance: We only need this for the numerical format.
-      const FieldFormatting::type_list_values list_values = item_field->get_formatting_used().get_choices_custom();
-      for(FieldFormatting::type_list_values::const_iterator iter = list_values.begin(); iter != list_values.end(); ++iter)
+      const Formatting::type_list_values list_values = item_field->get_formatting_used().get_choices_custom();
+      for(Formatting::type_list_values::const_iterator iter = list_values.begin(); iter != list_values.end(); ++iter)
       {
         const sharedptr< const ChoiceValue> value = *iter;
         if(!value)
@@ -227,7 +227,7 @@ Gtk::CellRenderer* create_cell(const sharedptr<const LayoutItem>& layout_item, c
       sharedptr<const Relationship> choice_relationship;
       sharedptr<const LayoutItem_Field> choice_field;
       sharedptr<const LayoutGroup> choice_extras; //Ignored
-      FieldFormatting::type_list_sort_fields choice_sort_fields; //Ignored
+      Formatting::type_list_sort_fields choice_sort_fields; //Ignored
       bool choice_show_all = false;
       item_field->get_formatting_used().get_choices_related(choice_relationship, choice_field, choice_extras, choice_sort_fields, choice_show_all);
 
diff --git a/glom/mode_data/datawidget/cellrenderer_dblist.cc b/glom/mode_data/datawidget/cellrenderer_dblist.cc
index 4b36f9d..e101ee9 100644
--- a/glom/mode_data/datawidget/cellrenderer_dblist.cc
+++ b/glom/mode_data/datawidget/cellrenderer_dblist.cc
@@ -40,7 +40,7 @@ CellRendererDbList::~CellRendererDbList()
 }
 
 
-void CellRendererDbList::set_choices_fixed(const FieldFormatting::type_list_values& list_values, bool restricted)
+void CellRendererDbList::set_choices_fixed(const Formatting::type_list_values& list_values, bool restricted)
 {
   ComboChoicesWithTreeModel::set_choices_fixed(list_values, restricted);
 
diff --git a/glom/mode_data/datawidget/cellrenderer_dblist.h b/glom/mode_data/datawidget/cellrenderer_dblist.h
index 213bb40..8b4c899 100644
--- a/glom/mode_data/datawidget/cellrenderer_dblist.h
+++ b/glom/mode_data/datawidget/cellrenderer_dblist.h
@@ -41,7 +41,7 @@ public:
   virtual ~CellRendererDbList();
 
   //This creates a simple ListStore, with a text cell renderer.
-  virtual void set_choices_fixed(const FieldFormatting::type_list_values& list_values, bool restricted = false);
+  virtual void set_choices_fixed(const Formatting::type_list_values& list_values, bool restricted = false);
 
   //This creates a db-based tree model, with appropriate cell renderers:
   virtual void set_choices_related(const Document* document, const sharedptr<const LayoutItem_Field>& layout_field, const Gnome::Gda::Value& foreign_key_value);
diff --git a/glom/mode_data/datawidget/combo.cc b/glom/mode_data/datawidget/combo.cc
index 57cbffa..0b87135 100644
--- a/glom/mode_data/datawidget/combo.cc
+++ b/glom/mode_data/datawidget/combo.cc
@@ -85,7 +85,7 @@ void ComboGlom::on_fixed_cell_data(const Gtk::TreeModel::iterator& iter, Gtk::Ce
   set_cell_for_field_value(cell, field, value);
 }
 
-void ComboGlom::set_choices_fixed(const FieldFormatting::type_list_values& list_values, bool restricted)
+void ComboGlom::set_choices_fixed(const Formatting::type_list_values& list_values, bool restricted)
 {
   ComboChoicesWithTreeModel::set_choices_fixed(list_values, restricted);
 
diff --git a/glom/mode_data/datawidget/combo.h b/glom/mode_data/datawidget/combo.h
index 2c9a9b5..2272a1d 100644
--- a/glom/mode_data/datawidget/combo.h
+++ b/glom/mode_data/datawidget/combo.h
@@ -50,7 +50,7 @@ public:
   virtual ~ComboGlom();
 
   //This creates a simple ListStore, with a text cell renderer.
-  virtual void set_choices_fixed(const FieldFormatting::type_list_values& list_values, bool restricted = false);
+  virtual void set_choices_fixed(const Formatting::type_list_values& list_values, bool restricted = false);
 
   //This creates a db-based tree model, with appropriate cell renderers:
   virtual void set_choices_related(const Document* document, const sharedptr<const LayoutItem_Field>& layout_field, const Gnome::Gda::Value& foreign_key_value);
diff --git a/glom/mode_data/datawidget/combo_as_radio_buttons.cc b/glom/mode_data/datawidget/combo_as_radio_buttons.cc
index b12a912..1f627e7 100644
--- a/glom/mode_data/datawidget/combo_as_radio_buttons.cc
+++ b/glom/mode_data/datawidget/combo_as_radio_buttons.cc
@@ -65,11 +65,11 @@ void ComboAsRadioButtons::set_choices_with_second(const type_list_values_with_se
 
   sharedptr<LayoutItem_Field> layout_item =
     sharedptr<LayoutItem_Field>::cast_dynamic(get_layout_item());
-  const FieldFormatting& format = layout_item->get_formatting_used();
+  const Formatting& format = layout_item->get_formatting_used();
   sharedptr<const Relationship> choice_relationship;
   sharedptr<const LayoutItem_Field> layout_choice_first;
   sharedptr<const LayoutGroup> layout_choice_extra;
-  FieldFormatting::type_list_sort_fields choice_sort_fields; //Ignored. TODO?
+  Formatting::type_list_sort_fields choice_sort_fields; //Ignored. TODO?
   bool choice_show_all = false;
   format.get_choices_related(choice_relationship, layout_choice_first, layout_choice_extra, choice_sort_fields, choice_show_all);
 
@@ -121,7 +121,7 @@ void ComboAsRadioButtons::set_choices_with_second(const type_list_values_with_se
   }
 }
 
-void ComboAsRadioButtons::set_choices_fixed(const FieldFormatting::type_list_values& list_values, bool /* restricted */)
+void ComboAsRadioButtons::set_choices_fixed(const Formatting::type_list_values& list_values, bool /* restricted */)
 {
   //Clear existing buttons:
   for(type_map_buttons::iterator iter = m_map_buttons.begin();
@@ -134,7 +134,7 @@ void ComboAsRadioButtons::set_choices_fixed(const FieldFormatting::type_list_val
 
   //Add new buttons:
   Gtk::RadioButton::Group group;
-  for(FieldFormatting::type_list_values::const_iterator iter = list_values.begin(); iter != list_values.end(); ++iter)
+  for(Formatting::type_list_values::const_iterator iter = list_values.begin(); iter != list_values.end(); ++iter)
   {
     sharedptr<const LayoutItem_Field> layout_item = sharedptr<LayoutItem_Field>::cast_dynamic(get_layout_item());
     if(layout_item)
diff --git a/glom/mode_data/datawidget/combo_as_radio_buttons.h b/glom/mode_data/datawidget/combo_as_radio_buttons.h
index dd3ec0a..51aeff3 100644
--- a/glom/mode_data/datawidget/combo_as_radio_buttons.h
+++ b/glom/mode_data/datawidget/combo_as_radio_buttons.h
@@ -50,7 +50,7 @@ public:
 
   virtual ~ComboAsRadioButtons();
 
-  virtual void set_choices_fixed(const FieldFormatting::type_list_values& list_values, bool restricted = false);
+  virtual void set_choices_fixed(const Formatting::type_list_values& list_values, bool restricted = false);
 
   virtual void set_choices_related(const Document* document, const sharedptr<const LayoutItem_Field>& layout_field, const Gnome::Gda::Value& foreign_key_value);
 
diff --git a/glom/mode_data/datawidget/combochoices.h b/glom/mode_data/datawidget/combochoices.h
index f856784..894f803 100644
--- a/glom/mode_data/datawidget/combochoices.h
+++ b/glom/mode_data/datawidget/combochoices.h
@@ -48,7 +48,7 @@ public:
   /** Set a list of choice values, for instance for a list of custom choices.
    * You should first call set_layout_item() to provide formatting details.
    */
-  virtual void set_choices_fixed(const FieldFormatting::type_list_values& list_values, bool restricted = false) = 0;
+  virtual void set_choices_fixed(const Formatting::type_list_values& list_values, bool restricted = false) = 0;
 
   /** Show the list of related chocie values based on the LayoutItem's formatting choices.
    * You should first call set_layout_item() to provide that formatting detail,
diff --git a/glom/mode_data/datawidget/combochoiceswithtreemodel.cc b/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
index 3505ac6..b62ba58 100644
--- a/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
+++ b/glom/mode_data/datawidget/combochoiceswithtreemodel.cc
@@ -142,7 +142,7 @@ void ComboChoicesWithTreeModel::set_choices_with_second(const type_list_values_w
   //Fill the model with data:
   sharedptr<LayoutItem_Field> layout_item =
     sharedptr<LayoutItem_Field>::cast_dynamic(get_layout_item());
-  const FieldFormatting& format = layout_item->get_formatting_used();
+  const Formatting& format = layout_item->get_formatting_used();
   sharedptr<const Relationship> choice_relationship;
   sharedptr<const LayoutItem_Field> layout_choice_first;
   sharedptr<const LayoutGroup> layout_choice_extra;
@@ -205,7 +205,7 @@ void ComboChoicesWithTreeModel::set_choices_with_second(const type_list_values_w
 */
 
 
-void ComboChoicesWithTreeModel::set_choices_fixed(const FieldFormatting::type_list_values& list_values, bool restricted)
+void ComboChoicesWithTreeModel::set_choices_fixed(const Formatting::type_list_values& list_values, bool restricted)
 {
   create_model_non_db(1); //Use a regular ListStore without a dynamic column?
 
@@ -216,7 +216,7 @@ void ComboChoicesWithTreeModel::set_choices_fixed(const FieldFormatting::type_li
     return;
   }
 
-  for(FieldFormatting::type_list_values::const_iterator iter = list_values.begin(); iter != list_values.end(); ++iter)
+  for(Formatting::type_list_values::const_iterator iter = list_values.begin(); iter != list_values.end(); ++iter)
   {
     Gtk::TreeModel::iterator iterTree = list_store->append();
     Gtk::TreeModel::Row row = *iterTree;
@@ -263,11 +263,11 @@ void ComboChoicesWithTreeModel::set_choices_related(const Document* document, co
     return;
   }
 
-  const FieldFormatting& format = layout_field->get_formatting_used();
+  const Formatting& format = layout_field->get_formatting_used();
   sharedptr<const Relationship> choice_relationship;
   sharedptr<const LayoutItem_Field> layout_choice_first;
   sharedptr<const LayoutGroup> layout_choice_extra;
-  FieldFormatting::type_list_sort_fields choice_sort_fields;
+  Formatting::type_list_sort_fields choice_sort_fields;
   bool choice_show_all = false;
   format.get_choices_related(choice_relationship, layout_choice_first, layout_choice_extra, choice_sort_fields, choice_show_all);
   if(layout_choice_first->get_glom_type() == Field::TYPE_INVALID)
@@ -466,7 +466,7 @@ int ComboChoicesWithTreeModel::get_fixed_cell_height(Gtk::Widget& widget)
       const sharedptr<const LayoutItem_WithFormatting> item_withformatting = sharedptr<const LayoutItem_WithFormatting>::cast_dynamic(*iter);
       if(item_withformatting)
       {
-         const FieldFormatting& formatting = item_withformatting->get_formatting_used();
+         const Formatting& formatting = item_withformatting->get_formatting_used();
          font_name = formatting.get_text_format_font();
       }
 
diff --git a/glom/mode_data/datawidget/combochoiceswithtreemodel.h b/glom/mode_data/datawidget/combochoiceswithtreemodel.h
index 75a7f83..7a4cda9 100644
--- a/glom/mode_data/datawidget/combochoiceswithtreemodel.h
+++ b/glom/mode_data/datawidget/combochoiceswithtreemodel.h
@@ -40,7 +40,7 @@ public:
   virtual ~ComboChoicesWithTreeModel();
 
   //This creates a simple ListStore, with a text cell renderer.
-  virtual void set_choices_fixed(const FieldFormatting::type_list_values& list_values, bool restricted = false);
+  virtual void set_choices_fixed(const Formatting::type_list_values& list_values, bool restricted = false);
 
   //This creates a db-based tree model, with appropriate cell renderers:
   virtual void set_choices_related(const Document* document, const sharedptr<const LayoutItem_Field>& layout_field, const Gnome::Gda::Value& foreign_key_value);
diff --git a/glom/mode_data/datawidget/datawidget.cc b/glom/mode_data/datawidget/datawidget.cc
index 3697bbd..f0fce15 100644
--- a/glom/mode_data/datawidget/datawidget.cc
+++ b/glom/mode_data/datawidget/datawidget.cc
@@ -123,7 +123,7 @@ DataWidget::DataWidget(const sharedptr<LayoutItem_Field>& field, const Glib::ust
         //set_choices_fixed() needs this, for the numeric layout:
         combo->set_layout_item( get_layout_item(), table_name);
 
-	const FieldFormatting& formatting = field->get_formatting_used();
+	const Formatting& formatting = field->get_formatting_used();
 	bool as_radio_buttons = false; //Ignored;
         combo->set_choices_fixed( formatting.get_choices_custom(), formatting.get_choices_restricted(as_radio_buttons));
       }
diff --git a/glom/mode_data/datawidget/entry.cc b/glom/mode_data/datawidget/entry.cc
index 35ab6c5..c36cc25 100644
--- a/glom/mode_data/datawidget/entry.cc
+++ b/glom/mode_data/datawidget/entry.cc
@@ -75,14 +75,14 @@ void Entry::set_layout_item(const sharedptr<LayoutItem>& layout_item, const Glib
 #endif
 
   //Horizontal Alignment:
-  FieldFormatting::HorizontalAlignment alignment = 
-    FieldFormatting::HORIZONTAL_ALIGNMENT_LEFT;
+  Formatting::HorizontalAlignment alignment = 
+    Formatting::HORIZONTAL_ALIGNMENT_LEFT;
   sharedptr<LayoutItem_Field> layout_field =
     sharedptr<LayoutItem_Field>::cast_dynamic(get_layout_item());
   if(layout_field)
     alignment = layout_field->get_formatting_used_horizontal_alignment(true /* for details view */);
 
-  const float x_align = (alignment == FieldFormatting::HORIZONTAL_ALIGNMENT_LEFT ? 0.0 : 1.0);
+  const float x_align = (alignment == Formatting::HORIZONTAL_ALIGNMENT_LEFT ? 0.0 : 1.0);
   set_alignment(x_align);
 }
 
diff --git a/glom/mode_data/db_adddel/db_adddel.cc b/glom/mode_data/db_adddel/db_adddel.cc
index dbaff53..1a226cc 100644
--- a/glom/mode_data/db_adddel/db_adddel.cc
+++ b/glom/mode_data/db_adddel/db_adddel.cc
@@ -553,7 +553,7 @@ guint DbAddDel::get_fixed_cell_height()
       sharedptr<const LayoutItem_WithFormatting> item_withformatting = sharedptr<const LayoutItem_WithFormatting>::cast_dynamic(*iter);
       if(item_withformatting)
       {
-         const FieldFormatting& formatting = item_withformatting->get_formatting_used();
+         const Formatting& formatting = item_withformatting->get_formatting_used();
          font_name = formatting.get_text_format_font();
       }
 
@@ -1045,7 +1045,7 @@ DbAddDel::type_list_indexes DbAddDel::get_choice_index(const sharedptr<const Lay
     if(!field)
        continue;
 
-    const FieldFormatting& format = field->get_formatting_used();
+    const Formatting& format = field->get_formatting_used();
 
     bool choice_show_all = false;
     const sharedptr<const Relationship> choice_relationship =
@@ -1486,7 +1486,7 @@ void DbAddDel::on_treeview_cell_edited(const Glib::ustring& path_string, const G
       //then make sure that we only write the original to the database, though we display the translated version:
       if(item_field->get_formatting_used_has_translatable_choices())
       {
-        const FieldFormatting& formatting = item_field->get_formatting_used();
+        const Formatting& formatting = item_field->get_formatting_used();
         new_text_to_save = formatting.get_custom_choice_original_for_translated_text(new_text);
 
         //If somehow (though this should be impossible), the user entered a 
@@ -1987,7 +1987,7 @@ void DbAddDel::treeviewcolumn_on_cell_data(Gtk::CellRenderer* renderer, const Gt
             //then make sure that we show the translated version, never showing the original text from the database:
             if(field->get_formatting_used_has_translatable_choices())
             {
-              const FieldFormatting& formatting = field->get_formatting_used();
+              const Formatting& formatting = field->get_formatting_used();
               const Glib::ustring text_to_show = formatting.get_custom_choice_translated(text);
 
               //Use the translation if there is one.
diff --git a/glom/mode_data/flowtablewithfields.cc b/glom/mode_data/flowtablewithfields.cc
index 004c6ee..b26cf26 100644
--- a/glom/mode_data/flowtablewithfields.cc
+++ b/glom/mode_data/flowtablewithfields.cc
@@ -578,18 +578,18 @@ void FlowTableWithFields::add_button(const sharedptr<LayoutItem_Button>& layouti
   add_layoutwidgetbase(button);
   //add_view(button); //So it can get the document.
 
-  const FieldFormatting::HorizontalAlignment alignment =
+  const Formatting::HorizontalAlignment alignment =
     layoutitem_button->get_formatting_used_horizontal_alignment();
   Gtk::Widget* widget_to_add = button;
   bool expand = false;
-  if(alignment != FieldFormatting::HORIZONTAL_ALIGNMENT_LEFT)
+  if(alignment != Formatting::HORIZONTAL_ALIGNMENT_LEFT)
   {
     //Put the button in a Gtk::Box so we can have non-default alignment in
     //its space. Note that we will need a different technique if we ever
     //support center alignment.
     Gtk::Box* box_button = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL));
     box_button->show();
-    if(alignment == FieldFormatting::HORIZONTAL_ALIGNMENT_RIGHT)
+    if(alignment == Formatting::HORIZONTAL_ALIGNMENT_RIGHT)
       box_button->pack_end(*button, Gtk::PACK_SHRINK);
     else
       box_button->pack_start(*button, Gtk::PACK_SHRINK);
@@ -607,9 +607,9 @@ void FlowTableWithFields::add_textobject(const sharedptr<LayoutItem_Text>& layou
 {
   //Add the widget:
 
-  const FieldFormatting::HorizontalAlignment alignment =
+  const Formatting::HorizontalAlignment alignment =
     layoutitem_text->get_formatting_used_horizontal_alignment();
-  const Gtk::Align x_align = (alignment == FieldFormatting::HORIZONTAL_ALIGNMENT_LEFT ? Gtk::ALIGN_START : Gtk::ALIGN_END);
+  const Gtk::Align x_align = (alignment == Formatting::HORIZONTAL_ALIGNMENT_LEFT ? Gtk::ALIGN_START : Gtk::ALIGN_END);
   Gtk::Alignment* alignment_label = Gtk::manage(new Gtk::Alignment());
   alignment_label->set(x_align, Gtk::ALIGN_CENTER);
   alignment_label->show();
@@ -897,7 +897,7 @@ FlowTableWithFields::type_choice_widgets FlowTableWithFields::get_choice_widgets
     if(!field)
       continue;
 
-    const FieldFormatting& format = field->get_formatting_used();
+    const Formatting& format = field->get_formatting_used();
 
     bool choice_show_all = false;
     const sharedptr<const Relationship> choice_relationship =
diff --git a/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc b/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc
index 0303edd..be00fb9 100644
--- a/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc
+++ b/glom/mode_design/layout/layout_item_dialogs/box_formatting.cc
@@ -110,15 +110,15 @@ Box_Formatting::Box_Formatting(BaseObjectType* cobject, const Glib::RefPtr<Gtk::
   m_model_alignment = Gtk::ListStore::create(m_columns_alignment);
 
   Gtk::TreeModel::iterator iter = m_model_alignment->append();
-  (*iter)[m_columns_alignment.m_col_alignment] = FieldFormatting::HORIZONTAL_ALIGNMENT_AUTO;
+  (*iter)[m_columns_alignment.m_col_alignment] = Formatting::HORIZONTAL_ALIGNMENT_AUTO;
   //Translators: This is Automatic text alignment.
   (*iter)[m_columns_alignment.m_col_title] = _("Automatic");
   iter = m_model_alignment->append();
-  (*iter)[m_columns_alignment.m_col_alignment] = FieldFormatting::HORIZONTAL_ALIGNMENT_LEFT;
+  (*iter)[m_columns_alignment.m_col_alignment] = Formatting::HORIZONTAL_ALIGNMENT_LEFT;
   //Translators: This is Left text alignment.
   (*iter)[m_columns_alignment.m_col_title] = _("Left");
   iter = m_model_alignment->append();
-  (*iter)[m_columns_alignment.m_col_alignment] = FieldFormatting::HORIZONTAL_ALIGNMENT_RIGHT;
+  (*iter)[m_columns_alignment.m_col_alignment] = Formatting::HORIZONTAL_ALIGNMENT_RIGHT;
   //Translators: This is Right text alignment.
   (*iter)[m_columns_alignment.m_col_title] = _("Right");
 
@@ -211,7 +211,7 @@ void Box_Formatting::set_is_for_non_editable()
   enforce_constraints();
 }
 
-void Box_Formatting::set_formatting_for_field(const FieldFormatting& format, const Glib::ustring& table_name, const sharedptr<const Field>& field)
+void Box_Formatting::set_formatting_for_field(const Formatting& format, const Glib::ustring& table_name, const sharedptr<const Field>& field)
 {
   //Used for choices and some extra text formatting:
   m_table_name = table_name;
@@ -221,7 +221,7 @@ void Box_Formatting::set_formatting_for_field(const FieldFormatting& format, con
     true /* show_numeric, ignoring anyway when m_field is set */);
 }
 
-void Box_Formatting::set_formatting_for_non_field(const FieldFormatting& format, bool show_numeric)
+void Box_Formatting::set_formatting_for_non_field(const Formatting& format, bool show_numeric)
 {
   //TODO: Split this into a private method, so that previously-set m_table_name and m_field (from set_formatting_for_field()) will not stay set.
 
@@ -243,7 +243,7 @@ void Box_Formatting::set_formatting_for_non_field(const FieldFormatting& format,
     format.m_numeric_format.m_alt_foreground_color_for_negatives );
 
   //Text formatting
-  const FieldFormatting::HorizontalAlignment alignment =
+  const Formatting::HorizontalAlignment alignment =
     format.get_horizontal_alignment();
   Gtk::TreeModel::Children children = m_model_alignment->children();
   for(Gtk::TreeModel::Children::iterator iter = children.begin(); iter != children.end(); ++iter)
@@ -290,7 +290,7 @@ void Box_Formatting::set_formatting_for_non_field(const FieldFormatting& format,
     sharedptr<const Relationship> choices_relationship;
     sharedptr<const LayoutItem_Field> choices_field;
     sharedptr<const LayoutGroup> choices_field_extras;
-    FieldFormatting::type_list_sort_fields choices_sort_fields;
+    Formatting::type_list_sort_fields choices_sort_fields;
     bool choices_show_all = false;
     format.get_choices_related(choices_relationship, choices_field, choices_field_extras, choices_sort_fields, choices_show_all);
 
@@ -326,8 +326,8 @@ void Box_Formatting::set_formatting_for_non_field(const FieldFormatting& format,
 
     //Custom choices:
     m_adddel_choices_custom->remove_all();
-    FieldFormatting::type_list_values list_choice_values = format.get_choices_custom();
-    for(FieldFormatting::type_list_values::const_iterator iter = list_choice_values.begin(); iter != list_choice_values.end(); ++iter)
+    Formatting::type_list_values list_choice_values = format.get_choices_custom();
+    for(Formatting::type_list_values::const_iterator iter = list_choice_values.begin(); iter != list_choice_values.end(); ++iter)
     {
       const sharedptr<ChoiceValue> choicevalue = *iter;
       Gnome::Gda::Value value;
@@ -347,7 +347,7 @@ void Box_Formatting::set_formatting_for_non_field(const FieldFormatting& format,
   enforce_constraints();
 }
 
-bool Box_Formatting::get_formatting(FieldFormatting& format) const
+bool Box_Formatting::get_formatting(Formatting& format) const
 {
   //Numeric Formatting:
   m_format.m_numeric_format.m_use_thousands_separator = m_checkbox_format_use_thousands->get_active();
@@ -363,7 +363,7 @@ bool Box_Formatting::get_formatting(FieldFormatting& format) const
 
   //Text formatting:
   Gtk::TreeModel::iterator iter = m_combo_format_text_horizontal_alignment->get_active();
-  FieldFormatting::HorizontalAlignment alignment = FieldFormatting::HORIZONTAL_ALIGNMENT_LEFT;
+  Formatting::HorizontalAlignment alignment = Formatting::HORIZONTAL_ALIGNMENT_LEFT;
   if(iter)
     alignment = (*iter)[m_columns_alignment.m_col_alignment];
   m_format.set_horizontal_alignment(alignment);
@@ -401,7 +401,7 @@ bool Box_Formatting::get_formatting(FieldFormatting& format) const
     sharedptr<LayoutGroup> layout_choice_extra = sharedptr<LayoutGroup>::create();
     layout_choice_extra->m_list_items = m_dialog_choices_extra_fields->get_fields();
 
-    const FieldFormatting::type_list_sort_fields sort_fields = m_dialog_choices_sortby->get_fields();
+    const Formatting::type_list_sort_fields sort_fields = m_dialog_choices_sortby->get_fields();
 
     m_format.set_choices_related(choices_relationship,
       layout_choice_first, layout_choice_extra,
@@ -409,7 +409,7 @@ bool Box_Formatting::get_formatting(FieldFormatting& format) const
       m_checkbutton_choices_related_show_all->get_active());
 
     //Custom choices:
-    FieldFormatting::type_list_values list_choice_values;
+    Formatting::type_list_values list_choice_values;
     Glib::RefPtr<Gtk::TreeModel> choices_model = m_adddel_choices_custom->get_model();
     if(choices_model)
     {
@@ -474,7 +474,7 @@ void Box_Formatting::on_combo_choices_relationship_changed()
 
       //If the related table name has changed then the list of sort fields will probably
       //be ignored, clearing the list, but we try to preserve it if possible:
-      const FieldFormatting::type_list_sort_fields sort_fields = m_dialog_choices_sortby->get_fields();
+      const Formatting::type_list_sort_fields sort_fields = m_dialog_choices_sortby->get_fields();
       m_dialog_choices_sortby->set_fields(relationship->get_to_table(), sort_fields);
 
       //Update the label: //TODO: Do the label updating in a shared function.
diff --git a/glom/mode_design/layout/layout_item_dialogs/box_formatting.h b/glom/mode_design/layout/layout_item_dialogs/box_formatting.h
index 33b64e1..7ff1aa6 100644
--- a/glom/mode_design/layout/layout_item_dialogs/box_formatting.h
+++ b/glom/mode_design/layout/layout_item_dialogs/box_formatting.h
@@ -55,15 +55,15 @@ public:
   /**
    * @param format The starting information.
    */
-  void set_formatting_for_non_field(const FieldFormatting& format, bool show_numeric = true);
+  void set_formatting_for_non_field(const Formatting& format, bool show_numeric = true);
 
   /**
    * @param format The starting information.
    * @param table_name The field's table.
    * @param The field that will have this formatting, so we know what formatting options to allow.
    */
-  void set_formatting_for_field(const FieldFormatting& format, const Glib::ustring& table_name, const sharedptr<const Field>& field);
-  bool get_formatting(FieldFormatting& format) const;
+  void set_formatting_for_field(const Formatting& format, const Glib::ustring& table_name, const sharedptr<const Field>& field);
+  bool get_formatting(Formatting& format) const;
 
   /** When used, for instance, for print layout items or choice lists,
    * where the user could not edit the field anyway.
@@ -123,7 +123,7 @@ private:
   Dialog_FieldsList* m_dialog_choices_extra_fields;
   Dialog_SortFields* m_dialog_choices_sortby;
 
-  mutable FieldFormatting m_format;
+  mutable Formatting m_format;
 
   Glib::ustring m_table_name;
   sharedptr<const Field> m_field;
@@ -144,7 +144,7 @@ private:
     AlignmentColumns()
     { add(m_col_alignment); add(m_col_title); }
 
-    Gtk::TreeModelColumn<FieldFormatting::HorizontalAlignment> m_col_alignment;
+    Gtk::TreeModelColumn<Formatting::HorizontalAlignment> m_col_alignment;
     Gtk::TreeModelColumn<Glib::ustring> m_col_title;
   };
 
diff --git a/glom/print_layout/canvas_layout_item.cc b/glom/print_layout/canvas_layout_item.cc
index d92a701..3942924 100644
--- a/glom/print_layout/canvas_layout_item.cc
+++ b/glom/print_layout/canvas_layout_item.cc
@@ -72,12 +72,12 @@ void CanvasLayoutItem::apply_formatting(const Glib::RefPtr<CanvasTextMovable>& c
     return;
 
   //Horizontal alignment:
-  const FieldFormatting::HorizontalAlignment alignment =
+  const Formatting::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);
+  const Pango::Alignment x_align = (alignment == Formatting::HORIZONTAL_ALIGNMENT_LEFT ? Pango::ALIGN_LEFT : Pango::ALIGN_RIGHT);
   canvas_item->property_alignment() = x_align;
 
-  const FieldFormatting& formatting = layout_item->get_formatting_used();
+  const Formatting& formatting = layout_item->get_formatting_used();
 
   Glib::ustring font = formatting.get_text_format_font();
   if(font.empty())
diff --git a/glom/print_layout/canvas_layout_item.h b/glom/print_layout/canvas_layout_item.h
index 0921f0a..cddc1d4 100644
--- a/glom/print_layout/canvas_layout_item.h
+++ b/glom/print_layout/canvas_layout_item.h
@@ -31,7 +31,7 @@ namespace Glom
 
 class CanvasTextMovable;
 class CanvasTableMovable;
-class FieldFormatting;
+class Formatting;
 class LayoutItem_Portal;
 
 /** This has the appropriate child canvas item, depending on the type of the child LayoutItem.
diff --git a/glom/print_layout/canvas_print_layout.cc b/glom/print_layout/canvas_print_layout.cc
index a700a99..5e52eca 100644
--- a/glom/print_layout/canvas_print_layout.cc
+++ b/glom/print_layout/canvas_print_layout.cc
@@ -496,12 +496,12 @@ void Canvas_PrintLayout::on_context_menu_formatting()
   //TODO: Maybe they should. TODO: Maybe they already do.
   if(layout_item_field)
   {
-    const FieldFormatting& formatting = layout_item_field->m_formatting;
+    const Formatting& formatting = layout_item_field->m_formatting;
     m_dialog_format->m_box_formatting->set_formatting_for_field(formatting, m_table_name, layout_item_field->get_full_field_details());
   }
   else
   {
-    const FieldFormatting& formatting = layout_item_text->m_formatting;
+    const Formatting& formatting = layout_item_text->m_formatting;
     m_dialog_format->m_box_formatting->set_formatting_for_non_field(
       formatting, false /* don't show numeric options */);
   }
@@ -1047,7 +1047,7 @@ void Canvas_PrintLayout::set_canvas_item_field_value(const Glib::RefPtr<Goocanva
       sharedptr<const LayoutItem_WithFormatting>::cast_dynamic(field);
     if(with_formatting)
     {
-      const FieldFormatting& formatting = with_formatting->get_formatting_used();
+      const Formatting& formatting = with_formatting->get_formatting_used();
       text = Conversions::get_text_for_gda_value(field->get_glom_type(), 
         value, formatting.m_numeric_format);
     }
diff --git a/glom/print_layout/print_layout_utils.cc b/glom/print_layout/print_layout_utils.cc
index fa25096..f4c4fd7 100644
--- a/glom/print_layout/print_layout_utils.cc
+++ b/glom/print_layout/print_layout_utils.cc
@@ -274,7 +274,7 @@ static void create_standard(const sharedptr<const LayoutGroup>& layout_group, co
       double this_field_height = field_height;
       if(field)
       {
-        const FieldFormatting& formatting = field->get_formatting_used();
+        const Formatting& formatting = field->get_formatting_used();
         if(formatting.get_text_format_multiline())
         {
           const guint lines = formatting.get_text_format_multiline_height_lines();
diff --git a/glom/utility_widgets/layoutwidgetbase.cc b/glom/utility_widgets/layoutwidgetbase.cc
index b5a1ad5..ea346c3 100644
--- a/glom/utility_widgets/layoutwidgetbase.cc
+++ b/glom/utility_widgets/layoutwidgetbase.cc
@@ -107,9 +107,9 @@ void LayoutWidgetBase::apply_formatting(Gtk::Widget& widget, const sharedptr<con
     return;
 
   //Horizontal alignment:
-  const FieldFormatting::HorizontalAlignment alignment =
+  const Formatting::HorizontalAlignment alignment =
     layout_item->get_formatting_used_horizontal_alignment(true /* for details view */);
-  const float x_align = (alignment == FieldFormatting::HORIZONTAL_ALIGNMENT_LEFT ? 0.0 : 1.0);
+  const float x_align = (alignment == Formatting::HORIZONTAL_ALIGNMENT_LEFT ? 0.0 : 1.0);
   Gtk::Misc* misc = dynamic_cast<Gtk::Misc*>(widget_to_change);
   if(misc)
     misc->set_alignment(x_align);
@@ -121,12 +121,12 @@ void LayoutWidgetBase::apply_formatting(Gtk::Widget& widget, const sharedptr<con
     Gtk::Label* label = dynamic_cast<Gtk::Label*>(widget_to_change);
     if(label)
     {    
-      const Gtk::Justification justification = (alignment == FieldFormatting::HORIZONTAL_ALIGNMENT_LEFT ? Gtk::JUSTIFY_LEFT : Gtk::JUSTIFY_RIGHT);
+      const Gtk::Justification justification = (alignment == Formatting::HORIZONTAL_ALIGNMENT_LEFT ? Gtk::JUSTIFY_LEFT : Gtk::JUSTIFY_RIGHT);
       label->set_justify(justification);
     }
   }
 
-  const FieldFormatting& formatting = layout_item->get_formatting_used();
+  const Formatting& formatting = layout_item->get_formatting_used();
 
   //Use the text formatting:
   const Glib::ustring font_desc = formatting.get_text_format_font();
diff --git a/tests/test_document_load.cc b/tests/test_document_load.cc
index 3a97bb4..e941c17 100644
--- a/tests/test_document_load.cc
+++ b/tests/test_document_load.cc
@@ -245,13 +245,13 @@ int main()
   field = document.get_field("contacts", "name_title");  
   g_assert(field);
   g_assert(field->get_glom_type() == Glom::Field::TYPE_TEXT);
-  const Glom::FieldFormatting& formatting = field->m_default_formatting;
-  g_assert(formatting.get_horizontal_alignment() == Glom::FieldFormatting::HORIZONTAL_ALIGNMENT_AUTO);
+  const Glom::Formatting& formatting = field->m_default_formatting;
+  g_assert(formatting.get_horizontal_alignment() == Glom::Formatting::HORIZONTAL_ALIGNMENT_AUTO);
   
   g_assert(formatting.get_has_choices());
   g_assert(formatting.get_has_custom_choices());
   g_assert(!formatting.get_has_related_choices());
-  Glom::FieldFormatting::type_list_values choices = formatting.get_choices_custom();
+  Glom::Formatting::type_list_values choices = formatting.get_choices_custom();
   g_assert(!choices.empty());
   g_assert(contains_value(choices, "Mr"));
   g_assert(contains_value(choices, "Mrs"));
diff --git a/tests/test_document_load_translations.cc b/tests/test_document_load_translations.cc
index 52848c5..77e6bde 100644
--- a/tests/test_document_load_translations.cc
+++ b/tests/test_document_load_translations.cc
@@ -265,9 +265,9 @@ int main()
   g_assert(field);
   check_title(field, "Day/Night", "Tag/Nacht");
 
-  Glom::FieldFormatting formatting = field->m_default_formatting;
+  Glom::Formatting formatting = field->m_default_formatting;
   g_assert(formatting.get_has_custom_choices());
-  Glom::FieldFormatting::type_list_values values = formatting.get_choices_custom();
+  Glom::Formatting::type_list_values values = formatting.get_choices_custom();
   //g_assert(contains(values, "Day"));
   Glom::sharedptr<Glom::ChoiceValue> value = get_titled(values, "Day");
   g_assert(value);



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