summaryrefslogtreecommitdiffstats
path: root/src/ui/tools/text-tool.cpp
diff options
context:
space:
mode:
authorLiam P. White <inkscapebrony@gmail.com>2014-12-21 21:58:32 +0000
committerLiam P. White <inkscapebrony@gmail.com>2014-12-21 21:58:32 +0000
commit3dbf9a08680c6d7252c79397dbf12082ead61bd7 (patch)
tree565cc1093ba3ec7110971e641d2f1c94b77c45a0 /src/ui/tools/text-tool.cpp
parentPurge sp_desktop_controls (diff)
downloadinkscape-3dbf9a08680c6d7252c79397dbf12082ead61bd7.tar.gz
inkscape-3dbf9a08680c6d7252c79397dbf12082ead61bd7.zip
Remove sp_desktop_document and finish cleanup of desktop-handles.h
(bzr r13820)
Diffstat (limited to 'src/ui/tools/text-tool.cpp')
-rw-r--r--src/ui/tools/text-tool.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/ui/tools/text-tool.cpp b/src/ui/tools/text-tool.cpp
index e6dde0581..df0583d67 100644
--- a/src/ui/tools/text-tool.cpp
+++ b/src/ui/tools/text-tool.cpp
@@ -26,7 +26,7 @@
#include <sstream>
#include "context-fns.h"
-#include "desktop-handles.h"
+
#include "desktop-style.h"
#include "desktop.h"
#include "document.h"
@@ -431,7 +431,7 @@ static void sp_text_context_setup_text(TextTool *tc)
text_item->updateRepr();
text_item->doWriteTransform(text_item->getRepr(), text_item->transform, NULL, true);
- DocumentUndo::done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT,
+ DocumentUndo::done(ec->desktop->getDocument(), SP_VERB_CONTEXT_TEXT,
_("Create text"));
}
@@ -471,7 +471,7 @@ static void insert_uni_char(TextTool *const tc)
tc->text_sel_start = tc->text_sel_end = sp_te_replace(tc->text, tc->text_sel_start, tc->text_sel_end, u);
sp_text_context_update_cursor(tc);
sp_text_context_update_text_selection(tc);
- DocumentUndo::done(sp_desktop_document(tc->desktop), SP_VERB_DIALOG_TRANSFORM,
+ DocumentUndo::done(tc->desktop->getDocument(), SP_VERB_DIALOG_TRANSFORM,
_("Insert Unicode character"));
}
}
@@ -662,7 +662,7 @@ bool TextTool::root_handler(GdkEvent* event) {
sp_desktop_apply_style_tool(desktop, ft->getRepr(), "/tools/text", true);
desktop->getSelection()->set(ft);
desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Flowed text is created."));
- DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, _("Create flowed text"));
+ DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_TEXT, _("Create flowed text"));
} else {
desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("The frame is <b>too small</b> for the current font size. Flowed text not created."));
}
@@ -801,7 +801,7 @@ bool TextTool::root_handler(GdkEvent* event) {
sp_text_context_update_cursor(this);
sp_text_context_update_text_selection(this);
desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("No-break space"));
- DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, _("Insert no-break space"));
+ DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_TEXT, _("Insert no-break space"));
return TRUE;
}
break;
@@ -837,7 +837,7 @@ bool TextTool::root_handler(GdkEvent* event) {
sp_repr_css_set_property(css, "font-weight", "normal");
sp_te_apply_style(this->text, this->text_sel_start, this->text_sel_end, css);
sp_repr_css_attr_unref(css);
- DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, _("Make bold"));
+ DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_TEXT, _("Make bold"));
sp_text_context_update_cursor(this);
sp_text_context_update_text_selection(this);
return TRUE;
@@ -854,7 +854,7 @@ bool TextTool::root_handler(GdkEvent* event) {
sp_repr_css_set_property(css, "font-style", "italic");
sp_te_apply_style(this->text, this->text_sel_start, this->text_sel_end, css);
sp_repr_css_attr_unref(css);
- DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, _("Make italic"));
+ DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_TEXT, _("Make italic"));
sp_text_context_update_cursor(this);
sp_text_context_update_text_selection(this);
return TRUE;
@@ -892,7 +892,7 @@ bool TextTool::root_handler(GdkEvent* event) {
sp_text_context_update_cursor(this);
sp_text_context_update_text_selection(this);
- DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, _("New line"));
+ DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_TEXT, _("New line"));
return TRUE;
}
case GDK_KEY_BackSpace:
@@ -933,7 +933,7 @@ bool TextTool::root_handler(GdkEvent* event) {
sp_text_context_update_cursor(this);
sp_text_context_update_text_selection(this);
- DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, _("Backspace"));
+ DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_TEXT, _("Backspace"));
}
return TRUE;
case GDK_KEY_Delete:
@@ -971,7 +971,7 @@ bool TextTool::root_handler(GdkEvent* event) {
sp_text_context_update_cursor(this);
sp_text_context_update_text_selection(this);
- DocumentUndo::done(sp_desktop_document(desktop), SP_VERB_CONTEXT_TEXT, _("Delete"));
+ DocumentUndo::done(desktop->getDocument(), SP_VERB_CONTEXT_TEXT, _("Delete"));
}
return TRUE;
case GDK_KEY_Left:
@@ -987,7 +987,7 @@ bool TextTool::root_handler(GdkEvent* event) {
sp_te_adjust_kerning_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, Geom::Point(mul*-1, 0));
sp_text_context_update_cursor(this);
sp_text_context_update_text_selection(this);
- DocumentUndo::maybeDone(sp_desktop_document(desktop), "kern:left", SP_VERB_CONTEXT_TEXT, _("Kern to the left"));
+ DocumentUndo::maybeDone(desktop->getDocument(), "kern:left", SP_VERB_CONTEXT_TEXT, _("Kern to the left"));
} else {
if (MOD__CTRL(event))
this->text_sel_end.cursorLeftWithControl();
@@ -1011,7 +1011,7 @@ bool TextTool::root_handler(GdkEvent* event) {
sp_te_adjust_kerning_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, Geom::Point(mul*1, 0));
sp_text_context_update_cursor(this);
sp_text_context_update_text_selection(this);
- DocumentUndo::maybeDone(sp_desktop_document(desktop), "kern:right", SP_VERB_CONTEXT_TEXT, _("Kern to the right"));
+ DocumentUndo::maybeDone(desktop->getDocument(), "kern:right", SP_VERB_CONTEXT_TEXT, _("Kern to the right"));
} else {
if (MOD__CTRL(event))
this->text_sel_end.cursorRightWithControl();
@@ -1035,7 +1035,7 @@ bool TextTool::root_handler(GdkEvent* event) {
sp_te_adjust_kerning_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, Geom::Point(0, mul*-1));
sp_text_context_update_cursor(this);
sp_text_context_update_text_selection(this);
- DocumentUndo::maybeDone(sp_desktop_document(desktop), "kern:up", SP_VERB_CONTEXT_TEXT, _("Kern up"));
+ DocumentUndo::maybeDone(desktop->getDocument(), "kern:up", SP_VERB_CONTEXT_TEXT, _("Kern up"));
} else {
if (MOD__CTRL(event))
this->text_sel_end.cursorUpWithControl();
@@ -1059,7 +1059,7 @@ bool TextTool::root_handler(GdkEvent* event) {
sp_te_adjust_kerning_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, Geom::Point(0, mul*1));
sp_text_context_update_cursor(this);
sp_text_context_update_text_selection(this);
- DocumentUndo::maybeDone(sp_desktop_document(desktop), "kern:down", SP_VERB_CONTEXT_TEXT, _("Kern down"));
+ DocumentUndo::maybeDone(desktop->getDocument(), "kern:down", SP_VERB_CONTEXT_TEXT, _("Kern down"));
} else {
if (MOD__CTRL(event))
this->text_sel_end.cursorDownWithControl();
@@ -1134,7 +1134,7 @@ bool TextTool::root_handler(GdkEvent* event) {
} else {
sp_te_adjust_rotation(this->text, this->text_sel_start, this->text_sel_end, desktop, -90);
}
- DocumentUndo::maybeDone(sp_desktop_document(desktop), "textrot:ccw", SP_VERB_CONTEXT_TEXT, _("Rotate counterclockwise"));
+ DocumentUndo::maybeDone(desktop->getDocument(), "textrot:ccw", SP_VERB_CONTEXT_TEXT, _("Rotate counterclockwise"));
sp_text_context_update_cursor(this);
sp_text_context_update_text_selection(this);
return TRUE;
@@ -1154,7 +1154,7 @@ bool TextTool::root_handler(GdkEvent* event) {
} else {
sp_te_adjust_rotation(this->text, this->text_sel_start, this->text_sel_end, desktop, 90);
}
- DocumentUndo::maybeDone(sp_desktop_document(desktop), "textrot:cw", SP_VERB_CONTEXT_TEXT, _("Rotate clockwise"));
+ DocumentUndo::maybeDone(desktop->getDocument(), "textrot:cw", SP_VERB_CONTEXT_TEXT, _("Rotate clockwise"));
sp_text_context_update_cursor(this);
sp_text_context_update_text_selection(this);
return TRUE;
@@ -1170,13 +1170,13 @@ bool TextTool::root_handler(GdkEvent* event) {
sp_te_adjust_linespacing_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, -10);
else
sp_te_adjust_linespacing_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, -1);
- DocumentUndo::maybeDone(sp_desktop_document(desktop), "linespacing:dec", SP_VERB_CONTEXT_TEXT, _("Contract line spacing"));
+ DocumentUndo::maybeDone(desktop->getDocument(), "linespacing:dec", SP_VERB_CONTEXT_TEXT, _("Contract line spacing"));
} else {
if (MOD__SHIFT(event))
sp_te_adjust_tspan_letterspacing_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, -10);
else
sp_te_adjust_tspan_letterspacing_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, -1);
- DocumentUndo::maybeDone(sp_desktop_document(desktop), "letterspacing:dec", SP_VERB_CONTEXT_TEXT, _("Contract letter spacing"));
+ DocumentUndo::maybeDone(desktop->getDocument(), "letterspacing:dec", SP_VERB_CONTEXT_TEXT, _("Contract letter spacing"));
}
sp_text_context_update_cursor(this);
sp_text_context_update_text_selection(this);
@@ -1193,13 +1193,13 @@ bool TextTool::root_handler(GdkEvent* event) {
sp_te_adjust_linespacing_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, 10);
else
sp_te_adjust_linespacing_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, 1);
- DocumentUndo::maybeDone(sp_desktop_document(desktop), "linespacing:inc", SP_VERB_CONTEXT_TEXT, _("Expand line spacing"));
+ DocumentUndo::maybeDone(desktop->getDocument(), "linespacing:inc", SP_VERB_CONTEXT_TEXT, _("Expand line spacing"));
} else {
if (MOD__SHIFT(event))
sp_te_adjust_tspan_letterspacing_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, 10);
else
sp_te_adjust_tspan_letterspacing_screen(this->text, this->text_sel_start, this->text_sel_end, desktop, 1);
- DocumentUndo::maybeDone(sp_desktop_document(desktop), "letterspacing:inc", SP_VERB_CONTEXT_TEXT, _("Expand letter spacing"));\
+ DocumentUndo::maybeDone(desktop->getDocument(), "letterspacing:inc", SP_VERB_CONTEXT_TEXT, _("Expand letter spacing"));\
}
sp_text_context_update_cursor(this);
sp_text_context_update_text_selection(this);
@@ -1328,7 +1328,7 @@ bool sp_text_paste_inline(ToolBase *ec)
tc->text_sel_start = tc->text_sel_end = sp_te_insert_line(tc->text, tc->text_sel_start);
begin = end + 1;
}
- DocumentUndo::done(sp_desktop_document(ec->desktop), SP_VERB_CONTEXT_TEXT,
+ DocumentUndo::done(ec->desktop->getDocument(), SP_VERB_CONTEXT_TEXT,
_("Paste text"));
return true;
@@ -1451,7 +1451,7 @@ bool TextTool::_styleSet(SPCSSAttr const *css)
return false; // will get picked up by the parent and applied to the whole text object
sp_te_apply_style(this->text, this->text_sel_start, this->text_sel_end, css);
- DocumentUndo::done(sp_desktop_document(this->desktop), SP_VERB_CONTEXT_TEXT,
+ DocumentUndo::done(this->desktop->getDocument(), SP_VERB_CONTEXT_TEXT,
_("Set text style"));
sp_text_context_update_cursor(this);
sp_text_context_update_text_selection(this);
@@ -1661,7 +1661,7 @@ static void sp_text_context_forget_text(TextTool *tc)
// the XML editor
if ( text_repr && text_repr->parent() ) {
sp_repr_unparent(text_repr);
- SPDocumentUndo::done(sp_desktop_document(tc->desktop), SP_VERB_CONTEXT_TEXT,
+ SPDocumentUndo::done(tc->desktop->getDocument(), SP_VERB_CONTEXT_TEXT,
_("Remove empty text"));
}
}