From 30b6a43219b66aba1a9ebade8aca50910f2c25cc Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Sun, 21 Dec 2014 10:39:39 -0500 Subject: Deprecate and remove sp_desktop_selection in favor of SPDesktop::getSelection (bzr r13809) --- src/text-chemistry.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/text-chemistry.cpp') diff --git a/src/text-chemistry.cpp b/src/text-chemistry.cpp index aa2d81427..b90145f8e 100644 --- a/src/text-chemistry.cpp +++ b/src/text-chemistry.cpp @@ -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); @@ -191,7 +191,7 @@ 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 a text on path to remove it from path.")); @@ -256,7 +256,7 @@ 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 text(s) to remove kerns from.")); @@ -297,7 +297,7 @@ text_flow_into_shape() SPDocument *doc = sp_desktop_document (desktop); 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); @@ -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); @@ -391,7 +391,7 @@ text_unflow () SPDocument *doc = sp_desktop_document (desktop); 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) { @@ -477,7 +477,7 @@ 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, -- cgit v1.2.3 From 2135fdee3aeff1dd82d11f191a7295990cd60cb5 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Sun, 21 Dec 2014 16:01:01 -0500 Subject: Purge sp_desktop_message_stack (bzr r13817) --- src/text-chemistry.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/text-chemistry.cpp') diff --git a/src/text-chemistry.cpp b/src/text-chemistry.cpp index b90145f8e..61ae2466b 100644 --- a/src/text-chemistry.cpp +++ b/src/text-chemistry.cpp @@ -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 a text and a path to put text on path.")); + desktop->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select a text and a path 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 already put on a path. Remove it from the path first. Use Shift+D to look up its path.")); + desktop->getMessageStack()->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_RECT(shape)) { // rect is the only SPShape which is not 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 visible in order to be put on a path.")); } @@ -194,7 +194,7 @@ text_remove_from_path() Inkscape::Selection *selection = desktop->getSelection(); if (selection->isEmpty()) { - sp_desktop_message_stack(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select a text on path to remove it from path.")); + desktop->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select a text on path to remove it from path.")); return; } @@ -215,7 +215,7 @@ text_remove_from_path() } if (!did) { - sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("No texts-on-paths in the selection.")); + desktop->getMessageStack()->flash(Inkscape::ERROR_MESSAGE, _("No texts-on-paths in the selection.")); } else { DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, _("Remove text from path")); @@ -259,7 +259,7 @@ text_remove_all_kerns() Inkscape::Selection *selection = desktop->getSelection(); if (selection->isEmpty()) { - sp_desktop_message_stack(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select text(s) to remove kerns from.")); + desktop->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select text(s) to remove kerns from.")); return; } @@ -280,7 +280,7 @@ text_remove_all_kerns() } if (!did) { - sp_desktop_message_stack(desktop)->flash(Inkscape::ERROR_MESSAGE, _("Select text(s) to remove kerns from.")); + desktop->getMessageStack()->flash(Inkscape::ERROR_MESSAGE, _("Select text(s) to remove kerns from.")); } else { DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, _("Remove manual kerns")); @@ -303,7 +303,7 @@ text_flow_into_shape() 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 a text and one or more paths or shapes to flow text into frame.")); + desktop->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select a text and one or more paths or shapes to flow text into frame.")); return; } @@ -395,7 +395,7 @@ text_unflow () if (!flowtext_in_selection(selection) || g_slist_length((GSList *) selection->itemList()) < 1) { - sp_desktop_message_stack(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select a flowed text to unflow it.")); + desktop->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select a flowed text to unflow it.")); return; } @@ -480,7 +480,7 @@ flowtext_to_text() Inkscape::Selection *selection = desktop->getSelection(); if (selection->isEmpty()) { - sp_desktop_message_stack(desktop)->flash(Inkscape::WARNING_MESSAGE, + desktop->getMessageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select flowed text(s) 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 visible in order to be converted.")); return; @@ -530,7 +530,7 @@ flowtext_to_text() _("Convert flowed text to text")); selection->setReprList(reprs); } else { - sp_desktop_message_stack(desktop)-> + desktop->getMessageStack()-> flash(Inkscape::ERROR_MESSAGE, _("No flowed text(s) to convert in the selection.")); } -- cgit v1.2.3 From 3dbf9a08680c6d7252c79397dbf12082ead61bd7 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Sun, 21 Dec 2014 16:58:32 -0500 Subject: Remove sp_desktop_document and finish cleanup of desktop-handles.h (bzr r13820) --- src/text-chemistry.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/text-chemistry.cpp') diff --git a/src/text-chemistry.cpp b/src/text-chemistry.cpp index 61ae2466b..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" @@ -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); } @@ -217,7 +217,7 @@ text_remove_from_path() if (!did) { desktop->getMessageStack()->flash(Inkscape::ERROR_MESSAGE, _("No texts-on-paths 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 } @@ -282,7 +282,7 @@ text_remove_all_kerns() if (!did) { desktop->getMessageStack()->flash(Inkscape::ERROR_MESSAGE, _("Select text(s) 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,7 +294,7 @@ 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 = desktop->getSelection(); @@ -388,7 +388,7 @@ 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 = desktop->getSelection(); @@ -512,7 +512,7 @@ flowtext_to_text() Inkscape::XML::Node *parent = item->getRepr()->parent(); parent->addChild(repr, item->getRepr()); - SPItem *new_item = reinterpret_cast(sp_desktop_document(desktop)->getObjectByRepr(repr)); + SPItem *new_item = reinterpret_cast(desktop->getDocument()->getObjectByRepr(repr)); new_item->doWriteTransform(repr, item->transform); new_item->updateRepr(); @@ -525,7 +525,7 @@ 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); -- cgit v1.2.3