From eb0e63b411b5f0713e73e95b9865294bd83fb646 Mon Sep 17 00:00:00 2001 From: Maximilian Albert Date: Thu, 16 Aug 2007 14:50:40 +0000 Subject: Remember last used style for single 3D box faces (also fixes bug with wrongly assigned faces for duplicated boxes, e.g.) (bzr r3481) --- src/desktop-style.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/desktop-style.cpp') diff --git a/src/desktop-style.cpp b/src/desktop-style.cpp index a6a4d8567..56fc9d4be 100644 --- a/src/desktop-style.cpp +++ b/src/desktop-style.cpp @@ -37,6 +37,7 @@ #include "sp-tspan.h" #include "xml/repr.h" #include "libnrtype/font-style-to-pos.h" +#include "sp-path.h" #include "desktop-style.h" @@ -161,6 +162,17 @@ sp_desktop_set_style(SPDesktop *desktop, SPCSSAttr *css, bool change, bool write sp_repr_css_merge(css_write, css); sp_css_attr_unset_uris(css_write); sp_repr_css_change(inkscape_get_repr(INKSCAPE, "desktop"), css_write, "style"); + for (const GSList *i = desktop->selection->itemList(); i != NULL; i = i->next) { + /* last used styles for 3D box faces are stored separately */ + if (SP_IS_PATH (i->data)) { + const char * descr = SP_OBJECT_REPR (G_OBJECT (i->data))->attribute ("inkscape:box3dface"); + if (descr != NULL) { + gchar *style_grp = g_strconcat ("desktop.", descr, NULL); + sp_repr_css_change(inkscape_get_repr(INKSCAPE, style_grp), css_write, "style"); + g_free (style_grp); + } + } + } sp_repr_css_attr_unref(css_write); } -- cgit v1.2.3