diff options
author | Olivier Hallot <olivier.hallot@alta.org.br> | 2012-02-01 12:16:11 -0200 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@alta.org.br> | 2012-02-02 19:53:07 -0200 |
commit | beccf7c9dd4966347fa31e11922fd73bd40dfeb9 (patch) | |
tree | 33d40aadd3ef399bdfce0f3662b8ad0055fee125 /vcl/unx/generic/printer | |
parent | 4cb33a7db765f8ad06e65d24a2396f2857a9cf0d (diff) |
Fix for fdo43460 Part LIX getLength() to isEmpty()
Part LIX
Modules
vcl (part 3)
Diffstat (limited to 'vcl/unx/generic/printer')
-rw-r--r-- | vcl/unx/generic/printer/cupsmgr.cxx | 6 | ||||
-rw-r--r-- | vcl/unx/generic/printer/jobdata.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/printer/ppdparser.cxx | 20 | ||||
-rw-r--r-- | vcl/unx/generic/printer/printerinfomanager.cxx | 18 |
4 files changed, 23 insertions, 23 deletions
diff --git a/vcl/unx/generic/printer/cupsmgr.cxx b/vcl/unx/generic/printer/cupsmgr.cxx index 85c2e74b00b3..a0e020a9ae05 100644 --- a/vcl/unx/generic/printer/cupsmgr.cxx +++ b/vcl/unx/generic/printer/cupsmgr.cxx @@ -291,7 +291,7 @@ struct GetPPDAttribs ~GetPPDAttribs() { - if( m_aResult.getLength() ) + if( !m_aResult.isEmpty() ) unlink( m_aResult.getStr() ); } @@ -646,7 +646,7 @@ void CUPSManager::initialize() if( m_aCUPSDestMap.find( it->first ) != m_aCUPSDestMap.end() ) continue; - if( it->second.m_aInfo.m_aFeatures.getLength() > 0 ) + if( !it->second.m_aInfo.m_aFeatures.isEmpty() ) continue; aRemovePrinters.push_back( it->first ); } @@ -732,7 +732,7 @@ const PPDParser* CUPSManager::createCUPSParser( const OUString& rPrinter ) #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "PPD for %s is %s\n", OUStringToOString( aPrinter, osl_getThreadTextEncoding() ).getStr(), aPPDFile.getStr() ); #endif - if( aPPDFile.getLength() ) + if( !aPPDFile.isEmpty() ) { rtl_TextEncoding aEncoding = osl_getThreadTextEncoding(); OUString aFileName( OStringToOUString( aPPDFile, aEncoding ) ); diff --git a/vcl/unx/generic/printer/jobdata.cxx b/vcl/unx/generic/printer/jobdata.cxx index bb059f02579d..9bd1d57b54af 100644 --- a/vcl/unx/generic/printer/jobdata.cxx +++ b/vcl/unx/generic/printer/jobdata.cxx @@ -54,7 +54,7 @@ JobData& JobData::operator=(const JobData& rRight) m_nPDFDevice = rRight.m_nPDFDevice; m_nColorDevice = rRight.m_nColorDevice; - if( ! m_pParser && m_aPrinterName.getLength() ) + if( !m_pParser && !m_aPrinterName.isEmpty() ) { PrinterInfoManager& rMgr = PrinterInfoManager::get(); rMgr.setupJobContextData( *this ); diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx index 98bf630f4e21..fdb0f4ed3bd5 100644 --- a/vcl/unx/generic/printer/ppdparser.cxx +++ b/vcl/unx/generic/printer/ppdparser.cxx @@ -138,7 +138,7 @@ namespace psp ) { com::sun::star::lang::Locale aLoc( i_rLocale ); - if( bInsertDefault && aLoc.Language.getLength() == 0 ) + if( bInsertDefault && aLoc.Language.isEmpty() ) { // empty locale requested, fill in application UI locale aLoc = Application::GetSettings().GetUILocale(); @@ -175,17 +175,17 @@ namespace psp { rtl::OUStringBuffer aKey( i_rKey.getLength() + i_rOption.getLength() + i_rValue.getLength() + 2 ); aKey.append( i_rKey ); - if( i_rOption.getLength() || i_rValue.getLength() ) + if( !i_rOption.isEmpty() || !i_rValue.isEmpty() ) { aKey.append( sal_Unicode( ':' ) ); aKey.append( i_rOption ); } - if( i_rValue.getLength() ) + if( !i_rValue.isEmpty() ) { aKey.append( sal_Unicode( ':' ) ); aKey.append( i_rValue ); } - if( aKey.getLength() && i_rTranslation.getLength() ) + if( aKey.getLength() && !i_rTranslation.isEmpty() ) { rtl::OUString aK( aKey.makeStringAndClear() ); com::sun::star::lang::Locale aLoc; @@ -207,12 +207,12 @@ namespace psp rtl::OUStringBuffer aKey( i_rKey.getLength() + i_rOption.getLength() + i_rValue.getLength() + 2 ); aKey.append( i_rKey ); - if( i_rOption.getLength() || i_rValue.getLength() ) + if( !i_rOption.isEmpty() || !i_rValue.isEmpty() ) { aKey.append( sal_Unicode( ':' ) ); aKey.append( i_rOption ); } - if( i_rValue.getLength() ) + if( !i_rValue.isEmpty() ) { aKey.append( sal_Unicode( ':' ) ); aKey.append( i_rValue ); @@ -1159,9 +1159,9 @@ void PPDParser::parse( ::std::list< rtl::OString >& rLines ) pValue->m_eType = eType; pValue->m_aValue = aValue; - if( aOptionTranslation.getLength() ) + if( !aOptionTranslation.isEmpty() ) m_pTranslator->insertOption( aUniKey, aOption, aOptionTranslation, aTransLocale ); - if( aValueTranslation.getLength() ) + if( !aValueTranslation.isEmpty() ) m_pTranslator->insertValue( aUniKey, aOption, aValue, aValueTranslation, aTransLocale ); // eventually update query and remove from option list @@ -1511,7 +1511,7 @@ rtl::OUString PPDParser::translateKey( const rtl::OUString& i_rKey, const com::sun::star::lang::Locale& i_rLocale ) const { rtl::OUString aResult( m_pTranslator->translateKey( i_rKey, i_rLocale ) ); - if( aResult.getLength() == 0 ) + if( aResult.isEmpty() ) aResult = i_rKey; return aResult; } @@ -1521,7 +1521,7 @@ rtl::OUString PPDParser::translateOption( const rtl::OUString& i_rKey, const com::sun::star::lang::Locale& i_rLocale ) const { rtl::OUString aResult( m_pTranslator->translateOption( i_rKey, i_rOption, i_rLocale ) ); - if( aResult.getLength() == 0 ) + if( aResult.isEmpty() ) aResult = i_rOption; return aResult; } diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx index be113e1f5a2a..f538b9497914 100644 --- a/vcl/unx/generic/printer/printerinfomanager.cxx +++ b/vcl/unx/generic/printer/printerinfomanager.cxx @@ -594,7 +594,7 @@ void PrinterInfoManager::initialize() aMergeInfo.m_aDriverName = String( RTL_CONSTASCII_USTRINGPARAM( "SGENPRT" ) ); aMergeInfo.m_aFeatures = String( RTL_CONSTASCII_USTRINGPARAM( "autoqueue" ) ); - if( m_aDefaultPrinter.getLength() ) + if( !m_aDefaultPrinter.isEmpty() ) { PrinterInfo aDefaultInfo( getPrinterInfo( m_aDefaultPrinter ) ); aMergeInfo.m_bPerformFontSubstitution = aDefaultInfo.m_bPerformFontSubstitution; @@ -727,13 +727,13 @@ bool PrinterInfoManager::writePrinterConfig() while( nIndex != -1 && ! bAutoQueue ) { OUString aToken( it->second.m_aInfo.m_aFeatures.getToken( 0, ',', nIndex ) ); - if( aToken.getLength() && aToken.compareToAscii( "autoqueue" ) == 0 ) + if( !aToken.isEmpty() && aToken.compareToAscii( "autoqueue" ) == 0 ) bAutoQueue = true; } if( bAutoQueue ) continue; - if( it->second.m_aFile.getLength() ) + if( !it->second.m_aFile.isEmpty() ) { // check if file is writable if( files.find( it->second.m_aFile ) == files.end() ) @@ -766,7 +766,7 @@ bool PrinterInfoManager::writePrinterConfig() else // a new printer, write it to the first file available it->second.m_aFile = files.begin()->first; - if( ! it->second.m_aGroup.getLength() ) // probably a new printer + if( it->second.m_aGroup.isEmpty() ) // probably a new printer it->second.m_aGroup = OString( it->first.getStr(), it->first.getLength(), RTL_TEXTENCODING_UTF8 ); if( files.find( it->second.m_aFile ) != files.end() ) @@ -903,7 +903,7 @@ bool PrinterInfoManager::removePrinter( const OUString& rPrinterName, bool bChec ::boost::unordered_map< OUString, Printer, OUStringHash >::iterator it = m_aPrinters.find( rPrinterName ); if( it != m_aPrinters.end() ) { - if( it->second.m_aFile.getLength() ) + if( !it->second.m_aFile.isEmpty() ) { // this printer already exists in a config file @@ -1122,7 +1122,7 @@ bool PrinterInfoManager::checkFeatureToken( const rtl::OUString& rPrinterName, c FILE* PrinterInfoManager::startSpool( const OUString& rPrintername, bool bQuickCommand ) { const PrinterInfo& rPrinterInfo = getPrinterInfo (rPrintername); - const rtl::OUString& rCommand = (bQuickCommand && rPrinterInfo.m_aQuickCommand.getLength() ) ? + const rtl::OUString& rCommand = (bQuickCommand && !rPrinterInfo.m_aQuickCommand.isEmpty() ) ? rPrinterInfo.m_aQuickCommand : rPrinterInfo.m_aCommand; rtl::OString aShellCommand = rtl::OUStringToOString (rCommand, RTL_TEXTENCODING_ISO_8859_1); aShellCommand += rtl::OString( " 2>/dev/null" ); @@ -1279,7 +1279,7 @@ static void lpgetSysQueueTokenHandler( while( nPos != -1 ) { OString aTok( aClean.getToken( 0, ',', nPos ) ); - if( aTok.getLength() > 0 ) + if( !aTok.isEmpty() ) aOnlySet.insert( rtl::OStringToOUString( aTok, aEncoding ) ); } break; @@ -1325,7 +1325,7 @@ static void lpgetSysQueueTokenHandler( if( nPos != -1 ) { rtl::OString aComment( WhitespaceToSpace( it->copy(nPos+12) ) ); - if( aComment.getLength() > 0 ) + if( !aComment.isEmpty() ) o_rQueues.back().m_aComment = rtl::OStringToOUString(aComment, aEncoding); continue; } @@ -1334,7 +1334,7 @@ static void lpgetSysQueueTokenHandler( if( nPos != -1 ) { rtl::OString aLoc( WhitespaceToSpace( it->copy(nPos+9) ) ); - if( aLoc.getLength() > 0 ) + if( !aLoc.isEmpty() ) o_rQueues.back().m_aLocation = rtl::OStringToOUString(aLoc, aEncoding); continue; } |