diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2014-03-24 21:26:34 +0000 |
|---|---|---|
| committer | Johan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl> | 2014-03-24 21:26:34 +0000 |
| commit | 53d32bfc98a277a724732a0bc9df27f0992db125 (patch) | |
| tree | 887703615bbf97e1ae65a5e182574a7dc681fe0e /src/xml/node.h | |
| parent | Patch for base constructor calls. (diff) | |
| download | inkscape-53d32bfc98a277a724732a0bc9df27f0992db125.tar.gz inkscape-53d32bfc98a277a724732a0bc9df27f0992db125.zip | |
add convenience functions to deal with Glib::ustrings for setting repr attributes
(bzr r13203)
Diffstat (limited to 'src/xml/node.h')
| -rw-r--r-- | src/xml/node.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/xml/node.h b/src/xml/node.h index e83d8a7b7..a41e4e350 100644 --- a/src/xml/node.h +++ b/src/xml/node.h @@ -19,6 +19,7 @@ #define SEEN_INKSCAPE_XML_NODE_H #include <glibmm/value.h> +#include <glibmm/ustring.h> #include "gc-anchored.h" #include "util/list.h" @@ -194,6 +195,7 @@ public: */ virtual void setContent(gchar const *value)=0; + //@{ /** * @brief Change an attribute of this node * @@ -204,7 +206,19 @@ public: * @param is_interactive Ignored */ virtual void setAttribute(gchar const *key, gchar const *value, bool is_interactive=false)=0; - + + void setAttribute(gchar const *key, Glib::ustring const &value, bool is_interactive=false) + { + setAttribute(key, value.empty() ? NULL : value.c_str(), is_interactive); + } + + void setAttribute(Glib::ustring const &key, Glib::ustring const &value, bool is_interactive=false) + { + setAttribute( key.empty() ? NULL : key.c_str(), + value.empty() ? NULL : value.c_str(), is_interactive); + } + //@} + /** * @brief Directly set the integer GQuark code for the name of the node * |
