summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-11-29 08:46:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-11-29 09:57:15 +0100
commit933660e591211f06a1be43e83c64ad1e8529bc2f (patch)
treeadc0ede7c30c9ee5af7b75e649c806831f73da41 /vcl
parentb9c9c70157e7bc5b868437ab6bda2b21ba34c627 (diff)
loplugin:stringconstant look for unnecessary OString constructor use
and tweak the methods in check.hxx to make them more flexible when called with dc.Class(xxx ? "foo" : "bar") Change-Id: I881fe628f22121ced4d8849715d6b1c92b092da1 Reviewed-on: https://gerrit.libreoffice.org/64207 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/generic/print/common_gfx.cxx2
-rw-r--r--vcl/unx/generic/print/genprnpsp.cxx2
-rw-r--r--vcl/unx/generic/printer/cpdmgr.cxx14
-rw-r--r--vcl/unx/generic/printer/jobdata.cxx2
-rw-r--r--vcl/unx/generic/printer/ppdparser.cxx4
5 files changed, 12 insertions, 12 deletions
diff --git a/vcl/unx/generic/print/common_gfx.cxx b/vcl/unx/generic/print/common_gfx.cxx
index 85984e835736..586b59693fc6 100644
--- a/vcl/unx/generic/print/common_gfx.cxx
+++ b/vcl/unx/generic/print/common_gfx.cxx
@@ -1078,7 +1078,7 @@ PrinterGfx::DrawEPS( const tools::Rectangle& rBoundingBox, void* pPtr, sal_uInt3
char cChar = aLine[1];
if( cChar == '%' )
{
- if( aLine.matchIgnoreAsciiCase( OString( "%%BoundingBox:") ) )
+ if( aLine.matchIgnoreAsciiCase( "%%BoundingBox:" ) )
{
aLine = WhitespaceToSpace( aLine.getToken(1, ':') );
if( !aLine.isEmpty() && aLine.indexOf( "atend" ) == -1 )
diff --git a/vcl/unx/generic/print/genprnpsp.cxx b/vcl/unx/generic/print/genprnpsp.cxx
index 376da8fcf51f..69080676102f 100644
--- a/vcl/unx/generic/print/genprnpsp.cxx
+++ b/vcl/unx/generic/print/genprnpsp.cxx
@@ -254,7 +254,7 @@ static bool passFileToCommandLine( const OUString& rFilename, const OUString& rC
// setup command line for exec
if( ! bPipe )
- aCmdLine = aCmdLine.replaceAll(OString("(TMP)"), aFilename);
+ aCmdLine = aCmdLine.replaceAll("(TMP)", aFilename);
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "%s commandline: \"%s\"\n",
diff --git a/vcl/unx/generic/printer/cpdmgr.cxx b/vcl/unx/generic/printer/cpdmgr.cxx
index aedcd5b42543..c79ed672db60 100644
--- a/vcl/unx/generic/printer/cpdmgr.cxx
+++ b/vcl/unx/generic/printer/cpdmgr.cxx
@@ -625,19 +625,19 @@ void CPDManager::getOptionsFromDocumentSetup( const JobData& rJob, bool bBanner,
if (!sPayLoad.isEmpty()) {
OString aKey = OUStringToOString( pKey->getKey(), RTL_TEXTENCODING_ASCII_US );
OString aValue = OUStringToOString( sPayLoad, RTL_TEXTENCODING_ASCII_US );
- if (aKey.equals(OString("Duplex"))) {
+ if (aKey.equals("Duplex")) {
aKey = OString("sides");
- } else if (aKey.equals(OString("Resolution"))) {
+ } else if (aKey.equals("Resolution")) {
aKey = OString("printer-resolution");
- } else if (aKey.equals(OString("PageSize"))) {
+ } else if (aKey.equals("PageSize")) {
aKey = OString("media");
}
- if (aKey.equals(OString("sides"))) {
- if (aValue.equals(OString("None"))) {
+ if (aKey.equals("sides")) {
+ if (aValue.equals("None")) {
aValue = OString("one-sided");
- } else if (aValue.equals(OString("DuplexNoTumble"))) {
+ } else if (aValue.equals("DuplexNoTumble")) {
aValue = OString("two-sided-long-edge");
- } else if (aValue.equals(OString("DuplexTumble"))) {
+ } else if (aValue.equals("DuplexTumble")) {
aValue = OString("two-sided-short-edge");
}
}
diff --git a/vcl/unx/generic/printer/jobdata.cxx b/vcl/unx/generic/printer/jobdata.cxx
index 28772c99db13..76de4fef3e14 100644
--- a/vcl/unx/generic/printer/jobdata.cxx
+++ b/vcl/unx/generic/printer/jobdata.cxx
@@ -118,7 +118,7 @@ bool JobData::getStreamBuffer( void*& pData, sal_uInt32& bytes )
SvMemoryStream aStream;
// write header job data
- aStream.WriteLine(OString("JobData 1"));
+ aStream.WriteLine("JobData 1");
OStringBuffer aLine;
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index 7789459c200c..125d0c29aba4 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -710,7 +710,7 @@ PPDParser::PPDParser( const OUString& rFile ) :
OString aCurLine = aStream.ReadLine();
if( aCurLine.startsWith("*") )
{
- if (aCurLine.matchIgnoreAsciiCase(OString("*include:")))
+ if (aCurLine.matchIgnoreAsciiCase("*include:"))
{
aCurLine = aCurLine.copy(9);
aCurLine = comphelper::string::stripStart(aCurLine, ' ');
@@ -726,7 +726,7 @@ PPDParser::PPDParser( const OUString& rFile ) :
continue;
}
else if( ! bLanguageEncoding &&
- aCurLine.matchIgnoreAsciiCase(OString("*languageencoding")) )
+ aCurLine.matchIgnoreAsciiCase("*languageencoding") )
{
bLanguageEncoding = true; // generally only the first one counts
OString aLower = aCurLine.toAsciiLowerCase();