summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 86c2173)
raw | patch | inline | side by side (parent: 86c2173)
author | cth103 <cth103@users.sourceforge.net> | |
Mon, 23 Jan 2006 14:19:27 +0000 (14:19 +0000) | ||
committer | cth103 <cth103@users.sourceforge.net> | |
Mon, 23 Jan 2006 14:19:27 +0000 (14:19 +0000) |
ChangeLog | patch | blob | history | |
src/xml/repr-io.cpp | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index d856ba05b5de8d2c836adda610c1f43a011435bf..18df22f3fd8673595a2979cf31b446dd3da65a84 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
* src/selection.cpp: fix a typo in one of my previous commits.
Closes #1401357.
+ * src/xml/repr-io.cpp: catch failures in fopen of XML files.
+ Closes #1374551.
+
2006-01-20 Michael Wybrow <mjwybrow@users.sourceforge.net>
* src/widgets/toolbox.cpp, src/widgets/desktop-widget.cpp,
diff --git a/src/xml/repr-io.cpp b/src/xml/repr-io.cpp
index 02aca4dc6786730a5ccf28169d733acc54097d11..bb62393fc541981002e120d4e03b1db8d14e89e4 100644 (file)
--- a/src/xml/repr-io.cpp
+++ b/src/xml/repr-io.cpp
# include <config.h>
#endif
-
+#include <stdexcept>
#include "xml/repr.h"
#include "xml/attribute-record.h"
Inkscape::IO::GzipInputStream* gzin;
};
-void XmlSource::setFile( char const * filename ) {
+void XmlSource::setFile(char const *filename)
+{
this->filename = filename;
fp = Inkscape::IO::fopen_utf8name(filename, "r");
+ if (fp == NULL) {
+ throw std::runtime_error("Could not open file for reading");
+ }
first = true;
}
Inkscape::IO::dump_fopen_call( filename, "N" );
XmlSource src;
- src.setFile(filename);
+ try
+ {
+ src.setFile(filename);
+ }
+ catch (...)
+ {
+ return NULL;
+ }
xmlDocPtr doubleDoc = xmlReadIO( XmlSource::readCb,
XmlSource::closeCb,