summaryrefslogtreecommitdiff
path: root/vcl/source/control
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-07 20:54:55 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-08 13:18:41 +0200
commit36e0e88b28e818faf25b8e32cc8c4dc444b8a0be (patch)
treeb7b5c8e13b6e05f871b01a3d0bf68c1d1329ef12 /vcl/source/control
parentcf5bbe3fce4a250ab25998053965bdc604c6114e (diff)
use more subView when converting to Int32
Change-Id: I54e3ddf79ba793fd4328bf8bda7f949b65349651 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132693 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/control')
-rw-r--r--vcl/source/control/field2.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index 67c0357a8ebf..95dff5f634e2 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -1195,7 +1195,7 @@ static sal_uInt16 ImplCutNumberFromString( OUString& rStr )
while (i2 != rStr.getLength() && rStr[i2] >= '0' && rStr[i2] <= '9') {
++i2;
}
- sal_Int32 nValue = rStr.copy(i1, i2-i1).toInt32();
+ sal_Int32 nValue = comphelper::string::toInt32(rStr.subView(i1, i2-i1));
rStr = rStr.copy(std::min(i2+1, rStr.getLength()));
return nValue;
}
@@ -2410,7 +2410,7 @@ bool TimeFormatter::TextToTime(std::u16string_view rStr, tools::Time& rTime,
}
else
{
- nSecond = static_cast<short>(aStr.copy( 0, nSepPos ).makeStringAndClear().toInt32());
+ nSecond = static_cast<short>(comphelper::string::toInt32(aStr.subView( 0, nSepPos )));
aStr.remove( 0, nSepPos+1 );
nSepPos = aStr.indexOf( rLocaleDataWrapper.getTimeSep() );
@@ -2419,7 +2419,7 @@ bool TimeFormatter::TextToTime(std::u16string_view rStr, tools::Time& rTime,
if ( nSepPos >= 0 )
{
nMinute = nSecond;
- nSecond = static_cast<short>(aStr.copy( 0, nSepPos ).makeStringAndClear().toInt32());
+ nSecond = static_cast<short>(comphelper::string::toInt32(aStr.subView( 0, nSepPos )));
aStr.remove( 0, nSepPos+1 );
nSepPos = aStr.indexOf( rLocaleDataWrapper.getTimeSep() );
@@ -2429,7 +2429,7 @@ bool TimeFormatter::TextToTime(std::u16string_view rStr, tools::Time& rTime,
{
nHour = nMinute;
nMinute = nSecond;
- nSecond = static_cast<short>(aStr.copy( 0, nSepPos ).makeStringAndClear().toInt32());
+ nSecond = static_cast<short>(comphelper::string::toInt32(aStr.subView( 0, nSepPos )));
aStr.remove( 0, nSepPos+1 );
}
else