diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2019-01-03 16:53:35 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2019-01-13 16:07:44 +0100 |
commit | 087962e390719b6027b4c2cf795c49a2b92624d7 (patch) | |
tree | 38657e18e987361817567c06b071aa607382f197 /vcl | |
parent | 7b475a2fcde27e44a71962f1010f92bf9df87fb1 (diff) |
Simplify and use getToken index when possible/needed
Change-Id: I21f31a0e3ed1cebd7f77a34a2b7b89c528823ce7
Reviewed-on: https://gerrit.libreoffice.org/66231
Tested-by: Jenkins
Reviewed-by: Matteo Casalin <matteo.casalin@yahoo.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/generic/printer/printerinfomanager.cxx | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx index 9c1007cdcd09..cc4fb0b88485 100644 --- a/vcl/unx/generic/printer/printerinfomanager.cxx +++ b/vcl/unx/generic/printer/printerinfomanager.cxx @@ -234,10 +234,11 @@ void PrinterInfoManager::initialize() aValue = aConfig.ReadKey( "MarginAdjust" ); if (!aValue.isEmpty()) { - m_aGlobalDefaults.m_nLeftMarginAdjust = aValue.getToken(0, ',').toInt32(); - m_aGlobalDefaults.m_nRightMarginAdjust = aValue.getToken(1, ',').toInt32(); - m_aGlobalDefaults.m_nTopMarginAdjust = aValue.getToken(2, ',').toInt32(); - m_aGlobalDefaults.m_nBottomMarginAdjust = aValue.getToken(3, ',').toInt32(); + sal_Int32 nIdx {0}; + m_aGlobalDefaults.m_nLeftMarginAdjust = aValue.getToken(0, ',', nIdx).toInt32(); + m_aGlobalDefaults.m_nRightMarginAdjust = aValue.getToken(0, ',', nIdx).toInt32(); + m_aGlobalDefaults.m_nTopMarginAdjust = aValue.getToken(0, ',', nIdx).toInt32(); + m_aGlobalDefaults.m_nBottomMarginAdjust = aValue.getToken(0, ',', nIdx).toInt32(); } aValue = aConfig.ReadKey( "ColorDepth", "24" ); @@ -417,10 +418,11 @@ void PrinterInfoManager::initialize() aValue = aConfig.ReadKey( "MarginAdjust" ); if (!aValue.isEmpty()) { - aPrinter.m_aInfo.m_nLeftMarginAdjust = aValue.getToken(0, ',' ).toInt32(); - aPrinter.m_aInfo.m_nRightMarginAdjust = aValue.getToken(1, ',' ).toInt32(); - aPrinter.m_aInfo.m_nTopMarginAdjust = aValue.getToken(2, ',' ).toInt32(); - aPrinter.m_aInfo.m_nBottomMarginAdjust = aValue.getToken(3, ',' ).toInt32(); + sal_Int32 nIdx {0}; + aPrinter.m_aInfo.m_nLeftMarginAdjust = aValue.getToken(0, ',', nIdx).toInt32(); + aPrinter.m_aInfo.m_nRightMarginAdjust = aValue.getToken(0, ',', nIdx).toInt32(); + aPrinter.m_aInfo.m_nTopMarginAdjust = aValue.getToken(0, ',', nIdx).toInt32(); + aPrinter.m_aInfo.m_nBottomMarginAdjust = aValue.getToken(0, ',', nIdx).toInt32(); } aValue = aConfig.ReadKey( "ColorDepth" ); @@ -563,9 +565,7 @@ bool PrinterInfoManager::checkFeatureToken( const OUString& rPrinterName, const while( nIndex != -1 ) { OUString aOuterToken = rPrinterInfo.m_aFeatures.getToken( 0, ',', nIndex ); - sal_Int32 nInnerIndex = 0; - OUString aInnerToken = aOuterToken.getToken( 0, '=', nInnerIndex ); - if( aInnerToken.equalsIgnoreAsciiCaseAscii( pToken ) ) + if( aOuterToken.getToken( 0, '=' ).equalsIgnoreAsciiCaseAscii( pToken ) ) return true; } return false; |