summaryrefslogtreecommitdiff
path: root/vcl/unx/generic
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-08 14:05:30 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-08 20:44:43 +0200
commit3e7679738413054c7e6ce973380eac501bf41cf2 (patch)
treead80f5bd2f11020fa864488792b6cc0e98a00207 /vcl/unx/generic
parent3bfac2a7fad9737f31443292699bd6fee6ac3a6f (diff)
move comphelper::string::toInt32 to o3tl
so we can use it in places where we cannot include comphelper Change-Id: Iba0ba3e4c0dcf0f9d1f09092a77c3b2010ec4f6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132732 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/unx/generic')
-rw-r--r--vcl/unx/generic/printer/jobdata.cxx12
-rw-r--r--vcl/unx/generic/printer/ppdparser.cxx7
2 files changed, 10 insertions, 9 deletions
diff --git a/vcl/unx/generic/printer/jobdata.cxx b/vcl/unx/generic/printer/jobdata.cxx
index 5d7d432bb114..a1f17f46eec5 100644
--- a/vcl/unx/generic/printer/jobdata.cxx
+++ b/vcl/unx/generic/printer/jobdata.cxx
@@ -21,7 +21,7 @@
#include <jobdata.hxx>
#include <printerinfomanager.hxx>
#include <tools/stream.hxx>
-#include <comphelper/string.hxx>
+#include <o3tl/string_view.hxx>
#include <rtl/strbuf.hxx>
#include <memory>
@@ -232,7 +232,7 @@ bool JobData::constructFromStreamBuffer( const void* pData, sal_uInt32 bytes, Jo
else if (aLine.startsWith(copiesEquals))
{
bCopies = true;
- rJobData.m_nCopies = comphelper::string::toInt32(aLine.subView(RTL_CONSTASCII_LENGTH(copiesEquals)));
+ rJobData.m_nCopies = o3tl::toInt32(aLine.subView(RTL_CONSTASCII_LENGTH(copiesEquals)));
}
else if (aLine.startsWith(collateEquals))
{
@@ -250,22 +250,22 @@ bool JobData::constructFromStreamBuffer( const void* pData, sal_uInt32 bytes, Jo
else if (aLine.startsWith(colordepthEquals))
{
bColorDepth = true;
- rJobData.m_nColorDepth = comphelper::string::toInt32(aLine.subView(RTL_CONSTASCII_LENGTH(colordepthEquals)));
+ rJobData.m_nColorDepth = o3tl::toInt32(aLine.subView(RTL_CONSTASCII_LENGTH(colordepthEquals)));
}
else if (aLine.startsWith(colordeviceEquals))
{
bColorDevice = true;
- rJobData.m_nColorDevice = comphelper::string::toInt32(aLine.subView(RTL_CONSTASCII_LENGTH(colordeviceEquals)));
+ rJobData.m_nColorDevice = o3tl::toInt32(aLine.subView(RTL_CONSTASCII_LENGTH(colordeviceEquals)));
}
else if (aLine.startsWith(pslevelEquals))
{
bPSLevel = true;
- rJobData.m_nPSLevel = comphelper::string::toInt32(aLine.subView(RTL_CONSTASCII_LENGTH(pslevelEquals)));
+ rJobData.m_nPSLevel = o3tl::toInt32(aLine.subView(RTL_CONSTASCII_LENGTH(pslevelEquals)));
}
else if (aLine.startsWith(pdfdeviceEquals))
{
bPDFDevice = true;
- rJobData.m_nPDFDevice = comphelper::string::toInt32(aLine.subView(RTL_CONSTASCII_LENGTH(pdfdeviceEquals)));
+ rJobData.m_nPDFDevice = o3tl::toInt32(aLine.subView(RTL_CONSTASCII_LENGTH(pdfdeviceEquals)));
}
else if (aLine == "PPDContextData" && bPrinter)
{
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index ba68e1ef011e..8191c98364e1 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <comphelper/string.hxx>
+#include <o3tl/string_view.hxx>
#include <i18nlangtag/languagetag.hxx>
#include <ppdparser.hxx>
#include <strhelper.hxx>
@@ -1526,11 +1527,11 @@ void PPDParser::getResolutionFromString(std::u16string_view rString,
const size_t nPos {rString.find( 'x' )};
if( nPos != std::u16string_view::npos )
{
- rXRes = comphelper::string::toInt32(rString.substr( 0, nPos ));
- rYRes = comphelper::string::toInt32(rString.substr(nPos+1, nDPIPos - nPos - 1));
+ rXRes = o3tl::toInt32(rString.substr( 0, nPos ));
+ rYRes = o3tl::toInt32(rString.substr(nPos+1, nDPIPos - nPos - 1));
}
else
- rXRes = rYRes = comphelper::string::toInt32(rString.substr( 0, nDPIPos ));
+ rXRes = rYRes = o3tl::toInt32(rString.substr( 0, nDPIPos ));
}
}