From 36e0e88b28e818faf25b8e32cc8c4dc444b8a0be Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 7 Apr 2022 20:54:55 +0200 Subject: 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 --- vcl/source/control/field2.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'vcl/source/control') 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(aStr.copy( 0, nSepPos ).makeStringAndClear().toInt32()); + nSecond = static_cast(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(aStr.copy( 0, nSepPos ).makeStringAndClear().toInt32()); + nSecond = static_cast(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(aStr.copy( 0, nSepPos ).makeStringAndClear().toInt32()); + nSecond = static_cast(comphelper::string::toInt32(aStr.subView( 0, nSepPos ))); aStr.remove( 0, nSepPos+1 ); } else -- cgit /option> LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Expand)Author