summaryrefslogtreecommitdiff
path: root/include/rtl/ustring.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-07 20:33:28 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-08 08:43:34 +0200
commit59059d00c29334414a26bf5452572433f5735489 (patch)
treeec686065509d39261fc3d16824352b61eb2c7309 /include/rtl/ustring.hxx
parente61eed211766f26a3896c1d912dc7349abbe823d (diff)
prevent using O[U]String::subView on temporaties
by making the method "const &" Change-Id: I8b369ca1dd1f8d10832c85ccf3d890edb14e2c54 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132688 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/rtl/ustring.hxx')
-rw-r--r--include/rtl/ustring.hxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx
index 1a6a1cae8990..c530f1702a81 100644
--- a/include/rtl/ustring.hxx
+++ b/include/rtl/ustring.hxx
@@ -2189,7 +2189,7 @@ public:
@param beginIndex the beginning index, inclusive.
@return the specified substring.
*/
- SAL_WARN_UNUSED_RESULT std::u16string_view subView( sal_Int32 beginIndex ) const
+ SAL_WARN_UNUSED_RESULT std::u16string_view subView( sal_Int32 beginIndex ) const &
{
assert(beginIndex >= 0);
assert(beginIndex <= getLength());
@@ -2208,7 +2208,7 @@ public:
@param count the number of characters.
@return the specified substring.
*/
- SAL_WARN_UNUSED_RESULT std::u16string_view subView( sal_Int32 beginIndex, sal_Int32 count ) const
+ SAL_WARN_UNUSED_RESULT std::u16string_view subView( sal_Int32 beginIndex, sal_Int32 count ) const &
{
assert(beginIndex >= 0);
assert(count >= 0);