summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorJabiertxof <jabier.arraiza@marker.es>2019-09-13 20:09:42 +0000
committerJabiertxof <jabier.arraiza@marker.es>2019-09-13 20:09:42 +0000
commitbf052b6e7cb79317c4f38ff144a77b6f9e49421e (patch)
tree8b5235b21eeac68e495ad60a51065aaeed4aff33 /src/ui
parentRefactor of prepare inner and some comments (diff)
downloadinkscape-bf052b6e7cb79317c4f38ff144a77b6f9e49421e.tar.gz
inkscape-bf052b6e7cb79317c4f38ff144a77b6f9e49421e.zip
Allow to paste paragraphs in SVG2 Flow then paste overflow the shape
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/clipboard.cpp8
-rw-r--r--src/ui/toolbar/text-toolbar.cpp19
-rw-r--r--src/ui/tools/text-tool.cpp7
3 files changed, 17 insertions, 17 deletions
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp
index b9e7dc2b5..078dfc125 100644
--- a/src/ui/clipboard.cpp
+++ b/src/ui/clipboard.cpp
@@ -1089,7 +1089,10 @@ bool ClipboardManagerImpl::_pasteText(SPDesktop *desktop)
Inkscape::Text::Layout const *layout = te_get_layout(tc->text);
Inkscape::Text::Layout::iterator it_next;
Inkscape::Text::Layout::iterator it = tc->text_sel_end;
-
+ SPText *textitem = dynamic_cast<SPText *>(tc->text);
+ if (textitem) {
+ textitem->hide_shape_inside();
+ }
SPCSSAttr *css = take_style_from_item(tc->text);
for (int i = 0; i < nr_blocks; ++i)
{
@@ -1116,6 +1119,9 @@ bool ClipboardManagerImpl::_pasteText(SPDesktop *desktop)
for (unsigned int j = te_selected_style_positions[i]; j < te_selected_style_positions[i+1]; ++j)
it.nextCharacter();
}
+ if (textitem) {
+ textitem->show_shape_inside();
+ }
}
return true;
}
diff --git a/src/ui/toolbar/text-toolbar.cpp b/src/ui/toolbar/text-toolbar.cpp
index 839fb997b..b0af522d3 100644
--- a/src/ui/toolbar/text-toolbar.cpp
+++ b/src/ui/toolbar/text-toolbar.cpp
@@ -2293,28 +2293,15 @@ void TextToolbar::prepare_inner()
}
// Here we remove temporary the shape to allow layout calculate where are the warp_end and warpo_start
// position if one of this are hiden because the previous line height changed
- SPCSSAttr *css = nullptr;
if (text) {
- SPStyle *item_style = spitem->style;
- if (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");
- spitem->changeCSS(css_unset, "style");
- spitem->updateRepr();
- }
+ text->hide_shape_inside();
}
- /* if (text) {
- text->rebuildLayout();
- } else if (flowtext) {
- flowtext->rebuildLayout();
- } */
void *rawptr_start = nullptr;
void *rawptr_end = nullptr;
layout->getSourceOfCharacter(wrap_start, &rawptr_start);
layout->getSourceOfCharacter(wrap_end, &rawptr_end);
- if (css) {
- spitem->changeCSS(css, "style");
+ if (text) {
+ text->show_shape_inside();
}
if (!rawptr_start || !rawptr_end || !SP_IS_OBJECT(rawptr_start)|| !SP_IS_OBJECT(rawptr_end)) {
return;
diff --git a/src/ui/tools/text-tool.cpp b/src/ui/tools/text-tool.cpp
index 20b4c2c65..a9a66d64f 100644
--- a/src/ui/tools/text-tool.cpp
+++ b/src/ui/tools/text-tool.cpp
@@ -1315,6 +1315,10 @@ bool sp_text_paste_inline(ToolBase *ec)
Glib::ustring const clip_text = refClipboard->wait_for_text();
if (!clip_text.empty()) {
+ SPText *textitem = dynamic_cast<SPText *>(tc->text);
+ if (textitem) {
+ textitem->hide_shape_inside();
+ }
// Fix for 244940
// The XML standard defines the following as valid characters
// (Extensible Markup Language (XML) 1.0 (Fourth Edition) paragraph 2.2)
@@ -1360,6 +1364,9 @@ bool sp_text_paste_inline(ToolBase *ec)
tc->text_sel_start = tc->text_sel_end = sp_te_insert_line(tc->text, tc->text_sel_start);
begin = end + 1;
}
+ if (textitem) {
+ textitem->show_shape_inside();
+ }
DocumentUndo::done(ec->desktop->getDocument(), SP_VERB_CONTEXT_TEXT,
_("Paste text"));