summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/control/field2.cxx8
-rw-r--r--vcl/source/pdf/PDFiumLibrary.cxx13
2 files changed, 11 insertions, 10 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
diff --git a/vcl/source/pdf/PDFiumLibrary.cxx b/vcl/source/pdf/PDFiumLibrary.cxx
index e6abb40ccb89..e3f9baa98897 100644
--- a/vcl/source/pdf/PDFiumLibrary.cxx
+++ b/vcl/source/pdf/PDFiumLibrary.cxx
@@ -24,6 +24,7 @@
#include <vcl/bitmap.hxx>
#include <tools/stream.hxx>
#include <tools/UnitConversion.hxx>
+#include <comphelper/string.hxx>
#include <bitmap/BitmapWriteAccess.hxx>
@@ -581,12 +582,12 @@ util::DateTime PDFiumSignatureImpl::getTime()
OString aM(aTimeBuf.data(), aTimeBuf.size() - 1);
if (aM.startsWith("D:") && aM.getLength() >= 16)
{
- aRet.Year = aM.copy(2, 4).toInt32();
- aRet.Month = aM.copy(6, 2).toInt32();
- aRet.Day = aM.copy(8, 2).toInt32();
- aRet.Hours = aM.copy(10, 2).toInt32();
- aRet.Minutes = aM.copy(12, 2).toInt32();
- aRet.Seconds = aM.copy(14, 2).toInt32();
+ aRet.Year = comphelper::string::toInt32(aM.subView(2, 4));
+ aRet.Month = comphelper::string::toInt32(aM.subView(6, 2));
+ aRet.Day = comphelper::string::toInt32(aM.subView(8, 2));
+ aRet.Hours = comphelper::string::toInt32(aM.subView(10, 2));
+ aRet.Minutes = comphelper::string::toInt32(aM.subView(12, 2));
+ aRet.Seconds = comphelper::string::toInt32(aM.subView(14, 2));
}
return aRet;
}