summaryrefslogtreecommitdiff
path: root/framework/source
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2023-05-12 22:17:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-05-13 14:56:16 +0200
commit07af6b1c386b90e50c1aae0f7dd67af3173ffadb (patch)
tree81ce141aa141c6ca17f515a7d35955a466136a68 /framework/source
parent5dc82f62d54fbd6299b4a1dc677e714e92f2f88c (diff)
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.grandin@collabora.co.uk>
Diffstat (limited to 'framework/source')
-rw-r--r--framework/source/uiconfiguration/imagemanagerimpl.cxx11
-rw-r--r--framework/source/uiconfiguration/imagemanagerimpl.hxx5
2 files changed, 6 insertions, 10 deletions
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 );