diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2016-10-13 21:20:36 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2016-10-13 21:53:06 +0200 |
commit | 0cd2250b7c3e0cfed297590f0cb07dab4c8df1d4 (patch) | |
tree | 892b93ac13da371e0b4cd0ff9573b9efb02fb50d /vcl/source | |
parent | 08d7ffcd442c5f02b4ceb068d308a26b04e41d29 (diff) |
Add IsExperimental method to CommandInfoProvider
Change-Id: I827ae6db25a1df9f25b58ca122e39dc9cb4b0652
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/helper/commandinfoprovider.cxx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/vcl/source/helper/commandinfoprovider.cxx b/vcl/source/helper/commandinfoprovider.cxx index 3b0cc18131a8..6cd7bb103787 100644 --- a/vcl/source/helper/commandinfoprovider.cxx +++ b/vcl/source/helper/commandinfoprovider.cxx @@ -300,6 +300,36 @@ bool CommandInfoProvider::IsMirrored(const OUString& rsCommandName) return ResourceHasKey("private:resource/image/commandmirrorimagelist", rsCommandName); } +bool CommandInfoProvider::IsExperimental(const OUString& rsCommandName, + const OUString& rModuleName) +{ + Sequence<beans::PropertyValue> aProperties; + try + { + if( rModuleName.getLength() > 0) + { + Reference<container::XNameAccess> xNameAccess = frame::theUICommandDescription::get(mxContext); + Reference<container::XNameAccess> xUICommandLabels; + if (xNameAccess->getByName( rModuleName ) >>= xUICommandLabels ) + xUICommandLabels->getByName(rsCommandName) >>= aProperties; + + for (sal_Int32 nIndex=0; nIndex<aProperties.getLength(); ++nIndex) + { + if (aProperties[nIndex].Name == "IsExperimental") + { + sal_Int32 nValue; + aProperties[nIndex].Value >>= nValue; + return nValue == 1; + } + } + } + } + catch (Exception&) + { + } + return false; +} + void CommandInfoProvider::SetFrame (const Reference<frame::XFrame>& rxFrame) { if (rxFrame != mxCachedDataFrame) |