summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-11-22 17:17:53 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-11-23 10:10:08 +0000
commit20153742d2dee2df022275a07cc958b1759b9b72 (patch)
treea91d3d42faa559783d407bb1fe08f4070d945762 /vcl
parenta22ce3e4483f6fe462eaba8826a91355957e3676 (diff)
add a stripStart, can replace EraseLeadingChars
Diffstat (limited to 'vcl')
-rw-r--r--vcl/generic/fontmanager/fontmanager.cxx7
-rw-r--r--vcl/unx/generic/printer/ppdparser.cxx13
2 files changed, 11 insertions, 9 deletions
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index 3d95034160e8..789e57d8f92c 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -83,7 +83,8 @@
#include <valgrind/callgrind.h>
#endif
-#include "comphelper/processfactory.hxx"
+#include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
#include "com/sun/star/beans/XMaterialHolder.hpp"
#include "com/sun/star/beans/NamedValue.hpp"
@@ -2085,9 +2086,9 @@ void PrintFontManager::initFontsAlias()
ByteString aMap = GetCommandLineToken( 1, aLine );
// remove eventual quotes
- aAlias.EraseLeadingChars( '"' );
+ aAlias = comphelper::string::stripStart(aAlias, '"');
aAlias.EraseTrailingChars( '"' );
- aMap.EraseLeadingChars( '"' );
+ aMap = comphelper::string::stripStart(aMap, '"');
aMap.EraseTrailingChars( '"' );
XLFDEntry aAliasEntry, aMapEntry;
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index 7eec1f74d24d..e3b797005fce 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -34,6 +34,7 @@
#include <boost/unordered_map.hpp>
+#include <comphelper/string.hxx>
#include "vcl/ppdparser.hxx"
#include "vcl/strhelper.hxx"
#include "vcl/helper.hxx"
@@ -604,13 +605,13 @@ String PPDParser::getPPDPrinterName( const String& rFile )
if( aCurLine.CompareIgnoreCaseToAscii( "*include:", 9 ) == COMPARE_EQUAL )
{
aCurLine.Erase( 0, 9 );
- aCurLine.EraseLeadingChars( ' ' );
+ aCurLine = comphelper::string::stripStart(aCurLine, ' ');
aCurLine.EraseTrailingChars( ' ' );
- aCurLine.EraseLeadingChars( '\t' );
+ aCurLine = comphelper::string::stripStart(aCurLine, '\t');
aCurLine.EraseTrailingChars( '\t' );
aCurLine.EraseTrailingChars( '\r' );
aCurLine.EraseTrailingChars( '\n' );
- aCurLine.EraseLeadingChars( '"' );
+ aCurLine = comphelper::string::stripStart(aCurLine, '"');
aCurLine.EraseTrailingChars( '"' );
aStream.Close();
aStream.Open( getPPDFile( aCurLine ) );
@@ -703,13 +704,13 @@ PPDParser::PPDParser( const String& rFile ) :
if( aCurLine.CompareIgnoreCaseToAscii( "*include:", 9 ) == COMPARE_EQUAL )
{
aCurLine.Erase( 0, 9 );
- aCurLine.EraseLeadingChars( ' ' );
+ aCurLine = comphelper::string::stripStart(aCurLine, ' ');
aCurLine.EraseTrailingChars( ' ' );
- aCurLine.EraseLeadingChars( '\t' );
+ aCurLine = comphelper::string::stripStart(aCurLine, '\t');
aCurLine.EraseTrailingChars( '\t' );
aCurLine.EraseTrailingChars( '\r' );
aCurLine.EraseTrailingChars( '\n' );
- aCurLine.EraseLeadingChars( '"' );
+ aCurLine = comphelper::string::stripStart(aCurLine, '"');
aCurLine.EraseTrailingChars( '"' );
aStream.Close();
aStream.Open( getPPDFile( String( aCurLine, m_aFileEncoding ) ) );