summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/generic/printer/ppdparser.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index a7ef431c3340..2401855b892c 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -1512,18 +1512,16 @@ void PPDParser::getResolutionFromString(
const OUString& rString,
int& rXRes, int& rYRes )
{
- sal_Int32 nDPIPos;
-
rXRes = rYRes = 300;
- nDPIPos = rString.indexOf( "dpi" );
+ const sal_Int32 nDPIPos {rString.indexOf( "dpi" )};
if( nDPIPos != -1 )
{
- sal_Int32 nPos = 0;
- if( ( nPos = rString.indexOf( 'x' ) ) != -1 )
+ const sal_Int32 nPos {rString.indexOf( 'x' )};
+ if( nPos >=0 )
{
rXRes = rString.copy( 0, nPos ).toInt32();
- rYRes = rString.getToken( 1, 'x' ).copy(0, nDPIPos - nPos - 1).toInt32();
+ rYRes = rString.copy(nPos+1, nDPIPos - nPos - 1).toInt32();
}
else
rXRes = rYRes = rString.copy( 0, nDPIPos ).toInt32();