[SCM] inkscape/master: Backport more patches from upstream 0.92.x branch

mattia at users.alioth.debian.org mattia at users.alioth.debian.org
Sun Jan 22 19:14:13 UTC 2017


The following commit has been merged in the master branch:
commit ffec67a9cd41ea3f03eaca73b17e5518ae2ed14b
Author: Mattia Rizzolo <mattia at debian.org>
Date:   Sun Jan 22 19:40:52 2017 +0100

    Backport more patches from upstream 0.92.x branch
    
    + 15320: Fix regression on selecting objects after locking layers
    + 15323: Fix crash on ungrouping in v0.92
    + 15324: Fix nsane memory leak and crash with pattern along path
    + 15325: Fixes bugs in copy LPE's

diff --git a/debian/patches/series b/debian/patches/series
index e6bd20c..3327adb 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,7 @@
 0004-typos-libcroco.patch
 upstream/0.92.x/15311.patch
 upstream/0.92.x/15309.patch
+upstream/0.92.x/15320.patch
+upstream/0.92.x/15323.patch
+upstream/0.92.x/15324.patch
+upstream/0.92.x/15325.patch
diff --git a/debian/patches/upstream/0.92.x/15320.patch b/debian/patches/upstream/0.92.x/15320.patch
new file mode 100644
index 0000000..cfd497e
--- /dev/null
+++ b/debian/patches/upstream/0.92.x/15320.patch
@@ -0,0 +1,22 @@
+From: Marc Jeanmougin <none>
+Date: Sun, 22 Jan 2017 18:52:01 +0100
+Subject: Fix regression on selecting objects after locking layers
+
+Origin: upstream, http://bazaar.launchpad.net/~inkscape.dev/inkscape/0.92.x/revision/15320
+Bug: https://launchpad.net/bugs/1656141
+---
+ src/sp-item.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/sp-item.cpp b/src/sp-item.cpp
+index a7453f4..3f2689e 100644
+--- a/src/sp-item.cpp
++++ b/src/sp-item.cpp
+@@ -132,6 +132,7 @@ void SPItem::setLocked(bool locked) {
+     setAttribute("sodipodi:insensitive",
+                  ( locked ? "1" : NULL ));
+     updateRepr();
++    document->_emitModified();
+ }
+ 
+ bool SPItem::isHidden() const {
diff --git a/debian/patches/upstream/0.92.x/15323.patch b/debian/patches/upstream/0.92.x/15323.patch
new file mode 100644
index 0000000..84608c1
--- /dev/null
+++ b/debian/patches/upstream/0.92.x/15323.patch
@@ -0,0 +1,38 @@
+From: Jabiertxof <none>
+Date: Sun, 22 Jan 2017 18:52:01 +0100
+Subject: Fix crash on ungrouping in v0.92.
+
+ A unnecesary call to update path effect hook the crash, not sure why but this
+ call is unnecesary so I remove it
+Origin: upstream, http://bazaar.launchpad.net/~inkscape.dev/inkscape/0.92.x/revision/15323
+Bug: https://launchpad.net/bugs/1657591
+---
+ src/live_effects/lpe-patternalongpath.cpp | 1 -
+ src/live_effects/parameter/vector.cpp     | 2 +-
+ 2 files changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/src/live_effects/lpe-patternalongpath.cpp b/src/live_effects/lpe-patternalongpath.cpp
+index a6cade9..027676d 100644
+--- a/src/live_effects/lpe-patternalongpath.cpp
++++ b/src/live_effects/lpe-patternalongpath.cpp
+@@ -262,7 +262,6 @@ LPEPatternAlongPath::transform_multiply(Geom::Affine const& postmul, bool set)
+         pattern.param_transform_multiply(postmul, set);
+         pattern.write_to_SVG();
+     }
+-    sp_lpe_item_update_patheffect (sp_lpe_item, false, true);
+ }
+ 
+ void
+diff --git a/src/live_effects/parameter/vector.cpp b/src/live_effects/parameter/vector.cpp
+index cfaa9e7..9445905 100644
+--- a/src/live_effects/parameter/vector.cpp
++++ b/src/live_effects/parameter/vector.cpp
+@@ -117,7 +117,7 @@ VectorParam::set_and_write_new_values(Geom::Point const &new_origin, Geom::Point
+ void
+ VectorParam::param_transform_multiply(Geom::Affine const& postmul, bool /*set*/)
+ {
+-        set_and_write_new_values( origin * postmul, vector * postmul.withoutTranslation() );
++    set_and_write_new_values( origin * postmul, vector * postmul.withoutTranslation() );
+ }
+ 
+ 
diff --git a/debian/patches/upstream/0.92.x/15324.patch b/debian/patches/upstream/0.92.x/15324.patch
new file mode 100644
index 0000000..8a93e4e
--- /dev/null
+++ b/debian/patches/upstream/0.92.x/15324.patch
@@ -0,0 +1,65 @@
+From: Jabiertxof <none>
+Date: Sun, 22 Jan 2017 18:52:01 +0100
+Subject: Fix nsane memory leak and crash with pattern along path
+
+Origin: upstream, http://bazaar.launchpad.net/~inkscape.dev/inkscape/0.92.x/revision/15324
+Bug: https://launchpad.net/bugs/1622388
+---
+ src/live_effects/lpe-patternalongpath.cpp | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/src/live_effects/lpe-patternalongpath.cpp b/src/live_effects/lpe-patternalongpath.cpp
+index 027676d..51f9e08 100644
+--- a/src/live_effects/lpe-patternalongpath.cpp
++++ b/src/live_effects/lpe-patternalongpath.cpp
+@@ -11,6 +11,7 @@
+ #include <2geom/bezier-to-sbasis.h>
+ 
+ #include "knotholder.h"
++#include <cmath>
+ #include <algorithm>
+ using std::vector;
+ 
+@@ -158,7 +159,7 @@ LPEPatternAlongPath::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > con
+         //        spacing.param_set_range(-pattBndsX.extent()*.9, Geom::infinity());
+         //    }
+ 
+-        y0+=noffset;
++        y0 += noffset;
+ 
+         std::vector<Geom::Piecewise<Geom::D2<Geom::SBasis> > > paths_in;
+         paths_in = split_at_discontinuities(pwd2_in);
+@@ -195,7 +196,7 @@ LPEPatternAlongPath::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > con
+                     
+                 case PAPCT_REPEATED_STRETCHED:
+                     // if uskeleton is closed:
+-                    if(path_i.segs.front().at0() == path_i.segs.back().at1()){
++                    if (are_near(path_i.segs.front().at0(), path_i.segs.back().at1())){
+                         nbCopies = std::max(1, static_cast<int>(std::floor((uskeleton.domain().extent() - toffset)/(pattBndsX->extent()+xspace))));
+                         pattBndsX = Interval(pattBndsX->min(),pattBndsX->max()+xspace);
+                         scaling = (uskeleton.domain().extent() - toffset)/(((double)nbCopies)*pattBndsX->extent());
+@@ -211,11 +212,13 @@ LPEPatternAlongPath::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > con
+                     return pwd2_in;
+             };
+             
++            //Ceil to 6 decimals
++            scaling = ceil(scaling * 1000000) / 1000000;
+             double pattWidth = pattBndsX->extent() * scaling;
+             
+-            x*=scaling;
++            x *= scaling;
+             if ( scale_y_rel.get_value() ) {
+-                y*=(scaling * prop_scale);
++                y *= prop_scale * scaling;
+             } else {
+                 y *= prop_scale;
+             }
+@@ -233,7 +236,7 @@ LPEPatternAlongPath::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > con
+                 offs+=pattWidth;
+             }
+         }
+-        if (fuse_tolerance > 0){        
++        if (fuse_tolerance > 0){
+             pre_output = fuse_nearby_ends(pre_output, fuse_tolerance);
+             for (unsigned i=0; i<pre_output.size(); i++){
+                 output.concat(pre_output[i]);
diff --git a/debian/patches/upstream/0.92.x/15325.patch b/debian/patches/upstream/0.92.x/15325.patch
new file mode 100644
index 0000000..b82ad8f
--- /dev/null
+++ b/debian/patches/upstream/0.92.x/15325.patch
@@ -0,0 +1,103 @@
+From: Jabiertxof <none>
+Date: Sun, 22 Jan 2017 18:52:01 +0100
+Subject: Fixes bugs in copy LPE's
+
+ #1656093:Paste path effect doesn't work on 0.92
+ #1656527:Copy & paste of group with shaped path corrupts it, in v0.92
+Origin: upstream, http://bazaar.launchpad.net/~inkscape.dev/inkscape/0.92.x/revision/15325
+Bug: https://launchpad.net/bugs/1656093
+Bug: https://launchpad.net/bugs/1656527
+---
+ src/file.cpp         |  6 +++++-
+ src/ui/clipboard.cpp | 39 ++++++++++++++++++++-------------------
+ 2 files changed, 25 insertions(+), 20 deletions(-)
+
+diff --git a/src/file.cpp b/src/file.cpp
+index ad1b7e0..5b0e9d8 100644
+--- a/src/file.cpp
++++ b/src/file.cpp
+@@ -1522,8 +1522,12 @@ void sp_import_document(SPDesktop *desktop, SPDocument *clipdoc, bool in_place)
+     for (Inkscape::XML::Node *obj = clipboard->firstChild() ; obj ; obj = obj->next()) {
+     	if(target_document->getObjectById(obj->attribute("id"))) continue;
+         Inkscape::XML::Node *obj_copy = obj->duplicate(target_document->getReprDoc());
+-        target_parent->appendChild(obj_copy);
++        SPObject * pasted = desktop->currentLayer()->appendChildRepr(obj_copy);
+         Inkscape::GC::release(obj_copy);
++        SPLPEItem * pasted_lpe_item = dynamic_cast<SPLPEItem *>(pasted);
++        if (pasted_lpe_item){
++            pasted_lpe_item->forkPathEffectsIfNecessary(1);
++        } 
+         pasted_objects_not.push_back(obj_copy);
+     }
+     Inkscape::Selection *selection = desktop->getSelection();
+diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp
+index 4edfa70..b1945af 100644
+--- a/src/ui/clipboard.cpp
++++ b/src/ui/clipboard.cpp
+@@ -655,7 +655,6 @@ Glib::ustring ClipboardManagerImpl::getShapeOrTextObjectId(SPDesktop *desktop)
+     return svgd;
+ }
+ 
+-
+ /**
+  * Iterate over a list of items and copy them to the clipboard.
+  */
+@@ -700,24 +699,6 @@ void ClipboardManagerImpl::_copySelection(Inkscape::Selection *selection)
+                 obj_copy = _copyNode(obj, _doc, _root);
+             else
+                 obj_copy = _copyNode(obj, _doc, _clipnode);
+-            SPLPEItem *lpeitem = dynamic_cast<SPLPEItem *>(item);
+-            if (lpeitem) {
+-                Inkscape::SVGOStringStream os;
+-                if (lpeitem->hasPathEffect()) {
+-                    for (PathEffectList::iterator it = lpeitem->path_effect_list->begin(); it != lpeitem->path_effect_list->end(); ++it)
+-                    {
+-                        LivePathEffectObject *lpeobj = (*it)->lpeobject;
+-                        if (lpeobj) {
+-                            Inkscape::XML::Node * lpeobjcopy = _copyNode(lpeobj->getRepr(), _doc, _defs);
+-                            gchar *new_conflict_id = sp_object_get_unique_id(lpeobj, lpeobj->getAttribute("id"));
+-                            lpeobjcopy->setAttribute("id", new_conflict_id);
+-                            g_free(new_conflict_id);
+-                            os << "#" << lpeobjcopy->attribute("id") << ";";
+-                        }
+-                    }
+-                }
+-                obj_copy->setAttribute("inkscape:path-effect", os.str().c_str());
+-            }
+ 
+             // copy complete inherited style
+             SPCSSAttr *css = sp_repr_css_attr_inherited(obj, "style");
+@@ -750,6 +731,13 @@ void ClipboardManagerImpl::_copySelection(Inkscape::Selection *selection)
+             sp_repr_css_set(_clipnode, style, "style");
+             sp_repr_css_attr_unref(style);
+         }
++        // copy path effect from the first path
++        if (object) {
++            gchar const *effect =object->getRepr()->attribute("inkscape:path-effect");
++            if (effect) {
++                _clipnode->setAttribute("inkscape:path-effect", effect);
++            }
++        }
+     }
+ 
+     Geom::OptRect size = selection->visualBounds();
+@@ -852,6 +840,19 @@ void ClipboardManagerImpl::_copyUsedDefs(SPItem *item)
+         }
+     }
+ 
++    // For lpe items, copy lpe stack if applicable
++    SPLPEItem *lpeitem = dynamic_cast<SPLPEItem *>(item);
++    if (lpeitem) {
++        if (lpeitem->hasPathEffect()) {
++            for (PathEffectList::iterator it = lpeitem->path_effect_list->begin(); it != lpeitem->path_effect_list->end(); ++it){
++                LivePathEffectObject *lpeobj = (*it)->lpeobject;
++                if (lpeobj) {
++                  _copyNode(lpeobj->getRepr(), _doc, _defs);
++                }
++            }
++        }
++    }
++
+     // recurse
+     for (SPObject *o = item->children ; o != NULL ; o = o->next) {
+         SPItem *childItem = dynamic_cast<SPItem *>(o);

-- 
inkscape packaging



More information about the pkg-multimedia-commits mailing list