diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2015-12-04 17:05:11 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2015-12-08 08:39:44 +0000 |
commit | ac97f32307feb488c86d6fa962258fe79320d31b (patch) | |
tree | baaf15380630c4dbeeea827fb6ab004193bb5ac0 /vcl/source/helper | |
parent | e4d5b5efac71ed2a08dcd09877078a6cf6bde0d2 (diff) |
Move icon rotation/flip handling from ToolbarManager to vcl's Toolbar
This enables rotatad/flipped icons in the Sidebar and other non-toolbar places (tdf#85767)
Change-Id: I034394ae6f9b8d91ef5a376a43eda587098f064e
Reviewed-on: https://gerrit.libreoffice.org/20403
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'vcl/source/helper')
-rw-r--r-- | vcl/source/helper/commandinfoprovider.cxx | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/vcl/source/helper/commandinfoprovider.cxx b/vcl/source/helper/commandinfoprovider.cxx index fcc8aecb9764..95f252a2f1da 100644 --- a/vcl/source/helper/commandinfoprovider.cxx +++ b/vcl/source/helper/commandinfoprovider.cxx @@ -276,6 +276,16 @@ sal_Int32 CommandInfoProvider::GetPropertiesForCommand ( return nValue; } +bool CommandInfoProvider::IsRotated(const OUString& rsCommandName) +{ + return ResourceHasKey("private:resource/image/commandrotateimagelist", rsCommandName); +} + +bool CommandInfoProvider::IsMirrored(const OUString& rsCommandName) +{ + return ResourceHasKey("private:resource/image/commandmirrorimagelist", rsCommandName); +} + void CommandInfoProvider::SetFrame (const Reference<frame::XFrame>& rxFrame) { if (rxFrame != mxCachedDataFrame) @@ -399,6 +409,32 @@ OUString CommandInfoProvider::RetrieveShortcutsFromConfiguration( return OUString(); } +bool CommandInfoProvider::ResourceHasKey(const OUString& rsResourceName, const OUString& rsCommandName) +{ + Sequence< OUString > aSequence; + try + { + const OUString sModuleIdentifier (GetModuleIdentifier()); + if (!sModuleIdentifier.isEmpty()) + { + Reference<container::XNameAccess> xNameAccess = frame::theUICommandDescription::get(mxContext); + Reference<container::XNameAccess> xUICommandLabels; + if (xNameAccess->getByName(sModuleIdentifier) >>= xUICommandLabels) { + xUICommandLabels->getByName(rsResourceName) >>= aSequence; + for ( sal_Int32 i = 0; i < aSequence.getLength(); i++ ) + { + if (aSequence[i] == rsCommandName) + return true; + } + } + } + } + catch (Exception&) + { + } + return false; +} + Sequence<beans::PropertyValue> CommandInfoProvider::GetCommandProperties(const OUString& rsCommandName) { Sequence<beans::PropertyValue> aProperties; |