glom r1408 - in branches/glom-1-6: . glom/layout_item_dialogs glom/libglom/data_structure/layout/report_parts



Author: murrayc
Date: Sun Feb  3 02:54:55 2008
New Revision: 1408
URL: http://svn.gnome.org/viewvc/glom?rev=1408&view=rev

Log:
2008-02-03  Murray Cumming  <murrayc murrayc com>

* glom/layout_item_dialogs/box_formatting.cc: set_formatting(),
* glom/layout_item_dialogs/dialog_field_layout.cc: set_field():
Check for null RefPtrs to prevent crashes.

* glom/layout_item_dialogs/dialog_field_summary.cc: on_button_field():
Pass the correct parameter to avoid a use of an uninitialized value.
* glom/libglom/data_structure/layout/report_parts/layoutitem_fields_summary.cc:
Constructor: Initialize a member variable to avoid a use of an 
uninitialized value.
This fixed the crashes in bug #513927 (GÃran)

Modified:
   branches/glom-1-6/ChangeLog
   branches/glom-1-6/glom/layout_item_dialogs/box_formatting.cc
   branches/glom-1-6/glom/layout_item_dialogs/dialog_field_layout.cc
   branches/glom-1-6/glom/layout_item_dialogs/dialog_field_summary.cc
   branches/glom-1-6/glom/libglom/data_structure/layout/report_parts/layoutitem_fieldsummary.cc

Modified: branches/glom-1-6/glom/layout_item_dialogs/box_formatting.cc
==============================================================================
--- branches/glom-1-6/glom/layout_item_dialogs/box_formatting.cc	(original)
+++ branches/glom-1-6/glom/layout_item_dialogs/box_formatting.cc	Sun Feb  3 02:54:55 2008
@@ -108,6 +108,9 @@
   m_combo_choices_field->set_selected_field(choices_field);
   m_combo_choices_field_second->set_selected_field(choices_field_second);
 
+  if(!field)
+    return;
+
   //Custom choices:
   m_adddel_choices_custom->remove_all();
   FieldFormatting::type_list_values list_choice_values = format.get_choices_custom();

Modified: branches/glom-1-6/glom/layout_item_dialogs/dialog_field_layout.cc
==============================================================================
--- branches/glom-1-6/glom/layout_item_dialogs/dialog_field_layout.cc	(original)
+++ branches/glom-1-6/glom/layout_item_dialogs/dialog_field_layout.cc	Sun Feb  3 02:54:55 2008
@@ -76,6 +76,9 @@
 
 void Dialog_FieldLayout::set_field(const sharedptr<const LayoutItem_Field>& field, const Glib::ustring& table_name)
 {
+  if(!field)
+    return;
+
   m_layout_item = glom_sharedptr_clone(field);
   m_table_name = table_name;
 

Modified: branches/glom-1-6/glom/layout_item_dialogs/dialog_field_summary.cc
==============================================================================
--- branches/glom-1-6/glom/layout_item_dialogs/dialog_field_summary.cc	(original)
+++ branches/glom-1-6/glom/layout_item_dialogs/dialog_field_summary.cc	Sun Feb  3 02:54:55 2008
@@ -65,7 +65,7 @@
 
 void Dialog_FieldSummary::on_button_field()
 {
-  sharedptr<LayoutItem_Field> field = offer_field_list(field, m_table_name, this);
+  sharedptr<LayoutItem_Field> field = offer_field_list(m_layout_item, m_table_name, this);
   if(field)
   {
     m_layout_item->set_field(field);

Modified: branches/glom-1-6/glom/libglom/data_structure/layout/report_parts/layoutitem_fieldsummary.cc
==============================================================================
--- branches/glom-1-6/glom/libglom/data_structure/layout/report_parts/layoutitem_fieldsummary.cc	(original)
+++ branches/glom-1-6/glom/libglom/data_structure/layout/report_parts/layoutitem_fieldsummary.cc	Sun Feb  3 02:54:55 2008
@@ -25,6 +25,7 @@
 {
 
 LayoutItem_FieldSummary::LayoutItem_FieldSummary()
+: m_summary_type(TYPE_INVALID)
 {
 }
 



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