diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2012-03-13 15:41:41 +0000 |
|---|---|---|
| committer | tavmjong-free <tavmjong@free.fr> | 2012-03-13 15:41:41 +0000 |
| commit | a56640c647ad2fc3a53b9ae8b4f02149257b1f54 (patch) | |
| tree | 6fd3ae8b27699a4f85a01ce94484e1dc021dc713 /src/attribute-rel-svg.cpp | |
| parent | Fix for 903671 : GtkOptionMenu needs replacing with GtkComboBox. Gradient too... (diff) | |
| download | inkscape-a56640c647ad2fc3a53b9ae8b4f02149257b1f54.tar.gz inkscape-a56640c647ad2fc3a53b9ae8b4f02149257b1f54.zip | |
Protect against missing attributes and property files.
(bzr r11078)
Diffstat (limited to 'src/attribute-rel-svg.cpp')
| -rw-r--r-- | src/attribute-rel-svg.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/attribute-rel-svg.cpp b/src/attribute-rel-svg.cpp index 3f5ce9395..80d924f80 100644 --- a/src/attribute-rel-svg.cpp +++ b/src/attribute-rel-svg.cpp @@ -26,6 +26,7 @@ #include "preferences.h" SPAttributeRelSVG * SPAttributeRelSVG::instance = NULL; +bool SPAttributeRelSVG::foundFile = false; /* * This functions checks whether an element -> attribute pair is allowed or not @@ -36,6 +37,9 @@ bool SPAttributeRelSVG::findIfValid(Glib::ustring attribute, Glib::ustring eleme SPAttributeRelSVG::instance = new SPAttributeRelSVG(); } + // Always valid if data file not found! + if( !foundFile ) return true; + // Strip of "svg:" from the element's name Glib::ustring temp = element; if ( temp.find("svg:") != std::string::npos ) { @@ -75,16 +79,14 @@ SPAttributeRelSVG::SPAttributeRelSVG() f.open(filepath.c_str(), std::ios::in); if (!f.is_open()) { - // Set the default preference of attribute checking to ignore - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - prefs->setInt("/options/svgoutput/incorrect_attributes", 3); - // Display warning for file not open g_warning("Could not open the data file for XML attribute-element map construction: %s", filepath.c_str()); f.close(); return ; } + foundFile = true; + while (!f.eof()){ std::stringstream ss; std::string s; |
