From 6c3e31373fbd5b7e36d6fc6977ac74508429b477 Mon Sep 17 00:00:00 2001 From: Nathan Lee <2431820-nathanal@users.noreply.gitlab.com> Date: Wed, 6 Mar 2019 10:34:37 +1100 Subject: Do partial convert flowed text to tspan if possible Fixes https://gitlab.com/inkscape/inbox/issues/193 --- src/text-chemistry.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/text-chemistry.cpp') diff --git a/src/text-chemistry.cpp b/src/text-chemistry.cpp index 371346442..8a2433ec6 100644 --- a/src/text-chemistry.cpp +++ b/src/text-chemistry.cpp @@ -511,6 +511,7 @@ flowtext_to_text() } bool did = false; + bool ignored = false; std::vector reprs; std::vector items(selection->items().begin(), selection->items().end()); @@ -522,10 +523,8 @@ flowtext_to_text() continue; if (!SP_FLOWTEXT(item)->layout.outputExists()) { - desktop->getMessageStack()-> - flash(Inkscape::WARNING_MESSAGE, - _("The flowed text(s) must be visible in order to be converted.")); - return; + ignored = true; + continue; } Inkscape::XML::Node *repr = SP_FLOWTEXT(item)->getAsText(); @@ -547,12 +546,17 @@ flowtext_to_text() reprs.push_back(repr); } - if (did) { DocumentUndo::done(desktop->getDocument(), SP_VERB_OBJECT_FLOWTEXT_TO_TEXT, _("Convert flowed text to text")); selection->setReprList(reprs); + } else if (ignored) { + // no message for (did && ignored) because it is immediately overwritten + desktop->getMessageStack()-> + flash(Inkscape::ERROR_MESSAGE, + _("Flowed text(s) must be visible in order to be converted.")); + } else { desktop->getMessageStack()-> flash(Inkscape::ERROR_MESSAGE, -- cgit v1.2.3