summaryrefslogtreecommitdiff
path: root/vcl/unx/generic
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2019-01-03 17:11:11 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2019-01-18 23:10:04 +0100
commit8511bc6b9bf5dcaf0ce6ecee65be54552bc73bd5 (patch)
treea30c9b6faf14aec6cd342b0f8cab41154440ce53 /vcl/unx/generic
parentbbb004094381ec595267fa93449facd2f608b9f7 (diff)
Use indexed getToken, avoid unnecessary OUString copy
Change-Id: I2ce2d16c24f7fd90c7ba16175ea99f7e1cb46fc9 Reviewed-on: https://gerrit.libreoffice.org/66233 Tested-by: Jenkins Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
Diffstat (limited to 'vcl/unx/generic')
-rw-r--r--vcl/unx/generic/printer/jobdata.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/vcl/unx/generic/printer/jobdata.cxx b/vcl/unx/generic/printer/jobdata.cxx
index 76de4fef3e14..8f2b0018ca07 100644
--- a/vcl/unx/generic/printer/jobdata.cxx
+++ b/vcl/unx/generic/printer/jobdata.cxx
@@ -237,11 +237,11 @@ bool JobData::constructFromStreamBuffer( const void* pData, sal_uInt32 bytes, Jo
else if (aLine.startsWith(margindajustmentEquals))
{
bMargin = true;
- OString aValues(aLine.copy(RTL_CONSTASCII_LENGTH(margindajustmentEquals)));
- rJobData.m_nLeftMarginAdjust = aValues.getToken(0, ',').toInt32();
- rJobData.m_nRightMarginAdjust = aValues.getToken(1, ',').toInt32();
- rJobData.m_nTopMarginAdjust = aValues.getToken(2, ',').toInt32();
- rJobData.m_nBottomMarginAdjust = aValues.getToken(3, ',').toInt32();
+ sal_Int32 nIdx {RTL_CONSTASCII_LENGTH(margindajustmentEquals)};
+ rJobData.m_nLeftMarginAdjust = aLine.getToken(0, ',', nIdx).toInt32();
+ rJobData.m_nRightMarginAdjust = aLine.getToken(0, ',', nIdx).toInt32();
+ rJobData.m_nTopMarginAdjust = aLine.getToken(0, ',', nIdx).toInt32();
+ rJobData.m_nBottomMarginAdjust = aLine.getToken(0, ',', nIdx).toInt32();
}
else if (aLine.startsWith(colordepthEquals))
{