struct svgtiny_parse_state state, bool polygon);
static svgtiny_code svgtiny_parse_text(dom_element *text,
struct svgtiny_parse_state state);
-static void svgtiny_parse_position_attributes(const dom_element *node,
+static void svgtiny_parse_position_attributes(dom_element *node,
const struct svgtiny_parse_state state,
float *x, float *y, float *width, float *height);
-static void svgtiny_parse_paint_attributes(const dom_element *node,
+static void svgtiny_parse_paint_attributes(dom_element *node,
struct svgtiny_parse_state *state);
-static void svgtiny_parse_font_attributes(const dom_element *node,
+static void svgtiny_parse_font_attributes(dom_element *node,
struct svgtiny_parse_state *state);
static void svgtiny_parse_transform_attributes(dom_element *node,
struct svgtiny_parse_state *state);
dom_node_unref(child);
return svgtiny_LIBDOM_ERROR;
}
- shape->text = strndup(dom_string_data(content),
- dom_string_byte_length(content));
- dom_string_unref(content);
+ if (content != NULL) {
+ shape->text = strndup(dom_string_data(content),
+ dom_string_byte_length(content));
+ dom_string_unref(content);
+ } else {
+ shape->text = strdup("");
+ }
shape->text_x = px;
shape->text_y = py;
state.diagram->shape_count++;
* Parse x, y, width, and height attributes, if present.
*/
-void svgtiny_parse_position_attributes(const dom_element *node,
+void svgtiny_parse_position_attributes(dom_element *node,
const struct svgtiny_parse_state state,
float *x, float *y, float *width, float *height)
{
* Parse paint attributes, if present.
*/
-void svgtiny_parse_paint_attributes(const dom_element *node,
+void svgtiny_parse_paint_attributes(dom_element *node,
struct svgtiny_parse_state *state)
{
dom_string *attr;
* Parse font attributes, if present.
*/
-void svgtiny_parse_font_attributes(const dom_element *node,
+void svgtiny_parse_font_attributes(dom_element *node,
struct svgtiny_parse_state *state)
{
/* TODO: Implement this, it never used to be */