glom r1750 - in branches/glom-1-8: . glom



Author: murrayc
Date: Mon Nov 24 16:18:04 2008
New Revision: 1750
URL: http://svn.gnome.org/viewvc/glom?rev=1750&view=rev

Log:
2008-11-24  Murray Cumming  <murrayc murrayc com>

* glom/frame_glom.cc: update_table_in_document_from_database:
Ignore the default_value property from libgda/database, because we only 
use it from the document, because libgda returns weird values.
This prevents the loss of the default value information when reloading 
a document.
Ubuntu bug https://bugs.launchpad.net/ubuntu/+source/glom/+bug/299896
(elmergato)

Modified:
   branches/glom-1-8/ChangeLog
   branches/glom-1-8/glom/frame_glom.cc

Modified: branches/glom-1-8/glom/frame_glom.cc
==============================================================================
--- branches/glom-1-8/glom/frame_glom.cc	(original)
+++ branches/glom-1-8/glom/frame_glom.cc	Mon Nov 24 16:18:04 2008
@@ -1166,7 +1166,15 @@
               //The database has different information. We assume that the information in the database is newer.
 
               //Update the field information:
-              field_info_db->set_auto_increment( field_document->get_auto_increment() ); //libgda does not report it from the database properly.
+
+              // Ignore things that libgda does not report from the database properly:
+              // We do this also in Field::field_info_from_database_is_equal() and 
+              // Base_DB::get_fields_for_table(), 
+              // so make sure that we ignore the same things everywhere always
+              // TODO: Avoid that duplication?
+              field_info_db->set_auto_increment( field_document->get_auto_increment() );
+              field_info_db->set_default_value( field_document->get_default_value() );
+
               (*iterFindDoc)->set_field_info( field_info_db );
 
               document_must_be_updated = true;



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