diff --git a/src/text-chemistry.cpp b/src/text-chemistry.cpp
index 2cc6e30d99d1af36fd429e7c095ceb941a23a4b5..f2ea4367b9acd5ee27de6f2893d27e34d4dd3b56 100644 (file)
--- a/src/text-chemistry.cpp
+++ b/src/text-chemistry.cpp
-#define __SP_TEXT_CHEMISTRY_C__
-
/*
* Text commands
*
* Authors:
* bulia byak
+ * Jon A. Cruz <jon@joncruz.org>
+ * Abhishek Sharma
*
* Copyright (C) 2004 authors
*
#include "sp-flowdiv.h"
#include "sp-tspan.h"
+using Inkscape::DocumentUndo;
SPItem *
text_in_selection(Inkscape::Selection *selection)
SPItem *text = text_or_flowtext_in_selection(selection);
SPItem *shape = shape_in_selection(selection);
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(desktop->doc());
+ 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."));
Inkscape::GC::release(repr);
text->deleteObject(); // delete the orignal flowtext
- sp_desktop_document(desktop)->ensure_up_to_date();
+ sp_desktop_document(desktop)->ensureUpToDate();
selection->clear();
SP_OBJECT_REPR(text)->setAttribute("x", NULL);
SP_OBJECT_REPR(text)->setAttribute("y", NULL);
- sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
- _("Put text on path"));
+ DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
+ _("Put text on path"));
g_slist_free(text_reprs);
}
continue;
}
- SPObject *tp = sp_object_first_child(SP_OBJECT(items->data));
+ SPObject *tp = SP_OBJECT(items->data)->firstChild();
did = true;
if (!did) {
sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("<b>No texts-on-paths</b> in the selection."));
} else {
- sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
- _("Remove text from path"));
+ DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
+ _("Remove text from path"));
selection->setList(g_slist_copy((GSList *) selection->itemList())); // reselect to update statusbar description
}
}
g_strfreev(xa_comma);
}
- for (SPObject *i = sp_object_first_child(o); i != NULL; i = SP_OBJECT_NEXT(i)) {
+ for (SPObject *i = o->firstChild(); i != NULL; i = i->getNext()) {
text_remove_all_kerns_recursively(i);
}
}
if (!did) {
sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("Select <b>text(s)</b> to remove kerns from."));
} else {
- sp_document_done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
- _("Remove manual kerns"));
+ DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT,
+ _("Remove manual kerns"));
}
}
return;
SPDocument *doc = sp_desktop_document (desktop);
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc);
+ Inkscape::XML::Document *xml_doc = doc->getReprDoc();
Inkscape::Selection *selection = sp_desktop_selection(desktop);
SP_OBJECT(text)->deleteObject (true);
- sp_document_done(doc, SP_VERB_CONTEXT_TEXT,
- _("Flow text into shape"));
+ DocumentUndo::done(doc, SP_VERB_CONTEXT_TEXT,
+ _("Flow text into shape"));
sp_desktop_selection(desktop)->set(SP_ITEM(root_object));
return;
SPDocument *doc = sp_desktop_document (desktop);
- Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc);
+ Inkscape::XML::Document *xml_doc = doc->getReprDoc();
Inkscape::Selection *selection = sp_desktop_selection(desktop);
g_slist_free (old_objs);
g_slist_free (new_objs);
- sp_document_done(doc, SP_VERB_CONTEXT_TEXT,
- _("Unflow flowed text"));
+ DocumentUndo::done(doc, SP_VERB_CONTEXT_TEXT,
+ _("Unflow flowed text"));
}
void
g_slist_free(items);
if (did) {
- sp_document_done(sp_desktop_document(desktop),
- SP_VERB_OBJECT_FLOWTEXT_TO_TEXT,
- _("Convert flowed text to text"));
+ DocumentUndo::done(sp_desktop_document(desktop),
+ SP_VERB_OBJECT_FLOWTEXT_TO_TEXT,
+ _("Convert flowed text to text"));
selection->setReprList(reprs);
} else {
sp_desktop_message_stack(desktop)->
fill-column:99
End:
*/
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :