summaryrefslogtreecommitdiff
path: root/include/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-11-12 10:07:18 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-11-12 10:55:07 +0100
commit5fe5ded723b2bea0c88ebc7647284dc0ade97ee3 (patch)
tree006c7463f5140200e867b5858dde385df38d0e9c /include/xmloff
parent6bd74e49f8a99f14a7d8bdc005e2fd50e773841b (diff)
simplify construction of XMLPropertyMapEntry
so we don't have to pass in the size of the string literal. This is mostly a preparatory change, to make an another patch of mine less noisy. Change-Id: Idafcd68586b8b465e63dc89e4a4180d2e70ac3a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125080 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/xmloff')
-rw-r--r--include/xmloff/maptype.hxx23
1 files changed, 20 insertions, 3 deletions
diff --git a/include/xmloff/maptype.hxx b/include/xmloff/maptype.hxx
index dbde180797cf..a4b105b6530e 100644
--- a/include/xmloff/maptype.hxx
+++ b/include/xmloff/maptype.hxx
@@ -99,16 +99,33 @@ struct XMLPropertyMapEntry
*/
bool mbImportOnly;
+ template< std::size_t N >
XMLPropertyMapEntry(
- const char* sApiName,
- sal_Int32 nApiNameLength_,
+ const char (&sApiName)[N],
sal_uInt16 nNameSpace,
enum ::xmloff::token::XMLTokenEnum eXMLName,
sal_uInt32 nType,
sal_Int16 nContextId,
SvtSaveOptions::ODFSaneDefaultVersion nEarliestODFVersionForExport,
bool bImportOnly)
- : msApiName(sApiName), nApiNameLength(nApiNameLength_),
+ :
+ msApiName(sApiName),
+ nApiNameLength(N-1),
+ meXMLName(eXMLName), mnNameSpace(nNameSpace), mnType(nType),
+ mnContextId(nContextId), mnEarliestODFVersionForExport(nEarliestODFVersionForExport),
+ mbImportOnly(bImportOnly)
+ {}
+ XMLPropertyMapEntry(
+ std::nullptr_t ,
+ sal_uInt16 nNameSpace,
+ enum ::xmloff::token::XMLTokenEnum eXMLName,
+ sal_uInt32 nType,
+ sal_Int16 nContextId,
+ SvtSaveOptions::ODFSaneDefaultVersion nEarliestODFVersionForExport,
+ bool bImportOnly)
+ :
+ msApiName(nullptr),
+ nApiNameLength(0),
meXMLName(eXMLName), mnNameSpace(nNameSpace), mnType(nType),
mnContextId(nContextId), mnEarliestODFVersionForExport(nEarliestODFVersionForExport),
mbImportOnly(bImportOnly)