summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 899bf4e)
raw | patch | inline | side by side (parent: 899bf4e)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 20 Jun 2008 16:38:39 +0000 (16:38 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Fri, 20 Jun 2008 16:38:39 +0000 (16:38 +0000) |
src/ui/dialog/filedialogimpl-win32.cpp | patch | blob | history |
index d26762bd3c27547249f7332a067367cecfecdd2f..f9eab673a33f92c1fcea9391aa9ed504a6b1ae74 100644 (file)
{
const Glib::ustring path = utf16_to_ustring(_path_string, _MAX_PATH);
+ bool successful = false;
+
_mutex->lock();
- _preview_bitmap_image = Gdk::Pixbuf::create_from_file(path);
- if(!_preview_bitmap_image) return false;
- _preview_image_width = _preview_bitmap_image->get_width();
- _preview_document_width = _preview_image_width;
- _preview_image_height = _preview_bitmap_image->get_height();
- _preview_document_height = _preview_image_height;
+ try {
+ _preview_bitmap_image = Gdk::Pixbuf::create_from_file(path);
+ if (_preview_bitmap_image) {
+ _preview_image_width = _preview_bitmap_image->get_width();
+ _preview_document_width = _preview_image_width;
+ _preview_image_height = _preview_bitmap_image->get_height();
+ _preview_document_height = _preview_image_height;
+ successful = true;
+ }
+ }
+ catch (const Gdk::PixbufError&) {}
+ catch (const Glib::FileError&) {}
_mutex->unlock();
- return true;
+ return successful;
}
void FileOpenDialogImplWin32::render_preview()