framework/source/uiconfiguration/imagemanagerimpl.cxx | 11 ++++++----- framework/source/uiconfiguration/imagemanagerimpl.hxx | 5 ----- 2 files changed, 6 insertions(+), 10 deletions(-)
New commits: commit 07af6b1c386b90e50c1aae0f7dd67af3173ffadb Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Fri May 12 22:17:27 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat May 13 14:56:16 2023 +0200 simplify no need to use a map here, a set will do Change-Id: I8e8b35f390ffba5b7da6caa52eb3e33d3b50d354 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151723 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/framework/source/uiconfiguration/imagemanagerimpl.cxx b/framework/source/uiconfiguration/imagemanagerimpl.cxx index 0152387cc0b4..8bc322ff6667 100644 --- a/framework/source/uiconfiguration/imagemanagerimpl.cxx +++ b/framework/source/uiconfiguration/imagemanagerimpl.cxx @@ -45,6 +45,7 @@ #include <vcl/filter/PngImageReader.hxx> #include <vcl/filter/PngImageWriter.hxx> #include <memory> +#include <unordered_set> using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::XInterface; @@ -627,7 +628,7 @@ Sequence< OUString > ImageManagerImpl::getAllImageNames( ::sal_Int16 nImageType if ( m_bDisposed ) throw DisposedException(); - ImageNameMap aImageCmdNameMap; + std::unordered_set< OUString > aImageCmdNames; vcl::ImageType nIndex = implts_convertImageTypeToIndex( nImageType ); @@ -639,12 +640,12 @@ Sequence< OUString > ImageManagerImpl::getAllImageNames( ::sal_Int16 nImageType const std::vector< OUString >& rGlobalImageNameVector = rGlobalImageList->getImageCommandNames(); const sal_uInt32 nGlobalCount = rGlobalImageNameVector.size(); for ( i = 0; i < nGlobalCount; i++ ) - aImageCmdNameMap.emplace( rGlobalImageNameVector[i], true ); + aImageCmdNames.insert( rGlobalImageNameVector[i] ); const std::vector< OUString >& rModuleImageNameVector = implts_getDefaultImageList()->getImageCommandNames(); const sal_uInt32 nModuleCount = rModuleImageNameVector.size(); for ( i = 0; i < nModuleCount; i++ ) - aImageCmdNameMap.emplace( rModuleImageNameVector[i], true ); + aImageCmdNames.insert( rModuleImageNameVector[i] ); } ImageList* pImageList = implts_getUserImageList(nIndex); @@ -652,9 +653,9 @@ Sequence< OUString > ImageManagerImpl::getAllImageNames( ::sal_Int16 nImageType pImageList->GetImageNames( rUserImageNames ); const sal_uInt32 nUserCount = rUserImageNames.size(); for ( i = 0; i < nUserCount; i++ ) - aImageCmdNameMap.emplace( rUserImageNames[i], true ); + aImageCmdNames.insert( rUserImageNames[i] ); - return comphelper::mapKeysToSequence( aImageCmdNameMap ); + return comphelper::containerToSequence( aImageCmdNames ); } bool ImageManagerImpl::hasImage( ::sal_Int16 nImageType, const OUString& aCommandURL ) diff --git a/framework/source/uiconfiguration/imagemanagerimpl.hxx b/framework/source/uiconfiguration/imagemanagerimpl.hxx index f36c9fff74c7..4d48da1c2312 100644 --- a/framework/source/uiconfiguration/imagemanagerimpl.hxx +++ b/framework/source/uiconfiguration/imagemanagerimpl.hxx @@ -137,9 +137,6 @@ namespace framework void clear(); - typedef std::unordered_map< OUString, - sal_Bool > ImageNameMap; - enum NotifyOp { NotifyOp_Remove, @@ -147,8 +144,6 @@ namespace framework NotifyOp_Replace }; - typedef ::std::vector< css::ui::ConfigurationEvent > ConfigEventNotifyContainer; - void implts_initialize(); void implts_notifyContainerListener( const css::ui::ConfigurationEvent& aEvent, NotifyOp eOp ); ImageList* implts_getUserImageList( vcl::ImageType nImageType );