From c239b8d513fae662a4e3be85f85efb794d98d83d Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Mon, 16 Sep 2019 16:41:18 +0200 Subject: Allow paste preserving new lines into a flowtext element --- src/object/sp-text.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/object/sp-text.cpp') diff --git a/src/object/sp-text.cpp b/src/object/sp-text.cpp index 4dd5a9ff1..01e56633a 100644 --- a/src/object/sp-text.cpp +++ b/src/object/sp-text.cpp @@ -50,6 +50,7 @@ #include "sp-textpath.h" #include "sp-tref.h" #include "sp-tspan.h" +#include "sp-flowregion.h" #include "text-editing.h" @@ -390,9 +391,10 @@ void SPText::snappoints(std::vector &p, Inkscape:: void SPText::hide_shape_inside() { - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + SPText *text = dynamic_cast(this); + SPObject *object = dynamic_cast(this); SPStyle *item_style = this->style; - if (item_style && prefs->getBool("/tools/text/use_svg2") && item_style->shape_inside.set) { + if (item_style && text && item_style->shape_inside.set) { SPCSSAttr *css_unset = sp_css_attr_from_style(item_style, SP_STYLE_FLAG_IFSET); css = sp_css_attr_from_style(item_style, SP_STYLE_FLAG_IFSET); sp_repr_css_unset_property(css_unset, "shape-inside"); @@ -405,8 +407,9 @@ void SPText::hide_shape_inside() void SPText::show_shape_inside() { - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - if (prefs->getBool("/tools/text/use_svg2") && css) { + SPText *text = dynamic_cast(this); + SPObject *object = dynamic_cast(this); + if (text && css) { this->changeCSS(css, "style"); } } -- cgit v1.2.3