summaryrefslogtreecommitdiffstats
path: root/src/extension/internal/cairo-render-context.cpp
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2019-07-04 09:44:01 +0000
committerMarc Jeanmougin <marc@jeanmougin.fr>2019-07-04 09:44:01 +0000
commit0df291b7bdfe888cb07e35a75eab2c5eb183fef1 (patch)
treeac677c227c943adc6cdb1459c8f34f5799da0751 /src/extension/internal/cairo-render-context.cpp
parentExport links to pdf. Fixes https://gitlab.com/inkscape/inbox/issues/583 (diff)
downloadinkscape-0df291b7bdfe888cb07e35a75eab2c5eb183fef1.tar.gz
inkscape-0df291b7bdfe888cb07e35a75eab2c5eb183fef1.zip
Fix link export code
Diffstat (limited to 'src/extension/internal/cairo-render-context.cpp')
-rw-r--r--src/extension/internal/cairo-render-context.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp
index 99f667813..c801821c8 100644
--- a/src/extension/internal/cairo-render-context.cpp
+++ b/src/extension/internal/cairo-render-context.cpp
@@ -753,15 +753,17 @@ CairoRenderContext::popLayer()
}
}
void CairoRenderContext::tagBegin(const char* l){
- char link[1000] = "uri='";
- if(strlen(l)<990)
- strcat(link, l);
- strcat(link, "'");
+#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 15, 4)
+ char* link = g_strdup_printf("uri='%s'", l);
cairo_tag_begin(_cr, CAIRO_TAG_LINK, link);
+ g_free(link);
+#endif
}
void CairoRenderContext::tagEnd(){
+#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 15, 4)
cairo_tag_end(_cr, CAIRO_TAG_LINK);
+#endif
}