glom r1862 - in trunk: . glom



Author: jhs
Date: Tue Jan 27 11:14:27 2009
New Revision: 1862
URL: http://svn.gnome.org/viewvc/glom?rev=1862&view=rev

Log:
2009-01-27  Johannes Schmid  <jschmid openismus com>

	* glom/base_db.cc (set_field_value_in_database):
	Fix updating of fields with was broken due to a stupid mistake

Modified:
   trunk/ChangeLog
   trunk/glom/base_db.cc

Modified: trunk/glom/base_db.cc
==============================================================================
--- trunk/glom/base_db.cc	(original)
+++ trunk/glom/base_db.cc	Tue Jan 27 11:14:27 2009
@@ -2417,14 +2417,17 @@
   const Glib::ustring field_name = field_in_record.m_field->get_name();
   if(!field_name.empty()) //This should not happen.
   {
+    Field field = *field_in_record.m_field;
+    Field key = *field_in_record.m_key;
+    field.set_data(field_value);
+    key.set_data(field_in_record.m_key_value);
+    
     Glib::RefPtr<Gnome::Gda::Set> params = Gnome::Gda::Set::create();
-    params->add_holder(field_in_record.m_field->get_holder());
-    params->add_holder(field_in_record.m_key->get_holder());  
+    params->add_holder(field.get_holder());
+    params->add_holder(key.get_holder());  
     Glib::ustring strQuery = "UPDATE \"" + field_in_record.m_table_name + "\"";
-    strQuery += " SET \"" + field_in_record.m_field->get_name() + "\" = " + field_in_record.m_field->get_gda_holder_string();
-    strQuery += " WHERE \"" + field_in_record.m_key->get_name() + "\" = " + field_in_record.m_key->get_gda_holder_string();
-
-    //std::cout << "debug: set_field_value_in_database(): " << std::endl << "  " << strQuery << std::endl;
+    strQuery += " SET \"" + field.get_name() + "\" = " + field.get_gda_holder_string();
+    strQuery += " WHERE \"" + key.get_name() + "\" = " + key.get_gda_holder_string();
 
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
     try //TODO: The exceptions are probably already handled by query_execute(0.



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