diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-01-28 11:01:28 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-01-28 11:11:28 +0100 |
commit | 1da69081732c8a429840edaaf10cfb789ea68df8 (patch) | |
tree | f343c9559e9dfb0263f7e33fe4306f81ec60e3fa /vcl/source | |
parent | b3737c638671ab39c5e6aaeaf5426d102392cc0a (diff) |
add string_view variants of methods to O[U]StringBuffer
and update the stringview loplugin to detect cases where we can
use these new methods.
Change-Id: I998efe02e35c8efcb3abfb4d7186165bbe6dfb2c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110046
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/control/edit.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/longcurr.cxx | 2 | ||||
-rw-r--r-- | vcl/source/treelist/treelistbox.cxx | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 5699124a9cde..93fb2151d25f 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -2077,7 +2077,7 @@ void Edit::Command( const CommandEvent& rCEvt ) { // restore old characters const sal_Int32 nRestore = nOldIMETextLen - nNewIMETextLen; - maText.insert( mpIMEInfos->nPos + nNewIMETextLen, mpIMEInfos->aOldTextAfterStartPos.copy( nNewIMETextLen, nRestore ) ); + maText.insert( mpIMEInfos->nPos + nNewIMETextLen, mpIMEInfos->aOldTextAfterStartPos.subView( nNewIMETextLen, nRestore ) ); } else if ( ( nOldIMETextLen < nNewIMETextLen ) && ( nOldIMETextLen < mpIMEInfos->aOldTextAfterStartPos.getLength() ) ) diff --git a/vcl/source/control/longcurr.cxx b/vcl/source/control/longcurr.cxx index 5025c1d68ef0..e141ce610741 100644 --- a/vcl/source/control/longcurr.cxx +++ b/vcl/source/control/longcurr.cxx @@ -119,7 +119,7 @@ bool ImplCurrencyGetValue( const OUString& rStr, BigInt& rValue, if ( nDecPos != -1 ) { - aStr1 = aStr.copy( 0, nDecPos ); + aStr1 = aStr.subView( 0, nDecPos ); aStr2.append(std::u16string_view(aStr).substr(nDecPos+1)); } else diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx index 5211bb56ecc1..4cc062295d1c 100644 --- a/vcl/source/treelist/treelistbox.cxx +++ b/vcl/source/treelist/treelistbox.cxx @@ -1302,7 +1302,7 @@ OUString SvTreeListBox::SearchEntryTextWithHeadTitle( SvTreeListEntry* pEntry ) } if (!sRet.isEmpty()) - sRet = sRet.copy(0, sRet.getLength() - 1); + sRet.remove(sRet.getLength() - 1, 1); return sRet.makeStringAndClear(); } |