include/rtl/string.hxx  |    4 ++--
 include/rtl/ustring.hxx |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 81d55a0a8b999c58b5b347abd6214d6571ed9923
Author:     Stephan Bergmann <[email protected]>
AuthorDate: Mon May 9 14:02:26 2022 +0200
Commit:     Stephan Bergmann <[email protected]>
CommitDate: Mon May 9 17:55:16 2022 +0200

    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 <[email protected]>

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);

Reply via email to