glom r1410 - in branches/glom-1-6: . glom/mode_data



Author: murrayc
Date: Mon Feb  4 16:36:19 2008
New Revision: 1410
URL: http://svn.gnome.org/viewvc/glom?rev=1410&view=rev

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

* glom/mode_data/dialog_layout_details.cc: save_to_document(): 
Set the sequence number later, to avoid it always being 1, which 
causes layout groups with those duplicate sequence numbers to be ignored 
and lost when reloading the document. This stopped people from adding 
new groups.
This fixes bug #513774  (GÃran)

Note that svn trunk does not need this fix because we no longer use 
this explicit sequence number, because it was likely to lead to this 
kind of problem.

Modified:
   branches/glom-1-6/ChangeLog
   branches/glom-1-6/glom/mode_data/dialog_layout_details.cc

Modified: branches/glom-1-6/glom/mode_data/dialog_layout_details.cc
==============================================================================
--- branches/glom-1-6/glom/mode_data/dialog_layout_details.cc	(original)
+++ branches/glom-1-6/glom/mode_data/dialog_layout_details.cc	Mon Feb  4 16:36:19 2008
@@ -335,6 +335,8 @@
     for(Document_Glom::type_mapLayoutGroupSequence::const_iterator iter = mapGroups.begin(); iter != mapGroups.end(); ++iter)
     {
       sharedptr<const LayoutGroup> group = iter->second;
+      //std::cout << "debug: Dialog_Layout_Details::set_document(): adding group name=" << group->get_name() << std::endl;
+        
       sharedptr<const LayoutGroup> portal = sharedptr<const LayoutItem_Portal>::cast_dynamic(group);
       if(group && !portal)
         add_group(Gtk::TreeModel::iterator() /* null == top-level */, group);
@@ -1050,10 +1052,12 @@
       if(layout_group && !layout_portal) //There may be top-level groups, but no top-level fields, because the fields must be in a group (so that they are in columns)
       {
         sharedptr<LayoutGroup> group = sharedptr<LayoutGroup>::create();
-        group->m_sequence = group_sequence;
         fill_group(iterFields, group);
 
+        group->m_sequence = group_sequence;
         mapGroups[group_sequence] = group;
+        //std::cout << "debug: Dialog_Layout_Details::save_to_document(): adding group sequence=" << group_sequence << ", group->m_sequence=" << group->m_sequence << ". group name=" << group->get_name() << std::endl;
+        
         ++group_sequence;
       }
     }



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