Commit a56c4b1d authored by Murray Cumming's avatar Murray Cumming Committed by Murray Cumming
Browse files

scale(): Call Gtk::Image::get_storage_type() before

2006-02-19  Murray Cumming, <murrayc@murrayc.com>

        * glom/utility_widgets/imageglom.cc: scale(): Call Gtk::Image::get_storage_type()
        before Gtk::Image::get_pixbuf(), to avoid a critical warning.
parent 7007f055
2006-02-19 Murray Cumming, <murrayc@murrayc.com>
* glom/utility_widgets/imageglom.cc: scale(): Call Gtk::Image::get_storage_type()
before Gtk::Image::get_pixbuf(), to avoid a critical warning.
2006-02-19 Murray Cumming <murrayc@murrayc.com>
* glom/utility_widgets/imageglom.cc:
* glom/utility_widgets/imageglom.h: Overried on_expose_event() so we can
* glom/utility_widgets/imageglom.h: Override on_expose_event() so we can
scale the image when we actually have a real (>1) allocation.
scale(): Do not call set_image() if the scaled pixbuf has exactly the same
dimensions as the existing image. And do not try to scale the image if the
......
......@@ -178,6 +178,7 @@ void ImageGlom::set_value(const Gnome::Gda::Value& value)
// g_warning("%02X (%c), ", (guint8)puiData[i], (char)puiData[i]);
refPixbufLoader->write(puiData, (glong)buffer_binary_length);
m_pixbuf_original = refPixbufLoader->get_pixbuf();
m_image.set(m_pixbuf_original);
pixbuf_set = true;
......@@ -277,7 +278,11 @@ void ImageGlom::scale()
else
{
//Don't set a new pixbuf if the dimenstions have not changed:
Glib::RefPtr<const Gdk::Pixbuf> pixbuf_in_image = m_image.get_pixbuf();
Glib::RefPtr<const Gdk::Pixbuf> pixbuf_in_image;
if(m_image.get_storage_type() == Gtk::IMAGE_PIXBUF) //Prevent warning.
pixbuf_in_image = m_image.get_pixbuf();
if( !pixbuf_in_image || (pixbuf_in_image->get_height() != pixbuf_scaled->get_height()) || (pixbuf_in_image->get_width() != pixbuf_scaled->get_width()) )
m_image.set(pixbuf_scaled);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment