[Libreoffice-commits] core.git: vcl/unx

Thomas Arnhold thomas at arnhold.org
Fri Sep 6 12:30:44 PDT 2013


 vcl/unx/generic/printer/ppdparser.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 5c4cecb7ee3c910d739dee0701a4f54b06109cf5
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Thu Sep 5 17:53:06 2013 +0200

    String::Erase(String::Search())
    
    One more from:
    
    556fe4ec7339892d63cb98bc9bfd09718944bf03
    
    Change-Id: Ia6514567e96930376c469a37c95c49e648bf5e46
    Reviewed-on: https://gerrit.libreoffice.org/5827
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index 3cec3e7..b82e20e 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -1303,7 +1303,9 @@ void PPDParser::parseConstraint( const OString& rLine )
     bool bFailed = false;
 
     OUString aLine(OStringToOUString(rLine, RTL_TEXTENCODING_MS_1252));
-    aLine = aLine.replaceAt(0, rLine.indexOf(':') + 1, "");
+    sal_Int32 nIdx = rLine.indexOf(':');
+    if (nIdx != -1)
+        aLine = aLine.replaceAt(0, nIdx + 1, "");
     PPDConstraint aConstraint;
     int nTokens = GetCommandLineTokenCount( aLine );
     for( int i = 0; i < nTokens; i++ )


More information about the Libreoffice-commits mailing list