summaryrefslogtreecommitdiffstats
path: root/vcl
diff options
context:
space:
mode:
authorChr. Rossmanith <ChrRossmanith@gmx.de>2012-02-27 18:49:17 +0530
committerMuthu Subramanian <sumuthu@suse.com>2012-02-27 18:50:20 +0530
commit5d1acca5a9d40d6197e12fd959c3644bcc60f799 (patch)
tree62b86a10aff70412eddf058044993cbc9d908e36 /vcl
parentfdo#46675: fixup (diff)
downloadcore-5d1acca5a9d40d6197e12fd959c3644bcc60f799.tar.gz
core-5d1acca5a9d40d6197e12fd959c3644bcc60f799.zip
Replace getLength() with isEmpty() where appropriate
Diffstat (limited to 'vcl')
-rw-r--r--vcl/aqua/source/app/salinst.cxx6
-rw-r--r--vcl/aqua/source/app/salsys.cxx4
-rw-r--r--vcl/aqua/source/dtrans/HtmlFmtFlt.cxx4
-rw-r--r--vcl/aqua/source/dtrans/PictToBmpFlt.cxx4
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx5
-rw-r--r--vcl/source/gdi/print3.cxx2
6 files changed, 12 insertions, 13 deletions
diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx
index 7a01b0b0c102..794dd840078f 100644
--- a/vcl/aqua/source/app/salinst.cxx
+++ b/vcl/aqua/source/app/salinst.cxx
@@ -997,7 +997,7 @@ rtl::OUString AquaSalInstance::GetDefaultPrinter()
// #i113170# may not be the main thread if called from UNO API
SalData::ensureThreadAutoreleasePool();
- if( ! maDefaultPrinter.getLength() )
+ if( maDefaultPrinter.isEmpty() )
{
NSPrintInfo* pPI = [NSPrintInfo sharedPrintInfo];
DBG_ASSERT( pPI, "no print info" );
@@ -1138,10 +1138,10 @@ void AquaSalInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, con
{
// Convert file URL for external use (see above)
rtl::OUString externalUrl = translateToExternalUrl(rFileUrl);
- if( 0 == externalUrl.getLength() )
+ if( externalUrl.isEmpty() )
externalUrl = rFileUrl;
- if( externalUrl.getLength() && !isDangerousUrl( externalUrl ) )
+ if( !externalUrl.isEmpty() && !isDangerousUrl( externalUrl ) )
{
NSString* pString = CreateNSString( externalUrl );
NSURL* pURL = [NSURL URLWithString: pString];
diff --git a/vcl/aqua/source/app/salsys.cxx b/vcl/aqua/source/app/salsys.cxx
index 8a371d6bf1cd..7c6f683751c8 100644
--- a/vcl/aqua/source/app/salsys.cxx
+++ b/vcl/aqua/source/app/salsys.cxx
@@ -109,7 +109,7 @@ rtl::OUString AquaSalSystem::GetDisplayScreenName( unsigned int nScreen )
static NSString* getStandardString( int nButtonId )
{
rtl::OUString aText( Button::GetStandardText( nButtonId ) );
- if( ! aText.getLength() ) // this is for bad cases, we might be missing the vcl resource
+ if( aText.isEmpty() ) // this is for bad cases, we might be missing the vcl resource
{
switch( nButtonId )
{
@@ -121,7 +121,7 @@ static NSString* getStandardString( int nButtonId )
case BUTTON_NO : aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "No" ) );break;
}
}
- return aText.getLength() ? CreateNSString( aText) : nil;
+ return aText.isEmpty() ? nil : CreateNSString( aText);
}
int AquaSalSystem::ShowNativeMessageBox( const rtl::OUString& rTitle,
diff --git a/vcl/aqua/source/dtrans/HtmlFmtFlt.cxx b/vcl/aqua/source/dtrans/HtmlFmtFlt.cxx
index 0bd461d81096..275f5a1cf2a5 100644
--- a/vcl/aqua/source/dtrans/HtmlFmtFlt.cxx
+++ b/vcl/aqua/source/dtrans/HtmlFmtFlt.cxx
@@ -65,9 +65,9 @@ const std::string TAG_END_BODY = std::string("</BODY");
Sequence<sal_Int8> SAL_CALL TextHtmlToHTMLFormat(Sequence<sal_Int8>& aTextHtml)
{
- OSL_ASSERT(aTextHtml.getLength() > 0);
+ OSL_ASSERT(!aTextHtml.isEmpty());
- if (!(aTextHtml.getLength() > 0))
+ if (aTextHtml.isEmpty())
return Sequence<sal_Int8>();
// fill the buffer with dummy values to calc the exact length
diff --git a/vcl/aqua/source/dtrans/PictToBmpFlt.cxx b/vcl/aqua/source/dtrans/PictToBmpFlt.cxx
index 3eb4fb8d49fc..4b3d3712e36b 100644
--- a/vcl/aqua/source/dtrans/PictToBmpFlt.cxx
+++ b/vcl/aqua/source/dtrans/PictToBmpFlt.cxx
@@ -161,7 +161,7 @@ bool ImageToBMP( com::sun::star::uno::Sequence<sal_Int8>& aPict,
{
aBmp.realloc( [pOut length] );
[pOut getBytes: aBmp.getArray() length: aBmp.getLength()];
- bResult = (aBmp.getLength() != 0);
+ bResult = (!aBmp.isEmpty());
}
}
}
@@ -190,7 +190,7 @@ bool BMPToImage( com::sun::star::uno::Sequence<sal_Int8>& aBmp,
{
aPict.realloc( [pOut length] );
[pOut getBytes: aPict.getArray() length: aPict.getLength()];
- bResult = (aPict.getLength() != 0);
+ bResult = (!aPict.isEmpty());
}
}
}
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 8456d866f73f..3820d81eff4a 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -6698,11 +6698,10 @@ PDFStreamIf::~PDFStreamIf()
void SAL_CALL PDFStreamIf::writeBytes( const com::sun::star::uno::Sequence< sal_Int8 >& aData ) throw()
{
- if( m_bWrite )
+ if( m_bWrite && aData.getLength() )
{
sal_Int32 nBytes = aData.getLength();
- if( nBytes > 0 )
- m_pWriter->writeBuffer( aData.getConstArray(), nBytes );
+ m_pWriter->writeBuffer( aData.getConstArray(), nBytes );
}
}
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 482491d2c41a..abdece652ae1 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -1336,7 +1336,7 @@ void PrinterController::setValue( const beans::PropertyValue& i_rValue )
void PrinterController::setUIOptions( const Sequence< beans::PropertyValue >& i_rOptions )
{
- DBG_ASSERT( mpImplData->maUIOptions.getLength() == 0, "setUIOptions called twice !" );
+ DBG_ASSERT( mpImplData->maUIOptions.isEmpty(), "setUIOptions called twice !" );
mpImplData->maUIOptions = i_rOptions;