[glom] ImageGlom: Remove some unnecessary code.



commit a2032052b05367d7bd1455ddd0ae86c4aa998e29
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Jul 14 11:29:19 2011 +0200

    ImageGlom: Remove some unnecessary code.
    
    * glom/utility_widgets/imageglom.cc: get_value(): Don't use the pixbuf just
    to get the value.

 ChangeLog                         |    7 ++++++
 glom/utility_widgets/imageglom.cc |   41 +------------------------------------
 2 files changed, 8 insertions(+), 40 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f8c3312..da7e794 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2011-07-14  Murray Cumming  <murrayc murrayc com>
 
+	ImageGlom: Remove some unnecessary code.
+
+	* glom/utility_widgets/imageglom.cc: get_value(): Don't use the pixbuf just 
+	to get the value.
+
+2011-07-14  Murray Cumming  <murrayc murrayc com>
+
 	ImageGlom: Another scaling fix.
 
 	* glom/utility_widgets/imageglom.cc: get_scaled_image(): Don't return 
diff --git a/glom/utility_widgets/imageglom.cc b/glom/utility_widgets/imageglom.cc
index d93eed0..8347f02 100644
--- a/glom/utility_widgets/imageglom.cc
+++ b/glom/utility_widgets/imageglom.cc
@@ -180,46 +180,7 @@ void ImageGlom::set_value(const Gnome::Gda::Value& value)
 
 Gnome::Gda::Value ImageGlom::get_value() const
 {
-  //TODO: Return the data from the file that was just chosen.
-  //Don't store the original here any longer than necessary,
-  if(m_original_data.get_value_type() != G_TYPE_NONE)
-    return m_original_data;
-  
-  if(m_pixbuf_original)
-  {
-    try
-    {
-      gchar* buffer = 0;
-      gsize buffer_size = 0;
-      std::vector<Glib::ustring> list_keys;
-      std::vector<Glib::ustring> list_values;
-      //list_keys.push_back("quality"); //For jpeg only.
-      //list_values.push_back("95");
-
-      m_pixbuf_original->save_to_buffer(buffer, buffer_size, GLOM_IMAGE_FORMAT, list_keys, list_values); //Always store images as the standard format in the database.
-
-      //g_warning("ImageGlom::get_value(): debug: to db: ");
-      //for(int i = 0; i < 10; ++i)
-      //  g_warning("%02X (%c), ", (guint8)buffer[i], buffer[i]);
-
-      GdaBinary* bin = g_new(GdaBinary, 1);
-      bin->data = reinterpret_cast<guchar*>(buffer);
-      bin->binary_length = buffer_size;
-
-      m_original_data = Gnome::Gda::Value();
-      m_original_data.Glib::ValueBase::init(GDA_TYPE_BINARY);
-      gda_value_take_binary(m_original_data.gobj(), bin);
-
-      buffer = 0;
-      return m_original_data;
-    }
-    catch(const Glib::Exception& ex)
-    {
-      std::cerr << G_STRFUNC << ": " << ex.what() << std::endl;
-    }
-  }
-
-  return Gnome::Gda::Value();
+  return m_original_data;
 }
 
 void ImageGlom::on_size_allocate(Gtk::Allocation& allocation)



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