From 791af4d0deaf3da6360107ffee4cde1862a3d8c1 Mon Sep 17 00:00:00 2001 From: dooglus Date: Tue, 15 Jan 2008 14:47:17 +0000 Subject: [PATCH] Add Layer::get_param_local_name() to allow us to report the local name of layer parameters in the History dialog. git-svn-id: http://svn.voria.com/code@1367 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-core/trunk/src/synfig/layer.cpp | 11 +++++++++++ synfig-core/trunk/src/synfig/layer.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/synfig-core/trunk/src/synfig/layer.cpp b/synfig-core/trunk/src/synfig/layer.cpp index 18a3317..bc65a6d 100644 --- a/synfig-core/trunk/src/synfig/layer.cpp +++ b/synfig-core/trunk/src/synfig/layer.cpp @@ -567,3 +567,14 @@ Layer::get_group()const { return group_; } + +const String +Layer::get_param_local_name(const String ¶m_name)const +{ + ParamVocab vocab = get_param_vocab(); + // loop to find the parameter in the parameter vocab - this gives us its local name + for (ParamVocab::iterator iter = vocab.begin(); iter != vocab.end(); iter++) + if (iter->get_name() == param_name) + return iter->get_local_name(); + return String(); +} diff --git a/synfig-core/trunk/src/synfig/layer.h b/synfig-core/trunk/src/synfig/layer.h index 7971fcb..fa7b3b7 100644 --- a/synfig-core/trunk/src/synfig/layer.h +++ b/synfig-core/trunk/src/synfig/layer.h @@ -325,6 +325,9 @@ public: //! Returns the layer's description if it's not empty, else its local name const String get_non_empty_description()const { return get_description().empty() ? get_local_name() : get_description(); } + //! Returns the localised version of the given layer parameter + const String get_param_local_name(const String ¶m_name)const; + /* -- ** -- V I R T U A L F U N C T I O N S ----------------------------------- */ -- 2.7.4