summaryrefslogtreecommitdiffstats
path: root/src/attribute-rel-svg.cpp
diff options
context:
space:
mode:
authorMichael Soegtrop <MSoegtrop@yahoo.de>2017-06-05 13:01:17 +0000
committerMichael Soegtrop <MSoegtrop@yahoo.de>2017-06-05 13:01:17 +0000
commite7248b2fa042f42a5c4dd14cd86ab6a5b4524059 (patch)
tree9097520c54e355ded9bd0b4d6618af4e8dacdd91 /src/attribute-rel-svg.cpp
parentupdated to latest trunk (diff)
parent[Bug #1695016] Xaml export misses some radialGradients. (diff)
downloadinkscape-e7248b2fa042f42a5c4dd14cd86ab6a5b4524059.tar.gz
inkscape-e7248b2fa042f42a5c4dd14cd86ab6a5b4524059.zip
updated to latest trunk
(bzr r14876.2.4)
Diffstat (limited to 'src/attribute-rel-svg.cpp')
-rw-r--r--src/attribute-rel-svg.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/attribute-rel-svg.cpp b/src/attribute-rel-svg.cpp
index 0064f4c62..1f4bee1b3 100644
--- a/src/attribute-rel-svg.cpp
+++ b/src/attribute-rel-svg.cpp
@@ -18,7 +18,6 @@
#include <fstream>
#include <sstream>
-#include <string>
#include "attribute-rel-svg.h"
@@ -29,6 +28,27 @@ SPAttributeRelSVG * SPAttributeRelSVG::instance = NULL;
bool SPAttributeRelSVG::foundFile = false;
/*
+ * This function returns true if element is an SVG element.
+ */
+bool SPAttributeRelSVG::isSVGElement(Glib::ustring element)
+{
+ if (SPAttributeRelSVG::instance == NULL) {
+ SPAttributeRelSVG::instance = new SPAttributeRelSVG();
+ }
+
+ // Always valid if data file not found!
+ if( !foundFile ) return true;
+
+ // Strip off "svg:" from the element's name
+ Glib::ustring temp = element;
+ if ( temp.find("svg:") != std::string::npos ) {
+ temp.erase( temp.find("svg:"), 4 );
+ }
+
+ return (SPAttributeRelSVG::instance->attributesOfElements.count(temp) > 0);
+}
+
+/*
* This functions checks whether an element -> attribute pair is allowed or not
*/
bool SPAttributeRelSVG::findIfValid(Glib::ustring attribute, Glib::ustring element)
@@ -40,7 +60,7 @@ bool SPAttributeRelSVG::findIfValid(Glib::ustring attribute, Glib::ustring eleme
// Always valid if data file not found!
if( !foundFile ) return true;
- // Strip of "svg:" from the element's name
+ // Strip off "svg:" from the element's name
Glib::ustring temp = element;
if ( temp.find("svg:") != std::string::npos ) {
temp.erase( temp.find("svg:"), 4 );