From 719b90d62fe152b9ff7f08133d0bb7016c4194f2 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Thu, 29 Aug 2019 22:34:06 +0200 Subject: add improvements to selectors and merge stylesheet on copy to work between docs --- src/ui/clipboard.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/ui/clipboard.cpp') diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp index 4362c2b94..b9e7dc2b5 100644 --- a/src/ui/clipboard.cpp +++ b/src/ui/clipboard.cpp @@ -24,6 +24,7 @@ #include // for g_file_set_contents etc., used in _onGet and paste #include "inkgc/gc-core.h" #include "xml/repr.h" +#include "xml/sp-css-attr.h" #include "inkscape.h" #include "desktop.h" @@ -753,6 +754,12 @@ void ClipboardManagerImpl::_copySelection(ObjectSet *selection) // copy complete inherited style SPCSSAttr *css = sp_repr_css_attr_inherited(obj, "style"); + for (auto iter : item->style->properties()) { + if (iter->style_src == SP_STYLE_SRC_STYLE_SHEET) { + Glib::ustring val = iter->get_value(); + css->setAttribute(iter->name, val.c_str()); + } + } sp_repr_css_set(obj_copy, css, "style"); sp_repr_css_attr_unref(css); @@ -923,7 +930,6 @@ void ClipboardManagerImpl::_copyUsedDefs(SPItem *item) } } - /** * Copy a single gradient to the clipboard's defs element. */ -- cgit v1.2.3