From 8511bc6b9bf5dcaf0ce6ecee65be54552bc73bd5 Mon Sep 17 00:00:00 2001 From: Matteo Casalin Date: Thu, 3 Jan 2019 17:11:11 +0100 Subject: Use indexed getToken, avoid unnecessary OUString copy Change-Id: I2ce2d16c24f7fd90c7ba16175ea99f7e1cb46fc9 Reviewed-on: https://gerrit.libreoffice.org/66233 Tested-by: Jenkins Reviewed-by: Matteo Casalin --- vcl/unx/generic/printer/jobdata.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'vcl/unx/generic') 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)) { -- cgit