diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2013-09-05 17:53:06 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-09-06 19:30:23 +0000 |
commit | 5c4cecb7ee3c910d739dee0701a4f54b06109cf5 (patch) | |
tree | 5e94d8daf48f218a27eae2c58988a2baceb7b112 /vcl | |
parent | Check for FT_Face_GetCharVariantIndex at build time (diff) | |
download | core-5c4cecb7ee3c910d739dee0701a4f54b06109cf5.tar.gz core-5c4cecb7ee3c910d739dee0701a4f54b06109cf5.zip |
String::Erase(String::Search())
One more from:
556fe4ec7339892d63cb98bc9bfd09718944bf03
Change-Id: Ia6514567e96930376c469a37c95c49e648bf5e46
Reviewed-on: https://gerrit.libreoffice.org/5827
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/generic/printer/ppdparser.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx index 3cec3e70d6a5..b82e20e85256 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++ ) |