summaryrefslogtreecommitdiff
path: root/include/rtl
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-05-05 07:59:00 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2023-05-06 07:24:20 +0200
commit7dbc0e991f65b51f2033b8c8c60df055926d37b9 (patch)
treec11f32c340814e59a22f55e71afc715f058a9ad6 /include/rtl
parent77ed6380dda73a9716f48f73c3ff730380557a09 (diff)
[API CHANGE] Fix O(U)StringBuffer::insert taking float
It was broken from the start: it was introduced like this already in commit 9399c662f36c385b0c705eb34e636a9aec450282 (initial import, 2000-09-18). Creating a temporary copy as a return value makes no sense. Change-Id: I6910d426c2437038ec4979be2c44cd72146dec9c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151375 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'include/rtl')
-rw-r--r--include/rtl/strbuf.hxx2
-rw-r--r--include/rtl/ustrbuf.hxx2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/rtl/strbuf.hxx b/include/rtl/strbuf.hxx
index b448228d6053..e5ae1ebd0a7b 100644
--- a/include/rtl/strbuf.hxx
+++ b/include/rtl/strbuf.hxx
@@ -1030,7 +1030,7 @@ public:
@param f a <code>float</code>.
@return this string buffer.
*/
- OStringBuffer insert(sal_Int32 offset, float f)
+ OStringBuffer & insert(sal_Int32 offset, float f)
{
char sz[RTL_STR_MAX_VALUEOFFLOAT];
return insert( offset, sz, rtl_str_valueOfFloat( sz, f ) );
diff --git a/include/rtl/ustrbuf.hxx b/include/rtl/ustrbuf.hxx
index 578df163d819..363b4f24757f 100644
--- a/include/rtl/ustrbuf.hxx
+++ b/include/rtl/ustrbuf.hxx
@@ -1286,7 +1286,7 @@ public:
@return this string buffer.
@exception StringIndexOutOfBoundsException if the offset is invalid.
*/
- OUStringBuffer insert(sal_Int32 offset, float f)
+ OUStringBuffer & insert(sal_Int32 offset, float f)
{
sal_Unicode sz[RTL_USTR_MAX_VALUEOFFLOAT];
return insert( offset, sz, rtl_ustr_valueOfFloat( sz, f ) );