From 7d1184c85c47f1272da5b2ed7816efa685a73e83 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Sat, 1 Oct 2016 17:30:34 -0400 Subject: Add a prune method to saving svg files that removes Adobe's i:pgf tag. Fixed bugs: - https://launchpad.net/bugs/179679 (bzr r15141) --- src/extension/internal/svg.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src') diff --git a/src/extension/internal/svg.cpp b/src/extension/internal/svg.cpp index a94bc2141..9cde90519 100644 --- a/src/extension/internal/svg.cpp +++ b/src/extension/internal/svg.cpp @@ -78,6 +78,28 @@ static void pruneExtendedNamespaces( Inkscape::XML::Node *repr ) } } +/* + * Similar to the above sodipodi and inkscape prune, but used on all documents + * to remove problematic elements (for example Adobe's i:pgf tag) only removes + * known garbage tags. + */ +static void pruneProprietaryGarbage( Inkscape::XML::Node *repr ) +{ + if (repr) { + std::vector nodesRemoved; + for ( Node *child = repr->firstChild(); child; child = child->next() ) { + if((strncmp("i:pgf", child->name(), 5) == 0)) { + nodesRemoved.push_back(child); + g_warning( "An Adobe proprietary tag was found which is known to cause issues. It was removed before saving."); + } else { + pruneProprietaryGarbage(child); + } + } + for ( std::vector::iterator it = nodesRemoved.begin(); it != nodesRemoved.end(); ++it ) { + repr->removeChild(*it); + } + } +} /** \return None @@ -246,6 +268,10 @@ Svg::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *filena || !strcmp (mod->get_id(), SP_MODULE_KEY_OUTPUT_SVG_INKSCAPE) || !strcmp (mod->get_id(), SP_MODULE_KEY_OUTPUT_SVGZ_INKSCAPE)); + // We prune the in-use document and deliberately loose data, because there + // is no known use for this data at the present time. + pruneProprietaryGarbage(rdoc->root()); + if (!exportExtensions) { // We make a duplicate document so we don't prune the in-use document // and loose data. Perhaps the user intends to save as inkscape-svg next. -- cgit v1.2.3 From b6ec8d66b6ba6889217dfb0cbff4fd3c9901acd2 Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Sat, 1 Oct 2016 23:14:55 -0400 Subject: Adjust dock size to minimum width during canvas table size allocation signal. (bzr r15142) --- src/widgets/desktop-widget.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index bd72560c6..55dc82dc0 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -307,12 +307,19 @@ sp_desktop_widget_class_init (SPDesktopWidgetClass *klass) * This adjusts the range of the rulers when the dock container is adjusted * (fixes lp:950552) */ -static void canvas_tbl_size_allocate(GtkWidget * /*widget*/, +static void canvas_tbl_size_allocate(GtkWidget * widget, GdkRectangle * /*allocation*/, gpointer data) { SPDesktopWidget *dtw = SP_DESKTOP_WIDGET(data); sp_desktop_widget_update_rulers(dtw); + + GtkWidget* parent = gtk_widget_get_parent(widget); + if(GTK_IS_PANED(parent)) { + GtkPaned *paned = GTK_PANED(parent); + // Could use gtk paned property 'max-position' here + gtk_paned_set_position(paned, 10000); + } } /** @@ -527,8 +534,8 @@ void SPDesktopWidget::init( SPDesktopWidget *dtw ) paned_class->cycle_handle_focus = NULL; } - gtk_widget_set_hexpand(GTK_WIDGET(paned->gobj()), TRUE); - gtk_widget_set_vexpand(GTK_WIDGET(paned->gobj()), TRUE); + paned->set_hexpand(true); + paned->set_vexpand(true); gtk_grid_attach(GTK_GRID(tbl_wrapper), GTK_WIDGET (paned->gobj()), 1, 1, 1, 1); } else { gtk_widget_set_hexpand(GTK_WIDGET(dtw->canvas_tbl), TRUE); -- cgit v1.2.3