summaryrefslogtreecommitdiffstats
path: root/src/text-chemistry.cpp
diff options
context:
space:
mode:
authorsu_v <suv-sf@users.sourceforge.net>2014-12-31 14:36:09 +0000
committer~suv <suv-sf@users.sourceforge.net>2014-12-31 14:36:09 +0000
commit02cb649c0ceebd254dde302eeba71406fb25a24c (patch)
tree4ccb52d7f06a7160adb2aaf1428d3a5a2acef9a5 /src/text-chemistry.cpp
parentpackaging/macosx: update local python ports (MacPorts drops support for Pytho... (diff)
parentFix for bug #758718 (Color Picker/Dropper: Color selection area not lined up ... (diff)
downloadinkscape-02cb649c0ceebd254dde302eeba71406fb25a24c.tar.gz
inkscape-02cb649c0ceebd254dde302eeba71406fb25a24c.zip
update to trunk (r13829)
(bzr r13798.1.2)
Diffstat (limited to 'src/text-chemistry.cpp')
-rw-r--r--src/text-chemistry.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/src/text-chemistry.cpp b/src/text-chemistry.cpp
index aa2d81427..65b59f2ad 100644
--- a/src/text-chemistry.cpp
+++ b/src/text-chemistry.cpp
@@ -29,7 +29,7 @@
#include "message-stack.h"
#include "selection.h"
#include "style.h"
-#include "desktop-handles.h"
+
#include "text-editing.h"
#include "text-chemistry.h"
#include "sp-flowtext.h"
@@ -83,7 +83,7 @@ text_put_on_path()
if (!desktop)
return;
- Inkscape::Selection *selection = sp_desktop_selection(desktop);
+ Inkscape::Selection *selection = desktop->getSelection();
SPItem *text = text_or_flowtext_in_selection(selection);
SPItem *shape = shape_in_selection(selection);
@@ -91,18 +91,18 @@ text_put_on_path()
Inkscape::XML::Document *xml_doc = desktop->doc()->getReprDoc();
if (!text || !shape || g_slist_length((GSList *) selection->itemList()) != 2) {
- sp_desktop_message_stack(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select <b>a text and a path</b> to put text on path."));
+ desktop->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select <b>a text and a path</b> to put text on path."));
return;
}
if (SP_IS_TEXT_TEXTPATH(text)) {
- sp_desktop_message_stack(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."));
+ desktop->getMessageStack()->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_RECT(shape)) {
// rect is the only SPShape which is not <path> yet, and thus SVG forbids us from putting text on it
- sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("You cannot put text on a rectangle in this version. Convert rectangle to path first."));
+ desktop->getMessageStack()->flash(Inkscape::ERROR_MESSAGE, _("You cannot put text on a rectangle in this version. Convert rectangle to path first."));
return;
}
@@ -110,7 +110,7 @@ text_put_on_path()
if (SP_IS_FLOWTEXT(text)) {
if (!SP_FLOWTEXT(text)->layout.outputExists()) {
- sp_desktop_message_stack(desktop)->
+ desktop->getMessageStack()->
flash(Inkscape::WARNING_MESSAGE,
_("The flowed text(s) must be <b>visible</b> in order to be put on a path."));
}
@@ -122,14 +122,14 @@ text_put_on_path()
Inkscape::XML::Node *parent = text->getRepr()->parent();
parent->appendChild(repr);
- SPItem *new_item = (SPItem *) sp_desktop_document(desktop)->getObjectByRepr(repr);
+ SPItem *new_item = (SPItem *) desktop->getDocument()->getObjectByRepr(repr);
new_item->doWriteTransform(repr, text->transform);
new_item->updateRepr();
Inkscape::GC::release(repr);
text->deleteObject(); // delete the orignal flowtext
- sp_desktop_document(desktop)->ensureUpToDate();
+ desktop->getDocument()->ensureUpToDate();
selection->clear();
@@ -181,7 +181,7 @@ text_put_on_path()
text->getRepr()->setAttribute("x", NULL);
text->getRepr()->setAttribute("y", NULL);
- DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
+ DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_TEXT,
_("Put text on path"));
g_slist_free(text_reprs);
}
@@ -191,10 +191,10 @@ text_remove_from_path()
{
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
- Inkscape::Selection *selection = sp_desktop_selection(desktop);
+ Inkscape::Selection *selection = desktop->getSelection();
if (selection->isEmpty()) {
- sp_desktop_message_stack(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select <b>a text on path</b> to remove it from path."));
+ desktop->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select <b>a text on path</b> to remove it from path."));
return;
}
@@ -215,9 +215,9 @@ text_remove_from_path()
}
if (!did) {
- sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("<b>No texts-on-paths</b> in the selection."));
+ desktop->getMessageStack()->flash(Inkscape::ERROR_MESSAGE, _("<b>No texts-on-paths</b> in the selection."));
} else {
- DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
+ DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_TEXT,
_("Remove text from path"));
selection->setList(g_slist_copy((GSList *) selection->itemList())); // reselect to update statusbar description
}
@@ -256,10 +256,10 @@ text_remove_all_kerns()
{
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
- Inkscape::Selection *selection = sp_desktop_selection(desktop);
+ Inkscape::Selection *selection = desktop->getSelection();
if (selection->isEmpty()) {
- sp_desktop_message_stack(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select <b>text(s)</b> to remove kerns from."));
+ desktop->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select <b>text(s)</b> to remove kerns from."));
return;
}
@@ -280,9 +280,9 @@ text_remove_all_kerns()
}
if (!did) {
- sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("Select <b>text(s)</b> to remove kerns from."));
+ desktop->getMessageStack()->flash(Inkscape::ERROR_MESSAGE, _("Select <b>text(s)</b> to remove kerns from."));
} else {
- DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
+ DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_TEXT,
_("Remove manual kerns"));
}
}
@@ -294,16 +294,16 @@ text_flow_into_shape()
if (!desktop)
return;
- SPDocument *doc = sp_desktop_document (desktop);
+ SPDocument *doc = desktop->getDocument();
Inkscape::XML::Document *xml_doc = doc->getReprDoc();
- Inkscape::Selection *selection = sp_desktop_selection(desktop);
+ Inkscape::Selection *selection = desktop->getSelection();
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_desktop_message_stack(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select <b>a text</b> and one or more <b>paths or shapes</b> to flow text into frame."));
+ desktop->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select <b>a text</b> and one or more <b>paths or shapes</b> to flow text into frame."));
return;
}
@@ -375,7 +375,7 @@ text_flow_into_shape()
DocumentUndo::done(doc, SP_VERB_CONTEXT_TEXT,
_("Flow text into shape"));
- sp_desktop_selection(desktop)->set(SP_ITEM(root_object));
+ desktop->getSelection()->set(SP_ITEM(root_object));
Inkscape::GC::release(root_repr);
Inkscape::GC::release(region_repr);
@@ -388,14 +388,14 @@ text_unflow ()
if (!desktop)
return;
- SPDocument *doc = sp_desktop_document (desktop);
+ SPDocument *doc = desktop->getDocument();
Inkscape::XML::Document *xml_doc = doc->getReprDoc();
- Inkscape::Selection *selection = sp_desktop_selection(desktop);
+ Inkscape::Selection *selection = desktop->getSelection();
if (!flowtext_in_selection(selection) || g_slist_length((GSList *) selection->itemList()) < 1) {
- sp_desktop_message_stack(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select <b>a flowed text</b> to unflow it."));
+ desktop->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select <b>a flowed text</b> to unflow it."));
return;
}
@@ -477,10 +477,10 @@ flowtext_to_text()
{
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
- Inkscape::Selection *selection = sp_desktop_selection(desktop);
+ Inkscape::Selection *selection = desktop->getSelection();
if (selection->isEmpty()) {
- sp_desktop_message_stack(desktop)->flash(Inkscape::WARNING_MESSAGE,
+ desktop->getMessageStack()->flash(Inkscape::WARNING_MESSAGE,
_("Select <b>flowed text(s)</b> to convert."));
return;
}
@@ -497,7 +497,7 @@ flowtext_to_text()
continue;
if (!SP_FLOWTEXT(item)->layout.outputExists()) {
- sp_desktop_message_stack(desktop)->
+ desktop->getMessageStack()->
flash(Inkscape::WARNING_MESSAGE,
_("The flowed text(s) must be <b>visible</b> in order to be converted."));
return;
@@ -512,7 +512,7 @@ flowtext_to_text()
Inkscape::XML::Node *parent = item->getRepr()->parent();
parent->addChild(repr, item->getRepr());
- SPItem *new_item = reinterpret_cast<SPItem *>(sp_desktop_document(desktop)->getObjectByRepr(repr));
+ SPItem *new_item = reinterpret_cast<SPItem *>(desktop->getDocument()->getObjectByRepr(repr));
new_item->doWriteTransform(repr, item->transform);
new_item->updateRepr();
@@ -525,12 +525,12 @@ flowtext_to_text()
g_slist_free(items);
if (did) {
- DocumentUndo::done(sp_desktop_document(desktop),
+ DocumentUndo::done(desktop->getDocument(),
SP_VERB_OBJECT_FLOWTEXT_TO_TEXT,
_("Convert flowed text to text"));
selection->setReprList(reprs);
} else {
- sp_desktop_message_stack(desktop)->
+ desktop->getMessageStack()->
flash(Inkscape::ERROR_MESSAGE,
_("<b>No flowed text(s)</b> to convert in the selection."));
}