summaryrefslogtreecommitdiffstats
path: root/src/object/sp-text.cpp
diff options
context:
space:
mode:
authorJabiertxof <jabier.arraiza@marker.es>2019-09-16 14:41:18 +0000
committerJabiertxof <jabier.arraiza@marker.es>2019-09-16 14:41:18 +0000
commitc239b8d513fae662a4e3be85f85efb794d98d83d (patch)
treec2528a5760b21acc685f13cde3b5426284d6fc5b /src/object/sp-text.cpp
parentAllow paste on flowbox at same sice of origin, also improve creation to get r... (diff)
downloadinkscape-c239b8d513fae662a4e3be85f85efb794d98d83d.tar.gz
inkscape-c239b8d513fae662a4e3be85f85efb794d98d83d.zip
Allow paste preserving new lines into a flowtext element
Diffstat (limited to '')
-rw-r--r--src/object/sp-text.cpp11
1 files changed, 7 insertions, 4 deletions
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<Inkscape::SnapCandidatePoint> &p, Inkscape::
void SPText::hide_shape_inside()
{
- Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ SPText *text = dynamic_cast<SPText *>(this);
+ SPObject *object = dynamic_cast<SPObject *>(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<SPText *>(this);
+ SPObject *object = dynamic_cast<SPObject *>(this);
+ if (text && css) {
this->changeCSS(css, "style");
}
}