summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-08-01 11:04:34 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-08-01 20:06:40 +0200
commit303aa36685f2d52cff6004f9b41b90629c26f978 (patch)
treec41cdd5452239b623def7a7a994c65895861c357
parent5678db6ff2d8d1e1bc73972b8af8e6d063d499ad (diff)
unordered_map is better for pointer keys
Change-Id: Iaef42c9cc3526d1daa9ad6aaa840ea5a449173be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119816 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--xmloff/source/forms/layerexport.hxx8
-rw-r--r--xmloff/source/forms/layerimport.hxx3
2 files changed, 6 insertions, 5 deletions
diff --git a/xmloff/source/forms/layerexport.hxx b/xmloff/source/forms/layerexport.hxx
index 39e6b5667c0f..4d19386efa13 100644
--- a/xmloff/source/forms/layerexport.hxx
+++ b/xmloff/source/forms/layerexport.hxx
@@ -21,7 +21,7 @@
#include <sal/config.h>
-#include <map>
+#include <unordered_map>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/drawing/XDrawPage.hpp>
@@ -43,12 +43,12 @@ namespace xmloff
typedef o3tl::sorted_vector< css::uno::Reference< css::beans::XPropertySet > > PropertySetBag;
// maps objects (property sets) to strings, e.g. control ids.
- typedef ::std::map < css::uno::Reference< css::beans::XPropertySet >
+ typedef ::std::unordered_map < css::uno::Reference< css::beans::XPropertySet >
, OUString
> MapPropertySet2String;
// map pages to maps (of property sets to strings)
- typedef ::std::map < css::uno::Reference< css::drawing::XDrawPage >
+ typedef ::std::unordered_map < css::uno::Reference< css::drawing::XDrawPage >
, MapPropertySet2String
> MapPropertySet2Map;
@@ -106,7 +106,7 @@ namespace xmloff
// TODO: To avoid this construct above, and to have a cleaner implementation, a class encapsulating the
// export of a single page should be introduced.
- typedef std::map<css::uno::Reference<css::beans::XPropertySet>, sal_Int32> MapPropertySet2Int;
+ typedef std::unordered_map<css::uno::Reference<css::beans::XPropertySet>, sal_Int32> MapPropertySet2Int;
MapPropertySet2Int m_aControlNumberFormats;
// maps controls to format keys, which are relative to our own formats supplier
diff --git a/xmloff/source/forms/layerimport.hxx b/xmloff/source/forms/layerimport.hxx
index 448076ec8b4f..21e3a79c723b 100644
--- a/xmloff/source/forms/layerimport.hxx
+++ b/xmloff/source/forms/layerimport.hxx
@@ -22,6 +22,7 @@
#include <sal/config.h>
#include <map>
+#include <unordered_map>
#include <com/sun/star/xml/sax/XAttributeList.hpp>
#include <com/sun/star/drawing/XDrawPage.hpp>
@@ -58,7 +59,7 @@ namespace xmloff
rtl::Reference<SvXMLStylesContext> m_xAutoStyles;
typedef std::map< OUString, css::uno::Reference< css::beans::XPropertySet > > MapString2PropertySet;
- typedef std::map<css::uno::Reference<css::drawing::XDrawPage>, MapString2PropertySet> MapDrawPage2Map;
+ typedef std::unordered_map<css::uno::Reference<css::drawing::XDrawPage>, MapString2PropertySet> MapDrawPage2Map;
MapDrawPage2Map m_aControlIds; // ids of the controls on all known page
MapDrawPage2Map::iterator m_aCurrentPageIds; // ifs of the controls on the current page