summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-11-05 12:21:29 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-11-06 09:25:10 +0100
commitbd8539dfd1025dccac1f919ad698249379e036da (patch)
tree9ba12a379b1df7cc3ee2180be35474c392829c13 /include
parent34099cedc55d94616560895bcb21232d93b84c24 (diff)
add an EMPTY_OUSTRING in OUString header
we already declare the same thing in various places, and I intend to be using this some more, so it makes sense to only declare it in one place Change-Id: Ifea6b589e992dd9f6cd8f2301f837e71397481c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176046 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r--include/rtl/ustring.hxx10
-rw-r--r--include/xmloff/maptype.hxx4
2 files changed, 11 insertions, 3 deletions
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx
index 8272cdb22c55..b03978c7d625 100644
--- a/include/rtl/ustring.hxx
+++ b/include/rtl/ustring.hxx
@@ -3987,6 +3987,16 @@ struct hash<::rtl::OUString>
}
+#if !(defined _MSC_VER && _MSC_VER <= 1929 && defined _MANAGED)
+/**
+ * static empty string object, handy for returning from functions where the function is
+ * returning a "const OUString &"
+ *
+ * @since LibreOffice 25.2
+ */
+static inline constexpr ::rtl::OUString EMPTY_OUSTRING = u""_ustr;
+#endif
+
#endif
/// @endcond
diff --git a/include/xmloff/maptype.hxx b/include/xmloff/maptype.hxx
index f15ef3d38002..704c0ae0783d 100644
--- a/include/xmloff/maptype.hxx
+++ b/include/xmloff/maptype.hxx
@@ -99,8 +99,6 @@ struct XMLPropertyMapEntry
*/
bool mbImportOnly;
- static constexpr OUString EMPTY{u""_ustr};
-
constexpr XMLPropertyMapEntry(
const OUString& sApiName,
sal_uInt16 nNameSpace,
@@ -119,7 +117,7 @@ struct XMLPropertyMapEntry
/// used to mark the end of the array
constexpr XMLPropertyMapEntry(std::nullptr_t)
:
- msApiName(EMPTY),
+ msApiName(EMPTY_OUSTRING),
meXMLName(xmloff::token::XML_TOKEN_INVALID), mnNameSpace(0), mnType(0),
mnContextId(0), mnEarliestODFVersionForExport(SvtSaveOptions::ODFSVER_010),
mbImportOnly(false)