vcl/unx/generic/printer/ppdparser.cxx |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 6bedf7bd840c7c6d4afea45b825b6a22cbdae240
Author:     Matteo Casalin <matteo.casa...@yahoo.com>
AuthorDate: Thu Jan 3 17:04:16 2019 +0100
Commit:     Matteo Casalin <matteo.casa...@yahoo.com>
CommitDate: Sun Jan 13 19:00:59 2019 +0100

    Simplify, avoid getToken
    
    Change-Id: I215edc7cd9fe94af833d8a9738eb9eff9538e6d0
    Reviewed-on: https://gerrit.libreoffice.org/66232
    Tested-by: Jenkins
    Reviewed-by: Matteo Casalin <matteo.casa...@yahoo.com>

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();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to