summaryrefslogtreecommitdiff
path: root/vcl/source/control
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-01-11 11:21:46 +0100
committerStephan Bergmann <sbergman@redhat.com>2019-01-11 13:55:14 +0100
commit70519a43e0d89a6b5d89859a6851f8c757c6b0c7 (patch)
treebc1f4a6b6510e3bff75e9dc54eb71e2fa6cfc3c8 /vcl/source/control
parenta0210c5c5e8fd47b55567a8b18788d57d2b7decb (diff)
Replace OUStringBuffer::appendCopy with append(std::u16string_view)
...which is more general Change-Id: I94f28f8eda887120cf5f143b4549e0339b60e6a7 Reviewed-on: https://gerrit.libreoffice.org/66155 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl/source/control')
-rw-r--r--vcl/source/control/field.cxx17
-rw-r--r--vcl/source/control/field2.cxx3
-rw-r--r--vcl/source/control/longcurr.cxx6
3 files changed, 17 insertions, 9 deletions
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index 6801c0a7a5d8..d444bc8c678e 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -18,6 +18,9 @@
*/
#include <sal/config.h>
+
+#include <string_view>
+
#include <sal/log.hxx>
#include <osl/diagnose.h>
@@ -113,23 +116,23 @@ bool ImplNumericGetValue( const OUString& rStr, sal_Int64& rValue,
// If in "a b/c" format.
if(nFracNumPos != -1 )
{
- aStr1.appendCopy(aStr, 0, nFracNumPos);
- aStrNum.appendCopy(aStr, nFracNumPos+1, nFracDivPos-nFracNumPos-1);
- aStrDenom.appendCopy(aStr, nFracDivPos+1);
+ aStr1.append(std::u16string_view(aStr).substr(0, nFracNumPos));
+ aStrNum.append(std::u16string_view(aStr).substr(nFracNumPos+1, nFracDivPos-nFracNumPos-1));
+ aStrDenom.append(std::u16string_view(aStr).substr(nFracDivPos+1));
}
// "a/b" format, or not a fraction at all
else
{
- aStrNum.appendCopy(aStr, 0, nFracDivPos);
- aStrDenom.appendCopy(aStr, nFracDivPos+1);
+ aStrNum.append(std::u16string_view(aStr).substr(0, nFracDivPos));
+ aStrDenom.append(std::u16string_view(aStr).substr(nFracDivPos+1));
}
}
// parse decimal strings
else if ( nDecPos >= 0)
{
- aStr1.appendCopy(aStr, 0, nDecPos);
- aStr2.appendCopy(aStr, nDecPos+1);
+ aStr1.append(std::u16string_view(aStr).substr(0, nDecPos));
+ aStr2.append(std::u16string_view(aStr).substr(nDecPos+1));
}
else
aStr1 = aStr;
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index cfef2ecdc002..71029a830cb5 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -20,6 +20,7 @@
#include <sal/config.h>
#include <algorithm>
+#include <string_view>
#include <tools/diagnose_ex.h>
#include <comphelper/processfactory.hxx>
@@ -678,7 +679,7 @@ static bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
{
// possibly extend string until cursor position
if ( aStr.getLength() < nNewPos )
- aStr.appendCopy( rLiteralMask, aStr.getLength(), nNewPos-aStr.getLength() );
+ aStr.append( std::u16string_view(rLiteralMask).substr(aStr.getLength(), nNewPos-aStr.getLength()) );
if ( nNewPos < aStr.getLength() )
aStr.insert( cChar, nNewPos );
else if ( nNewPos < rEditMask.getLength() )
diff --git a/vcl/source/control/longcurr.cxx b/vcl/source/control/longcurr.cxx
index 03820f9792fa..77453650d9a9 100644
--- a/vcl/source/control/longcurr.cxx
+++ b/vcl/source/control/longcurr.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <string_view>
+
#include <comphelper/string.hxx>
#include <tools/bigint.hxx>
#include <sal/log.hxx>
@@ -117,7 +121,7 @@ bool ImplCurrencyGetValue( const OUString& rStr, BigInt& rValue,
if ( nDecPos != -1 )
{
aStr1 = aStr.copy( 0, nDecPos );
- aStr2.appendCopy(aStr, nDecPos+1);
+ aStr2.append(std::u16string_view(aStr).substr(nDecPos+1));
}
else
aStr1 = aStr;