X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Ftext-chemistry.cpp;h=f2ea4367b9acd5ee27de6f2893d27e34d4dd3b56;hb=9dc68827cbd515262ecb8d5ae8547d9e82c72e00;hp=9d4c23b258d66ea5f1c468acae1c14f7f3f7d24d;hpb=072de79e6270f4137fa48a8a73491e8a0904d8f8;p=inkscape.git diff --git a/src/text-chemistry.cpp b/src/text-chemistry.cpp index 9d4c23b25..f2ea4367b 100644 --- a/src/text-chemistry.cpp +++ b/src/text-chemistry.cpp @@ -1,10 +1,10 @@ -#define __SP_TEXT_CHEMISTRY_C__ - /* * Text commands * * Authors: * bulia byak + * Jon A. Cruz + * Abhishek Sharma * * Copyright (C) 2004 authors * @@ -37,6 +37,7 @@ #include "sp-flowdiv.h" #include "sp-tspan.h" +using Inkscape::DocumentUndo; SPItem * text_in_selection(Inkscape::Selection *selection) @@ -98,7 +99,7 @@ text_put_on_path() 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 a text and a path to put text on path.")); @@ -139,7 +140,7 @@ text_put_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(); @@ -188,8 +189,8 @@ text_put_on_path() SP_OBJECT_REPR(text)->setAttribute("x", NULL); SP_OBJECT_REPR(text)->setAttribute("y", NULL); - SPDocumentUndo::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); } @@ -215,7 +216,7 @@ text_remove_from_path() continue; } - SPObject *tp = SP_OBJECT(items->data)->first_child(); + SPObject *tp = SP_OBJECT(items->data)->firstChild(); did = true; @@ -225,8 +226,8 @@ text_remove_from_path() if (!did) { sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("No texts-on-paths in the selection.")); } else { - SPDocumentUndo::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 } } @@ -252,7 +253,7 @@ text_remove_all_kerns_recursively(SPObject *o) g_strfreev(xa_comma); } - for (SPObject *i = o->first_child(); i != NULL; i = SP_OBJECT_NEXT(i)) { + for (SPObject *i = o->firstChild(); i != NULL; i = i->getNext()) { text_remove_all_kerns_recursively(i); } } @@ -289,8 +290,8 @@ text_remove_all_kerns() if (!did) { sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("Select text(s) to remove kerns from.")); } else { - SPDocumentUndo::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")); } } @@ -302,7 +303,7 @@ text_flow_into_shape() 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); @@ -377,8 +378,8 @@ text_flow_into_shape() SP_OBJECT(text)->deleteObject (true); - SPDocumentUndo::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)); @@ -394,7 +395,7 @@ text_unflow () 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); @@ -473,8 +474,8 @@ text_unflow () g_slist_free (old_objs); g_slist_free (new_objs); - SPDocumentUndo::done(doc, SP_VERB_CONTEXT_TEXT, - _("Unflow flowed text")); + DocumentUndo::done(doc, SP_VERB_CONTEXT_TEXT, + _("Unflow flowed text")); } void @@ -530,9 +531,9 @@ flowtext_to_text() g_slist_free(items); if (did) { - SPDocumentUndo::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)-> @@ -553,4 +554,4 @@ flowtext_to_text() 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 :