summaryrefslogtreecommitdiffstats
path: root/src/text-chemistry.cpp
diff options
context:
space:
mode:
authorAaron Spike <aaron@ekips.org>2006-02-05 21:39:41 +0000
committeracspike <acspike@users.sourceforge.net>2006-02-05 21:39:41 +0000
commit7e6aaba3526f80feb2989a7a9b96246281a03062 (patch)
tree5c85d29a25c34a9bb797ba9a017f8281b6399ada /src/text-chemistry.cpp
parentenable selecting tspans via xml editor (diff)
downloadinkscape-7e6aaba3526f80feb2989a7a9b96246281a03062.tar.gz
inkscape-7e6aaba3526f80feb2989a7a9b96246281a03062.zip
Warn user when attempting to put flowtext on path.
(bzr r83)
Diffstat (limited to 'src/text-chemistry.cpp')
-rw-r--r--src/text-chemistry.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/text-chemistry.cpp b/src/text-chemistry.cpp
index a61bbdf73..549db6228 100644
--- a/src/text-chemistry.cpp
+++ b/src/text-chemistry.cpp
@@ -55,6 +55,18 @@ flowtext_in_selection(Inkscape::Selection *selection)
}
SPItem *
+text_or_flowtext_in_selection(Inkscape::Selection *selection)
+{
+ for (GSList *items = (GSList *) selection->itemList();
+ items != NULL;
+ items = items->next) {
+ if (SP_IS_TEXT(items->data) || SP_IS_FLOWTEXT(items->data))
+ return ((SPItem *) items->data);
+ }
+ return NULL;
+}
+
+SPItem *
shape_in_selection(Inkscape::Selection *selection)
{
for (GSList *items = (GSList *) selection->itemList();
@@ -75,7 +87,7 @@ text_put_on_path()
Inkscape::Selection *selection = SP_DT_SELECTION(desktop);
- SPItem *text = text_in_selection(selection);
+ SPItem *text = text_or_flowtext_in_selection(selection);
SPItem *shape = shape_in_selection(selection);
if (!text || !shape || g_slist_length((GSList *) selection->itemList()) != 2) {
@@ -84,7 +96,12 @@ text_put_on_path()
}
if (SP_IS_TEXT_TEXTPATH(text)) {
- SP_DT_MSGSTACK(desktop)->flash(Inkscape::ERROR_MESSAGE, _("This text object is <b>already put to a path</b>. Remove it from the path first. Use <b>Shift+D</b> to look up its path."));
+ SP_DT_MSGSTACK(desktop)->flash(Inkscape::ERROR_MESSAGE, _("This text object is <b>already put on a path</b>. Remove it from the path first. Use <b>Shift+D</b> to look up its path."));
+ return;
+ }
+
+ if (SP_IS_FLOWTEXT(text)) {
+ SP_DT_MSGSTACK(desktop)->flash(Inkscape::ERROR_MESSAGE, _("You cannot put flowtext on a path. Convert flowtext to text first."));
return;
}