X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Ftext-chemistry.cpp;h=453ddfc1949f6699101f9590ac32ecfd7a64db02;hb=728152945a5fe656e4bcfbd189f14956b7399630;hp=549db62282d5354dfde6bd44e92f59e09d3f2c40;hpb=cd477aa9d480d06e1c3328f5e66d26a91c7db772;p=inkscape.git
diff --git a/src/text-chemistry.cpp b/src/text-chemistry.cpp
index 549db6228..453ddfc19 100644
--- a/src/text-chemistry.cpp
+++ b/src/text-chemistry.cpp
@@ -85,29 +85,29 @@ text_put_on_path()
if (!desktop)
return;
- Inkscape::Selection *selection = SP_DT_SELECTION(desktop);
+ Inkscape::Selection *selection = sp_desktop_selection(desktop);
SPItem *text = text_or_flowtext_in_selection(selection);
SPItem *shape = shape_in_selection(selection);
if (!text || !shape || g_slist_length((GSList *) selection->itemList()) != 2) {
- SP_DT_MSGSTACK(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select a text and a path to put text on path."));
+ sp_desktop_message_stack(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select a text and a path to put text on path."));
return;
}
if (SP_IS_TEXT_TEXTPATH(text)) {
- SP_DT_MSGSTACK(desktop)->flash(Inkscape::ERROR_MESSAGE, _("This text object is already put on a path. Remove it from the path first. Use Shift+D to look up its path."));
+ sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("This text object is already put on a path. Remove it from the path first. Use Shift+D 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."));
+ sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("You cannot put flowtext on a path. Convert flowtext to text first."));
return;
}
if (SP_IS_RECT(shape)) {
// rect is the only SPShape which is not yet, and thus SVG forbids us from putting text on it
- SP_DT_MSGSTACK(desktop)->flash(Inkscape::ERROR_MESSAGE, _("You cannot put text on a rectangle in this version. Convert rectangle to path first."));
+ sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("You cannot put text on a rectangle in this version. Convert rectangle to path first."));
return;
}
@@ -153,7 +153,8 @@ text_put_on_path()
SP_OBJECT_REPR(text)->setAttribute("x", NULL);
SP_OBJECT_REPR(text)->setAttribute("y", NULL);
- sp_document_done(SP_DT_DOCUMENT(desktop));
+ sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
+ /* TODO: annotate */ "text-chemistry.cpp:157");
g_slist_free(text_reprs);
}
@@ -162,10 +163,10 @@ text_remove_from_path()
{
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
- Inkscape::Selection *selection = SP_DT_SELECTION(desktop);
+ Inkscape::Selection *selection = sp_desktop_selection(desktop);
if (selection->isEmpty()) {
- SP_DT_MSGSTACK(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select a text on path to remove it from path."));
+ sp_desktop_message_stack(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select a text on path to remove it from path."));
return;
}
@@ -187,10 +188,11 @@ text_remove_from_path()
}
if (!did) {
- SP_DT_MSGSTACK(desktop)->flash(Inkscape::ERROR_MESSAGE, _("No texts-on-paths in the selection."));
+ sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("No texts-on-paths in the selection."));
} else {
selection->setList(g_slist_copy((GSList *) selection->itemList())); // reselect to update statusbar description
- sp_document_done(SP_DT_DOCUMENT(desktop));
+ sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
+ /* TODO: annotate */ "text-chemistry.cpp:195");
}
}
@@ -212,10 +214,10 @@ text_remove_all_kerns()
{
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
- Inkscape::Selection *selection = SP_DT_SELECTION(desktop);
+ Inkscape::Selection *selection = sp_desktop_selection(desktop);
if (selection->isEmpty()) {
- SP_DT_MSGSTACK(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select text(s) to remove kerns from."));
+ sp_desktop_message_stack(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select text(s) to remove kerns from."));
return;
}
@@ -235,9 +237,10 @@ text_remove_all_kerns()
}
if (!did) {
- SP_DT_MSGSTACK(desktop)->flash(Inkscape::ERROR_MESSAGE, _("Select text(s) to remove kerns from."));
+ sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("Select text(s) to remove kerns from."));
} else {
- sp_document_done(SP_DT_DOCUMENT(desktop));
+ sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
+ /* TODO: annotate */ "text-chemistry.cpp:243");
}
}
@@ -248,15 +251,15 @@ text_flow_into_shape()
if (!desktop)
return;
- SPDocument *doc = SP_DT_DOCUMENT (desktop);
+ SPDocument *doc = sp_desktop_document (desktop);
- Inkscape::Selection *selection = SP_DT_SELECTION(desktop);
+ Inkscape::Selection *selection = sp_desktop_selection(desktop);
SPItem *text = text_in_selection(selection);
SPItem *shape = shape_in_selection(selection);
if (!text || !shape || g_slist_length((GSList *) selection->itemList()) < 2) {
- SP_DT_MSGSTACK(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select a text and one or more paths or shapes to flow text into frame."));
+ sp_desktop_message_stack(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select a text and one or more paths or shapes to flow text into frame."));
return;
}
@@ -305,9 +308,10 @@ text_flow_into_shape()
SP_OBJECT(text)->deleteObject (true);
- sp_document_done(doc);
+ sp_document_done(doc, SP_VERB_CONTEXT_TEXT,
+ /* TODO: annotate */ "text-chemistry.cpp:312");
- SP_DT_SELECTION(desktop)->set(SP_ITEM(root_object));
+ sp_desktop_selection(desktop)->set(SP_ITEM(root_object));
Inkscape::GC::release(root_repr);
Inkscape::GC::release(region_repr);
@@ -322,13 +326,13 @@ text_unflow ()
if (!desktop)
return;
- SPDocument *doc = SP_DT_DOCUMENT (desktop);
+ SPDocument *doc = sp_desktop_document (desktop);
- Inkscape::Selection *selection = SP_DT_SELECTION(desktop);
+ Inkscape::Selection *selection = sp_desktop_selection(desktop);
if (!flowtext_in_selection(selection) || g_slist_length((GSList *) selection->itemList()) < 1) {
- SP_DT_MSGSTACK(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select a flowed text to unflow it."));
+ sp_desktop_message_stack(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select a flowed text to unflow it."));
return;
}
@@ -390,7 +394,8 @@ text_unflow ()
g_slist_free (old_objs);
g_slist_free (new_objs);
- sp_document_done(doc);
+ sp_document_done(doc, SP_VERB_CONTEXT_TEXT,
+ /* TODO: annotate */ "text-chemistry.cpp:398");
}