From: dooglus Date: Tue, 19 Feb 2008 15:34:31 +0000 (+0000) Subject: The "warning: Can't get canvas from value desc...?" message was being shown too often... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=02cfddccc7d785b16927119f05c5f2db84e96424;p=synfig.git The "warning: Can't get canvas from value desc...?" message was being shown too often. Fixed it. git-svn-id: http://svn.voria.com/code@1759 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp b/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp index c062522..8bf6e89 100644 --- a/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp +++ b/synfig-studio/trunk/src/synfigapp/canvasinterface.cpp @@ -749,19 +749,22 @@ CanvasInterface::change_value(synfigapp::ValueDesc value_desc,synfig::ValueBase return true; // If this change needs to take place elsewhere, then so be it. - if(value_desc.get_canvas() && value_desc.get_canvas()->get_root()!=get_canvas()->get_root())do + if(value_desc.get_canvas()) { - etl::handle instance; - instance=find_instance(value_desc.get_canvas()->get_root()); - - if(instance) - return instance->find_canvas_interface(value_desc.get_canvas())->change_value(value_desc,new_value); - else + if (value_desc.get_canvas()->get_root() != get_canvas()->get_root()) { - get_ui_interface()->error(_("The value you are trying to edit is in a composition\nwhich doesn't seem to be open. Open that composition and you\nshould be able to edit this value as normal.")); - return false; + etl::handle instance; + instance=find_instance(value_desc.get_canvas()->get_root()); + + if(instance) + return instance->find_canvas_interface(value_desc.get_canvas())->change_value(value_desc,new_value); + else + { + get_ui_interface()->error(_("The value you are trying to edit is in a composition\nwhich doesn't seem to be open. Open that composition and you\nshould be able to edit this value as normal.")); + return false; + } } - }while(0); + } #ifdef _DEBUG else { synfig::warning("Can't get canvas from value desc...?"); }