summaryrefslogtreecommitdiff
path: root/include/rtl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-05-09 14:02:26 +0200
committerStephan Bergmann <sbergman@redhat.com>2022-05-09 17:55:16 +0200
commit81d55a0a8b999c58b5b347abd6214d6571ed9923 (patch)
treee8ebe2ea54cdb478aeaa9f74a2b8d0b2d9bb21d5 /include/rtl
parent7c8f27e3d8ff9c22409313a093bf538256fa2f7f (diff)
Revert "prevent using O[U]String::subView on temporaties"
This reverts commit 59059d00c29334414a26bf5452572433f5735489, as it effectively did nothing, as rvalues can bind to `const &` just fine. <https://gerrit.libreoffice.org/c/core/+/133747> "Acutally do prevent using O[U]String::subView on temporaties" would have fixed that, but (a) it didn't find any actual mis-uses and (b) rather would have required a handful of legitimate cases to be dressed up with o3tl::temporary now, so is arguably not worth it. Change-Id: I923d0db2646dc8ea66d1b2a8b709ee2cd7a60ed4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134058 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'include/rtl')
-rw-r--r--include/rtl/string.hxx4
-rw-r--r--include/rtl/ustring.hxx4
2 files changed, 4 insertions, 4 deletions
diff --git a/include/rtl/string.hxx b/include/rtl/string.hxx
index f64f2d651730..e99581cd6f94 100644
--- a/include/rtl/string.hxx
+++ b/include/rtl/string.hxx
@@ -1540,7 +1540,7 @@ public:
@param beginIndex the beginning index, inclusive.
@return the specified substring.
*/
- SAL_WARN_UNUSED_RESULT std::string_view subView( sal_Int32 beginIndex ) const &
+ SAL_WARN_UNUSED_RESULT std::string_view subView( sal_Int32 beginIndex ) const
{
assert(beginIndex >= 0);
assert(beginIndex <= getLength());
@@ -1559,7 +1559,7 @@ public:
@param count the number of characters.
@return the specified substring.
*/
- SAL_WARN_UNUSED_RESULT std::string_view subView( sal_Int32 beginIndex, sal_Int32 count ) const &
+ SAL_WARN_UNUSED_RESULT std::string_view subView( sal_Int32 beginIndex, sal_Int32 count ) const
{
assert(beginIndex >= 0);
assert(count >= 0);
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx
index b7cebaf90647..e6d3ed682932 100644
--- a/include/rtl/ustring.hxx
+++ b/include/rtl/ustring.hxx
@@ -2191,7 +2191,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());
@@ -2210,7 +2210,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);