Commit 10e9a53a authored by chr's avatar chr

bugfix crash while moving objects

sp_svg_transform_write can return NULL and Glib::ustring blows up:

terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct null not valid

 #0  0x00007fffed6ec067 in raise () from /lib/x86_64-linux-gnu/libc.so.6
 #1  0x00007fffed6ed448 in abort () from /lib/x86_64-linux-gnu/libc.so.6
 #2  0x00007fffedac2b3d in __gnu_cxx::__verbose_terminate_handler() ()
    from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
 #3  0x00007fffedac0bb6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
 #4  0x00007fffedac0c01 in std::terminate() ()
    from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
 #5  0x00007fffedac0e19 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
 #6  0x00007fffedb168b6 in std::__throw_logic_error(char const*) ()
    from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
 #7  0x00007ffff76e83d5 in char* std::string::_S_construct<char const*>(char const*, char const*, std::allocator<char> const&, std::forward_iterator_tag) ()
    from /usr/bin/../lib/inkscape/libinkscape_base.so
 #8  0x00007fffedb22c46 in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) ()
    from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
 #9  0x00007ffff036055e in Glib::ustring::ustring(char const*) ()
    from /usr/lib/x86_64-linux-gnu/libglibmm-2.4.so.1
 #10 0x00007ffff75650e3 in SPPattern::transform_multiply(Geom::Affine, bool) ()
    from /usr/bin/../lib/inkscape/libinkscape_base.so
 #11 0x00007ffff753d862 in SPItem::adjust_pattern(Geom::Affine const&, bool, PatternTransform) () from /usr/bin/../lib/inkscape/libinkscape_base.so
 #12 0x00007ffff7562897 in SPPath::set_transform(Geom::Affine const&) ()
    from /usr/bin/../lib/inkscape/libinkscape_base.so

(bzr r15418.1.1)
parent 8232daf4
......@@ -374,8 +374,9 @@ void SPPattern::transform_multiply(Geom::Affine postmul, bool set)
}
_pattern_transform_set = true;
Glib::ustring c = sp_svg_transform_write(_pattern_transform);
gchar *c = sp_svg_transform_write(_pattern_transform);
getRepr()->setAttribute("patternTransform", c);
g_free(c);
}
const gchar *SPPattern::produce(const std::vector<Inkscape::XML::Node *> &reprs, Geom::Rect bounds,
......@@ -392,7 +393,7 @@ const gchar *SPPattern::produce(const std::vector<Inkscape::XML::Node *> &reprs,
sp_repr_set_svg_double(repr, "height", bounds.dimensions()[Geom::Y]);
//TODO: Maybe is better handle it in sp_svg_transform_write
if(transform != Geom::Affine()){
Glib::ustring t = sp_svg_transform_write(transform);
gchar *t = sp_svg_transform_write(transform);
repr->setAttribute("patternTransform", t);
}
defsrepr->appendChild(repr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment