From 02edd2123f6ea2d8df1a469ebf426db6ce4d28c0 Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Tue, 3 Apr 2012 12:04:22 +0100 Subject: eek-preview: Cairo drawing (bzr r11142) --- src/document.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/document.cpp') diff --git a/src/document.cpp b/src/document.cpp index b5383c91d..18d714bad 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -37,11 +37,11 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif -#include #include #include #include <2geom/transforms.h> +#include "widgets/desktop-widget.h" #include "desktop.h" #include "dir-util.h" #include "display/drawing-item.h" @@ -60,7 +60,6 @@ #include "sp-object-repr.h" #include "transf_mat_3x4.h" #include "unit-constants.h" -#include "widgets/desktop-widget.h" #include "xml/repr.h" #include "xml/rebase-hrefs.h" #include "libcroco/cr-cascade.h" -- cgit v1.2.3 From 9ff6ffd913086ac953e79231c2a3345f997589fe Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Thu, 5 Apr 2012 07:06:43 +0200 Subject: Clipboard code cleaning (patch for bug #964852 by Romain, see devmail thread "Some clipboard functions") (bzr r11153) --- src/document.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/document.cpp') diff --git a/src/document.cpp b/src/document.cpp index 18d714bad..7b68dd499 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -48,6 +48,7 @@ #include "document-private.h" #include "document-undo.h" #include "helper/units.h" +#include "id-clash.h" #include "inkscape-private.h" #include "inkscape-version.h" #include "libavoid/router.h" @@ -1432,6 +1433,27 @@ void SPDocument::setModifiedSinceSave(bool modified) { dtw->updateTitle( this->getName() ); } + +/** + * Paste SVG defs from the document retrieved from the clipboard into the active document. + * @param clipdoc The document to paste. + * @pre @c clipdoc != NULL and pasting into the active document is possible. + */ +void SPDocument::importDefs(SPDocument *source) +{ + Inkscape::XML::Node *root = source->getReprRoot(); + Inkscape::XML::Node *defs = sp_repr_lookup_name(root, "svg:defs", 1); + Inkscape::XML::Node *target_defs = this->getDefs()->getRepr(); + + prevent_id_clashes(source, this); + + for (Inkscape::XML::Node *def = defs->firstChild() ; def ; def = def->next()) { + Inkscape::XML::Node * dup = def->duplicate(this->getReprDoc()); + target_defs->appendChild(dup); + Inkscape::GC::release(dup); + } +} + /* Local Variables: mode:c++ -- cgit v1.2.3 From 352a8b65716e482c44920cc94d5f48ca5bc49068 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Mon, 9 Apr 2012 21:19:30 +0200 Subject: cppcheck stuff (bzr r11201) --- src/document.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/document.cpp') diff --git a/src/document.cpp b/src/document.cpp index 7b68dd499..cc139aae0 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -1429,7 +1429,7 @@ void SPDocument::setModifiedSinceSave(bool modified) { this->modified_since_save = modified; Gtk::Window *parent = SP_ACTIVE_DESKTOP->getToplevel(); g_assert(parent != NULL); - SPDesktopWidget *dtw = (SPDesktopWidget *) parent->get_data("desktopwidget"); + SPDesktopWidget *dtw = static_cast(parent->get_data("desktopwidget")); dtw->updateTitle( this->getName() ); } -- cgit v1.2.3