diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-24 12:34:53 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-24 12:36:31 +0200 |
commit | a9a4d46ce74fc3c4ff1b7399ea6be6ffeeeb8863 (patch) | |
tree | f44261f69c3c6c5cb13095d092ea538a8d47a5e0 /vcl/generic | |
parent | 9796e52ab3bbf64fa751c71e695c64d6215e1df6 (diff) |
loplugin:simplifybool
Change-Id: I8276e8b356ff26241613de64bcd90b5dbcd92f29
Diffstat (limited to 'vcl/generic')
-rw-r--r-- | vcl/generic/fontmanager/fontmanager.cxx | 4 | ||||
-rw-r--r-- | vcl/generic/print/common_gfx.cxx | 2 | ||||
-rw-r--r-- | vcl/generic/print/genprnpsp.cxx | 8 | ||||
-rw-r--r-- | vcl/generic/print/printerjob.cxx | 9 |
4 files changed, 11 insertions, 12 deletions
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx index a357c7896f7c..87027d41e8cb 100644 --- a/vcl/generic/fontmanager/fontmanager.cxx +++ b/vcl/generic/fontmanager/fontmanager.cxx @@ -1571,7 +1571,7 @@ bool PrintFontManager::getFontInfo( fontID nFontID, PrintFontInfo& rInfo ) const rInfo.m_nID = nFontID; fillPrintFontInfo( pFont, rInfo ); } - return pFont ? true : false; + return pFont != nullptr; } bool PrintFontManager::getFontFastInfo( fontID nFontID, FastPrintFontInfo& rInfo ) const @@ -1582,7 +1582,7 @@ bool PrintFontManager::getFontFastInfo( fontID nFontID, FastPrintFontInfo& rInfo rInfo.m_nID = nFontID; fillPrintFontInfo( pFont, rInfo ); } - return pFont ? true : false; + return pFont != nullptr; } bool PrintFontManager::getFontBoundingBox( fontID nFontID, int& xMin, int& yMin, int& xMax, int& yMax ) diff --git a/vcl/generic/print/common_gfx.cxx b/vcl/generic/print/common_gfx.cxx index 769bb9893507..ffe1e25ae705 100644 --- a/vcl/generic/print/common_gfx.cxx +++ b/vcl/generic/print/common_gfx.cxx @@ -76,7 +76,7 @@ PrinterGfx::Init (const JobData& rData) mpPageBody = NULL; mnDepth = rData.m_nColorDepth; mnPSLevel = rData.m_nPSLevel ? rData.m_nPSLevel : (rData.m_pParser ? rData.m_pParser->getLanguageLevel() : 2 ); - mbColor = rData.m_nColorDevice ? ( rData.m_nColorDevice != -1 ) : ( rData.m_pParser ? rData.m_pParser->isColorDevice() : true ); + mbColor = rData.m_nColorDevice ? ( rData.m_nColorDevice != -1 ) : ( rData.m_pParser == nullptr || rData.m_pParser->isColorDevice() ); int nRes = rData.m_aContext.getRenderResolution(); mnDpi = nRes; mfScaleX = (double)72.0 / (double)mnDpi; diff --git a/vcl/generic/print/genprnpsp.cxx b/vcl/generic/print/genprnpsp.cxx index 7a0ab922eca8..71f35eb2d3e0 100644 --- a/vcl/generic/print/genprnpsp.cxx +++ b/vcl/generic/print/genprnpsp.cxx @@ -251,7 +251,7 @@ static bool passFileToCommandLine( const OUString& rFilename, const OUString& rC OString aCmdLine(OUStringToOString(rCommandLine, aEncoding)); OString aFilename(OUStringToOString(rFilename, aEncoding)); - bool bPipe = aCmdLine.indexOf( "(TMP)" ) != -1 ? false : true; + bool bPipe = aCmdLine.indexOf( "(TMP)" ) == -1; // setup command line for exec if( ! bPipe ) @@ -277,7 +277,7 @@ static bool passFileToCommandLine( const OUString& rFilename, const OUString& rC int pid, fd[2]; if( bPipe ) - bHavePipes = pipe( fd ) ? false : true; + bHavePipes = pipe( fd ) == 0; if( ( pid = fork() ) > 0 ) { if( bPipe && bHavePipes ) @@ -919,7 +919,7 @@ bool PspSalPrinter::StartJob( #endif m_aPrinterGfx.Init( m_aJobData ); - return m_aPrintJob.StartJob( ! m_aTmpFile.isEmpty() ? m_aTmpFile : m_aFileName, nMode, rJobName, rAppName, m_aJobData, &m_aPrinterGfx, bDirect ) ? true : false; + return m_aPrintJob.StartJob( ! m_aTmpFile.isEmpty() ? m_aTmpFile : m_aFileName, nMode, rJobName, rAppName, m_aJobData, &m_aPrinterGfx, bDirect ); } bool PspSalPrinter::EndJob() @@ -944,7 +944,7 @@ bool PspSalPrinter::EndJob() bool PspSalPrinter::AbortJob() { - bool bAbort = m_aPrintJob.AbortJob() ? true : false; + bool bAbort = m_aPrintJob.AbortJob(); GetSalData()->m_pInstance->jobEndedPrinterUpdate(); return bAbort; } diff --git a/vcl/generic/print/printerjob.cxx b/vcl/generic/print/printerjob.cxx index f3aa39df8125..ba0da718eec6 100644 --- a/vcl/generic/print/printerjob.cxx +++ b/vcl/generic/print/printerjob.cxx @@ -720,8 +720,8 @@ static bool writeFeature( osl::File* pFile, const PPDKey* pKey, const PPDValue* } aFeature.append( "\n} stopped cleartomark\n" ); sal_uInt64 nWritten = 0; - return pFile->write( aFeature.getStr(), aFeature.getLength(), nWritten ) - || nWritten != (sal_uInt64)aFeature.getLength() ? false : true; + return !(pFile->write( aFeature.getStr(), aFeature.getLength(), nWritten ) + || nWritten != (sal_uInt64)aFeature.getLength()); } bool PrinterJob::writeFeatureList( osl::File* pFile, const JobData& rJob, bool bDocumentSetup ) @@ -1014,9 +1014,8 @@ bool PrinterJob::writeSetup( osl::File* pFile, const JobData& rJob ) aLine.append(static_cast<sal_Int32>(rJob.m_nCopies)); aLine.append(" def\n"); sal_uInt64 nWritten = 0; - bSuccess = pFile->write(aLine.getStr(), aLine.getLength(), nWritten) - || nWritten != static_cast<sal_uInt64>(aLine.getLength()) ? - false : true; + bSuccess = !(pFile->write(aLine.getStr(), aLine.getLength(), nWritten) + || nWritten != static_cast<sal_uInt64>(aLine.getLength())); if( bSuccess && GetPostscriptLevel( &rJob ) >= 2 ) WritePS (pFile, "<< /NumCopies null /Policies << /NumCopies 1 >> >> setpagedevice\n" ); |