summaryrefslogtreecommitdiff
path: root/include/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-05-24 13:12:24 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-24 16:37:43 +0200
commita86818c15a6b4773ddd012db37d55b5204163c24 (patch)
tree37f26fb269414f902fb99986da4de4b712484d7c /include/xmloff
parente4977792c501305502100c0d45b5ca605981008f (diff)
reduce space needed for NameSpaceMap
no need to store the key twice. Also rename related fields and typedefs to make the code easier to read. Change-Id: Ib76dea7fd683d024e8c9d8091d85cfec14829359 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134871 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/xmloff')
-rw-r--r--include/xmloff/namespacemap.hxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/include/xmloff/namespacemap.hxx b/include/xmloff/namespacemap.hxx
index 81edfc52e25d..51e741fb85d8 100644
--- a/include/xmloff/namespacemap.hxx
+++ b/include/xmloff/namespacemap.hxx
@@ -54,6 +54,15 @@ public:
}
};
+class KeyToNameSpaceMapEntry final
+{
+public:
+ // sName refers to the full namespace name
+ OUString sName;
+ // sPrefix is the prefix used to declare a given item to be from a given namespace
+ OUString sPrefix;
+};
+
typedef ::std::pair < sal_uInt16, OUString > QNamePair;
struct QNamePairHash
@@ -69,7 +78,7 @@ struct QNamePairHash
typedef std::unordered_map < QNamePair, OUString, QNamePairHash > QNameCache;
typedef std::unordered_map < OUString, NameSpaceEntry > NameSpaceHash;
-typedef std::unordered_map < sal_uInt16, NameSpaceEntry > NameSpaceMap;
+typedef std::unordered_map < sal_uInt16, KeyToNameSpaceMapEntry > KeyToNameSpaceMap;
class XMLOFF_DLLPUBLIC SvXMLNamespaceMap
{
@@ -77,7 +86,7 @@ class XMLOFF_DLLPUBLIC SvXMLNamespaceMap
NameSpaceHash aNameHash;
mutable NameSpaceHash aNameCache;
- NameSpaceMap aNameMap;
+ KeyToNameSpaceMap maKeyToNamespaceMap;
mutable QNameCache aQNameCache;
SAL_DLLPRIVATE sal_uInt16 Add_( const OUString& rPrefix, const OUString &rName, sal_uInt16 nKey );