summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/filedialogimpl-win32.cpp
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2008-06-20 16:38:39 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2008-06-20 16:38:39 +0000
commit8303a02596c8511b37c54840ac9401e9f8134045 (patch)
treeb6a1ece147e97db5fbe5cee6e41b032949f03989 /src/ui/dialog/filedialogimpl-win32.cpp
parentPartial fix (for preventing numerical issues) and restructuring for PathStrin... (diff)
downloadinkscape-8303a02596c8511b37c54840ac9401e9f8134045.tar.gz
inkscape-8303a02596c8511b37c54840ac9401e9f8134045.zip
patch from 226459, approved by joel
(bzr r6006)
Diffstat (limited to 'src/ui/dialog/filedialogimpl-win32.cpp')
-rw-r--r--src/ui/dialog/filedialogimpl-win32.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/ui/dialog/filedialogimpl-win32.cpp b/src/ui/dialog/filedialogimpl-win32.cpp
index d26762bd3..f9eab673a 100644
--- a/src/ui/dialog/filedialogimpl-win32.cpp
+++ b/src/ui/dialog/filedialogimpl-win32.cpp
@@ -938,18 +938,26 @@ bool FileOpenDialogImplWin32::set_image_preview()
{
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()