summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configmgr/source/writemodfile.cxx10
-rw-r--r--include/rtl/stringconcat.hxx3
2 files changed, 8 insertions, 5 deletions
diff --git a/configmgr/source/writemodfile.cxx b/configmgr/source/writemodfile.cxx
index d7fba8264b80..017e925dee48 100644
--- a/configmgr/source/writemodfile.cxx
+++ b/configmgr/source/writemodfile.cxx
@@ -155,19 +155,19 @@ void writeValueContent_(TempFile &handle, sal_Bool value) {
}
void writeValueContent_(TempFile &handle, sal_Int16 value) {
- handle.writeString(OString(OString::number(value)));
+ handle.writeString(OString::number(value));
}
void writeValueContent_(TempFile &handle, sal_Int32 value) {
- handle.writeString(OString(OString::number(value)));
+ handle.writeString(OString::number(value));
}
void writeValueContent_(TempFile &handle, sal_Int64 value) {
- handle.writeString(OString(OString::number(value)));
+ handle.writeString(OString::number(value));
}
void writeValueContent_(TempFile &handle, double value) {
- handle.writeString(OString(OString::number(value)));
+ handle.writeString(OString::number(value));
}
void writeValueContent_(TempFile &handle, const OUString& value) {
@@ -530,7 +530,7 @@ void writeValueContent(TempFile &handle, std::u16string_view value) {
{
handle.writeString(convertToUtf8(value.substr(i, j - i)));
handle.writeString("<unicode oor:scalar=\"");
- handle.writeString(OString(OString::number(c)));
+ handle.writeString(OString::number(c));
handle.writeString("\"/>");
i = j + 1;
} else if (c == '\x0D') {
diff --git a/include/rtl/stringconcat.hxx b/include/rtl/stringconcat.hxx
index 7bbcb1cf680f..ae2048e80233 100644
--- a/include/rtl/stringconcat.hxx
+++ b/include/rtl/stringconcat.hxx
@@ -15,6 +15,7 @@
#include "rtl/ustring.h"
#include <cstddef>
+#include <string_view>
#include <utility>
#include <string.h>
@@ -334,6 +335,7 @@ template <class Derived, int nBufSize> struct OStringNumberBase
rtl_str_toAsciiUpperCase_WithLength(buf, length);
return std::move(*static_cast<Derived*>(this));
}
+ operator std::string_view() const { return std::string_view(buf, length); }
char buf[nBufSize];
sal_Int32 length;
};
@@ -402,6 +404,7 @@ template <class Derived, int nBufSize> struct OUStringNumberBase
rtl_ustr_toAsciiUpperCase_WithLength(buf, length);
return std::move(*static_cast<Derived*>(this));
}
+ operator std::u16string_view() const { return std::u16string_view(buf, length); }
sal_Unicode buf[nBufSize];
sal_Int32 length;
};