summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-11-20 13:30:38 +0200
committerNoel Grandin <noel@peralex.com>2013-11-20 13:56:08 +0200
commit30ac3942b44b8f903180488f87e1df4e02ff88e8 (patch)
treeee0681adcfaf3c63212bc600dc482d4256806700
parentacebbee971136e6ee0a7bc75bd57d937d6e1c295 (diff)
remove RTL_CONSTASCII_STRINGPARAM in OString::matchL calls
Convert code like: if (aValue.matchL(RTL_CONSTASCII_STRINGPARAM("BOOL="))) to: if (aValue.startsWith("BOOL=")) Change-Id: I385d10fd486d6a3e5f81f4a28088d913fc2f0d26
-rw-r--r--extensions/source/scanner/sanedlg.cxx6
-rw-r--r--vcl/unx/generic/printer/jobdata.cxx18
-rw-r--r--vcl/unx/generic/printer/ppdparser.cxx8
-rw-r--r--vcl/unx/generic/printer/printerinfomanager.cxx8
4 files changed, 20 insertions, 20 deletions
diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx
index fbc031894f94..57fa03e9e624 100644
--- a/extensions/source/scanner/sanedlg.cxx
+++ b/extensions/source/scanner/sanedlg.cxx
@@ -1200,18 +1200,18 @@ sal_Bool SaneDlg::LoadState()
if( nOption == -1 )
continue;
- if (aValue.matchL(RTL_CONSTASCII_STRINGPARAM("BOOL=")))
+ if (aValue.startsWith("BOOL="))
{
aValue = aValue.copy(RTL_CONSTASCII_LENGTH("BOOL="));
sal_Bool aBOOL = (sal_Bool)aValue.toInt32();
mrSane.SetOptionValue( nOption, aBOOL );
}
- else if (aValue.matchL(RTL_CONSTASCII_STRINGPARAM("STRING=")))
+ else if (aValue.startsWith("STRING="))
{
aValue = aValue.copy(RTL_CONSTASCII_LENGTH("STRING="));
mrSane.SetOptionValue(nOption,OStringToOUString(aValue, osl_getThreadTextEncoding()) );
}
- else if (aValue.matchL(RTL_CONSTASCII_STRINGPARAM("NUMERIC=")))
+ else if (aValue.startsWith("NUMERIC="))
{
aValue = aValue.copy(RTL_CONSTASCII_LENGTH("NUMERIC="));
diff --git a/vcl/unx/generic/printer/jobdata.cxx b/vcl/unx/generic/printer/jobdata.cxx
index 4b9756b58e30..76c23b4997da 100644
--- a/vcl/unx/generic/printer/jobdata.cxx
+++ b/vcl/unx/generic/printer/jobdata.cxx
@@ -200,24 +200,24 @@ bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobDa
while( ! aStream.IsEof() )
{
aStream.ReadLine( aLine );
- if (aLine.matchL(RTL_CONSTASCII_STRINGPARAM("JobData")))
+ if (aLine.startsWith("JobData"))
bVersion = true;
- else if (aLine.matchL(RTL_CONSTASCII_STRINGPARAM(printerEquals)))
+ else if (aLine.startsWith(printerEquals))
{
bPrinter = true;
rJobData.m_aPrinterName = OStringToOUString(aLine.copy(RTL_CONSTASCII_LENGTH(printerEquals)), RTL_TEXTENCODING_UTF8);
}
- else if (aLine.matchL(RTL_CONSTASCII_STRINGPARAM(orientatationEquals)))
+ else if (aLine.startsWith(orientatationEquals))
{
bOrientation = true;
rJobData.m_eOrientation = aLine.copy(RTL_CONSTASCII_LENGTH(orientatationEquals)).equalsIgnoreAsciiCase("landscape") ? orientation::Landscape : orientation::Portrait;
}
- else if (aLine.matchL(RTL_CONSTASCII_STRINGPARAM(copiesEquals)))
+ else if (aLine.startsWith(copiesEquals))
{
bCopies = true;
rJobData.m_nCopies = aLine.copy(RTL_CONSTASCII_LENGTH(copiesEquals)).toInt32();
}
- else if (aLine.matchL(RTL_CONSTASCII_STRINGPARAM(margindajustmentEquals)))
+ else if (aLine.startsWith(margindajustmentEquals))
{
bMargin = true;
OString aValues(aLine.copy(RTL_CONSTASCII_LENGTH(margindajustmentEquals)));
@@ -226,22 +226,22 @@ bool JobData::constructFromStreamBuffer( void* pData, int bytes, JobData& rJobDa
rJobData.m_nTopMarginAdjust = aValues.getToken(2, ',').toInt32();
rJobData.m_nBottomMarginAdjust = aValues.getToken(3, ',').toInt32();
}
- else if (aLine.matchL(RTL_CONSTASCII_STRINGPARAM(colordepthEquals)))
+ else if (aLine.startsWith(colordepthEquals))
{
bColorDepth = true;
rJobData.m_nColorDepth = aLine.copy(RTL_CONSTASCII_LENGTH(colordepthEquals)).toInt32();
}
- else if (aLine.matchL(RTL_CONSTASCII_STRINGPARAM(colordeviceEquals)))
+ else if (aLine.startsWith(colordeviceEquals))
{
bColorDevice = true;
rJobData.m_nColorDevice = aLine.copy(RTL_CONSTASCII_LENGTH(colordeviceEquals)).toInt32();
}
- else if (aLine.matchL(RTL_CONSTASCII_STRINGPARAM(pslevelEquals)))
+ else if (aLine.startsWith(pslevelEquals))
{
bPSLevel = true;
rJobData.m_nPSLevel = aLine.copy(RTL_CONSTASCII_LENGTH(pslevelEquals)).toInt32();
}
- else if (aLine.matchL(RTL_CONSTASCII_STRINGPARAM(pdfdeviceEquals)))
+ else if (aLine.startsWith(pdfdeviceEquals))
{
bPDFDevice = true;
rJobData.m_nPDFDevice = aLine.copy(RTL_CONSTASCII_LENGTH(pdfdeviceEquals)).toInt32();
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index 35bea659309a..efd8ee96695c 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -994,7 +994,7 @@ void PPDParser::parse( ::std::list< OString >& rLines )
continue;
// default values are parsed in pass 2
- if (aKey.matchL(RTL_CONSTASCII_STRINGPARAM("Default")))
+ if (aKey.startsWith("Default"))
continue;
bool bQuery = false;
@@ -1174,7 +1174,7 @@ void PPDParser::parse( ::std::list< OString >& rLines )
for( line = rLines.begin(); line != rLines.end(); ++line )
{
OString aLine(*line);
- if (aLine.matchL(RTL_CONSTASCII_STRINGPARAM("*Default")))
+ if (aLine.startsWith("*Default"))
{
OUString aKey(OStringToOUString(aLine.copy(8), RTL_TEXTENCODING_MS_1252));
sal_Int32 nPos = aKey.indexOf( ':' );
@@ -1204,8 +1204,8 @@ void PPDParser::parse( ::std::list< OString >& rLines )
}
}
}
- else if (aLine.matchL(RTL_CONSTASCII_STRINGPARAM("*UIConstraints")) ||
- aLine.matchL(RTL_CONSTASCII_STRINGPARAM("*NonUIConstraints")))
+ else if (aLine.startsWith("*UIConstraints") ||
+ aLine.startsWith("*NonUIConstraints"))
{
parseConstraint( aLine );
}
diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx
index e9f7791c20ec..4f8f56ec75ca 100644
--- a/vcl/unx/generic/printer/printerinfomanager.cxx
+++ b/vcl/unx/generic/printer/printerinfomanager.cxx
@@ -315,7 +315,7 @@ void PrinterInfoManager::initialize()
for( int nKey = 0; nKey < aConfig.GetKeyCount(); ++nKey )
{
OString aKey( aConfig.GetKeyName( nKey ) );
- if (aKey.matchL(RTL_CONSTASCII_STRINGPARAM("PPD_")))
+ if (aKey.startsWith("PPD_"))
{
aValue = aConfig.ReadKey( aKey );
const PPDKey* pKey = m_aGlobalDefaults.m_pParser->getKey(OStringToOUString(aKey.copy(4), RTL_TEXTENCODING_ISO_8859_1));
@@ -327,7 +327,7 @@ void PrinterInfoManager::initialize()
sal_True );
}
}
- else if (aKey.matchL(RTL_CONSTASCII_STRINGPARAM("SubstFont_")))
+ else if (aKey.startsWith("SubstFont_"))
{
aValue = aConfig.ReadKey( aKey );
m_aGlobalDefaults.m_aFontSubstitutes[ OStringToOUString( aKey.copy( 10 ), RTL_TEXTENCODING_ISO_8859_1 ) ] = OStringToOUString( aValue, RTL_TEXTENCODING_ISO_8859_1 );
@@ -523,7 +523,7 @@ void PrinterInfoManager::initialize()
for( int nKey = 0; nKey < aConfig.GetKeyCount(); ++nKey )
{
OString aKey( aConfig.GetKeyName( nKey ) );
- if( aKey.matchL(RTL_CONSTASCII_STRINGPARAM("PPD_")) && aPrinter.m_aInfo.m_pParser )
+ if( aKey.startsWith("PPD_") && aPrinter.m_aInfo.m_pParser )
{
aValue = aConfig.ReadKey( aKey );
const PPDKey* pKey = aPrinter.m_aInfo.m_pParser->getKey(OStringToOUString(aKey.copy(4), RTL_TEXTENCODING_ISO_8859_1));
@@ -535,7 +535,7 @@ void PrinterInfoManager::initialize()
sal_True );
}
}
- else if( aKey.matchL(RTL_CONSTASCII_STRINGPARAM("SubstFont_")) )
+ else if( aKey.startsWith("SubstFont_") )
{
aValue = aConfig.ReadKey( aKey );
aPrinter.m_aInfo.m_aFontSubstitutes[ OStringToOUString( aKey.copy( 10 ), RTL_TEXTENCODING_ISO_8859_1 ) ] = OStringToOUString( aValue, RTL_TEXTENCODING_ISO_8859_1 );