From 7531449fc6f5c3113802747db11a2bca2e308555 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Wed, 30 Jan 2019 15:54:01 +0100 Subject: Allow InkscapeApplication to track current document, selection, and desktop. --- src/helper/action-context.cpp | 5 ----- src/helper/action-context.h | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) (limited to 'src/helper') diff --git a/src/helper/action-context.cpp b/src/helper/action-context.cpp index 648101540..36b6914d6 100644 --- a/src/helper/action-context.cpp +++ b/src/helper/action-context.cpp @@ -62,11 +62,6 @@ UI::View::View *ActionContext::getView() const SPDesktop *ActionContext::getDesktop() const { - // TODO: this slightly horrible storage of a UI::View::View*, and - // casting to an SPDesktop*, is only done because that's what was - // already the norm in the Inkscape codebase. This seems wrong. Surely - // we should store an SPDesktop* in the first place? Is there a case - // of actions being carried out on a View that is not an SPDesktop? return static_cast(_view); } diff --git a/src/helper/action-context.h b/src/helper/action-context.h index 2660bc59c..d3468ea3e 100644 --- a/src/helper/action-context.h +++ b/src/helper/action-context.h @@ -37,7 +37,7 @@ class View; used to take as parameters in their methods. Why is this? They almost always seemed to cast straight to an SPDesktop* - so shouldn't we actually be storing an SPDesktop*? Is there a case where a non-SPDesktop - UI::View::View is used by the actions? + UI::View::View is used by the actions? YES: Command-line wihtout GUI. ActionContext is designed to be copyable, so it may be used with stack storage if required. */ -- cgit v1.2.3