From fffd541c3e626bee162ab4b473b6bd6cd180244e Mon Sep 17 00:00:00 2001 From: Olivier Hallot Date: Thu, 5 Jan 2012 14:15:36 -0200 Subject: Fix for fdo43460 Part XXIX getLength() to isEmpty() Part XXIX Modules sax, scaddins, sccomp, scripting --- sax/source/expatwrap/sax_expat.cxx | 2 +- sax/source/expatwrap/saxwriter.cxx | 2 +- sax/source/expatwrap/xml2utf.cxx | 4 ++-- sax/source/fastparser/fastparser.cxx | 6 +++--- sax/source/tools/converter.cxx | 2 +- sax/source/tools/fastserializer.cxx | 6 +++--- 6 files changed, 11 insertions(+), 11 deletions(-) (limited to 'sax') diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx index bd65a52855f8..7e57583ccccf 100644 --- a/sax/source/expatwrap/sax_expat.cxx +++ b/sax/source/expatwrap/sax_expat.cxx @@ -472,7 +472,7 @@ void SaxExpatParser::parseStream( const InputSource& structSource) } entity.converter.setInputStream( entity.structSource.aInputStream ); - if( entity.structSource.sEncoding.getLength() ) + if( !entity.structSource.sEncoding.isEmpty() ) { entity.converter.setEncoding( OUStringToOString( entity.structSource.sEncoding , RTL_TEXTENCODING_ASCII_US ) ); diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx index f0869b072bc4..3969eb33d779 100644 --- a/sax/source/expatwrap/saxwriter.cxx +++ b/sax/source/expatwrap/saxwriter.cxx @@ -1252,7 +1252,7 @@ void SAXWriter::characters(const OUString& aChars) throw(SAXException, RuntimeE } sal_Bool bThrowException(sal_False); - if( aChars.getLength() ) + if( !aChars.isEmpty() ) { if( m_bIsCDATA ) bThrowException = !mp_SaxWriterHelper->writeString( aChars, sal_False, sal_False ); diff --git a/sax/source/expatwrap/xml2utf.cxx b/sax/source/expatwrap/xml2utf.cxx index b7aa1cad0424..edebc8a8e290 100644 --- a/sax/source/expatwrap/xml2utf.cxx +++ b/sax/source/expatwrap/xml2utf.cxx @@ -93,7 +93,7 @@ sal_Int32 XMLFile2UTFConverter::readAndConvert( Sequence &seq , sal_In // read more ! continue; } - if( scanForEncoding( seq ) || m_sEncoding.getLength() ) { + if( scanForEncoding( seq ) || !m_sEncoding.isEmpty() ) { // initialize decoding initializeDecoding(); } @@ -340,7 +340,7 @@ sal_Bool XMLFile2UTFConverter::scanForEncoding( Sequence< sal_Int8 > &seq ) void XMLFile2UTFConverter::initializeDecoding() { - if( m_sEncoding.getLength() ) + if( !m_sEncoding.isEmpty() ) { rtl_TextEncoding encoding = rtl_getTextEncodingFromMimeCharset( m_sEncoding.getStr() ); if( encoding != RTL_TEXTENCODING_UTF8 ) diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index df7dcfcb36f1..3480628813f0 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -446,7 +446,7 @@ void FastSaxParser::parseStream( const InputSource& maStructSource) throw (SAXEx throw SAXException( OUString( RTL_CONSTASCII_USTRINGPARAM( "No input source" ) ), Reference< XInterface >(), Any() ); entity.maConverter.setInputStream( entity.maStructSource.aInputStream ); - if( entity.maStructSource.sEncoding.getLength() ) + if( !entity.maStructSource.sEncoding.isEmpty() ) entity.maConverter.setEncoding( OUStringToOString( entity.maStructSource.sEncoding, RTL_TEXTENCODING_ASCII_US ) ); // create parser with proper encoding @@ -776,7 +776,7 @@ void FastSaxParser::callbackStartElement( const XML_Char* pwName, const XML_Char // #158414# second: fill attribute list with other attributes for( ::std::vector< AttributeData >::const_iterator aIt = aAttribs.begin(), aEnd = aAttribs.end(); aIt != aEnd; ++aIt ) { - if( aIt->maPrefix.getLength() > 0 ) + if( !aIt->maPrefix.isEmpty() ) { sal_Int32 nAttributeToken = GetTokenWithPrefix( aIt->maPrefix, aIt->maName ); if( nAttributeToken != FastToken::DONTKNOW ) @@ -798,7 +798,7 @@ void FastSaxParser::callbackStartElement( const XML_Char* pwName, const XML_Char splitName( pwName, pPrefix, nPrefixLen, pName, nNameLen ); if( nPrefixLen > 0 ) nElementToken = GetTokenWithPrefix( pPrefix, nPrefixLen, pName, nNameLen ); - else if( rEntity.maContextStack.top()->maNamespace.getLength() > 0 ) + else if( !rEntity.maContextStack.top()->maNamespace.isEmpty() ) nElementToken = GetTokenWithNamespaceURL( rEntity.maContextStack.top()->maNamespace, pName, nNameLen ); else nElementToken = GetToken( pName ); diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx index f2dea8a9a1a3..698dea826ba2 100644 --- a/sax/source/tools/converter.cxx +++ b/sax/source/tools/converter.cxx @@ -1038,7 +1038,7 @@ bool Converter::convertDuration(util::Duration& rDuration, sal_Int32 nPos(0); bool bIsNegativeDuration(false); - if (string.getLength() && (sal_Unicode('-') == string[0])) + if (!string.isEmpty() && (sal_Unicode('-') == string[0])) { bIsNegativeDuration = true; ++nPos; diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx index ebd0467caade..67db04b1268e 100644 --- a/sax/source/tools/fastserializer.cxx +++ b/sax/source/tools/fastserializer.cxx @@ -157,7 +157,7 @@ namespace sax_fastparser { writeBytes(toUnoSequence(aOpeningBracket)); - if (Namespace.getLength()) + if (!Namespace.isEmpty()) { write(Namespace); writeBytes(toUnoSequence(aColon)); @@ -191,7 +191,7 @@ namespace sax_fastparser { writeBytes(toUnoSequence(aOpeningBracketAndSlash)); - if (Namespace.getLength()) + if (!Namespace.isEmpty()) { write(Namespace); writeBytes(toUnoSequence(aColon)); @@ -227,7 +227,7 @@ namespace sax_fastparser { writeBytes(toUnoSequence(aOpeningBracket)); - if (Namespace.getLength()) + if (!Namespace.isEmpty()) { write(Namespace); writeBytes(toUnoSequence(aColon)); -- cgit