glom r1749 - in trunk: . glom



Author: murrayc
Date: Mon Nov 24 16:17:09 2008
New Revision: 1749
URL: http://svn.gnome.org/viewvc/glom?rev=1749&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:
   trunk/ChangeLog
   trunk/glom/frame_glom.cc

Modified: trunk/glom/frame_glom.cc
==============================================================================
--- trunk/glom/frame_glom.cc	(original)
+++ trunk/glom/frame_glom.cc	Mon Nov 24 16:17:09 2008
@@ -1172,7 +1172,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]