diff options
author | Olivier Hallot <olivier.hallot@alta.org.br> | 2012-01-18 23:47:02 -0200 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@alta.org.br> | 2012-01-18 23:48:47 -0200 |
commit | 80fb2e397a60550de72b378215c2e305b29257a9 (patch) | |
tree | befc5cc4cd89e129597247dd0e3d80a7fb8cc35f /ucb/source/ucp/tdoc | |
parent | 3e04e08d371532960917afbcd59307fbd6c1f313 (diff) |
Fix for fdo43460 Part L getLength() to isEmpty()
Part L
Modules
ucb
Diffstat (limited to 'ucb/source/ucp/tdoc')
-rw-r--r-- | ucb/source/ucp/tdoc/tdoc_content.cxx | 18 | ||||
-rw-r--r-- | ucb/source/ucp/tdoc/tdoc_datasupplier.cxx | 8 | ||||
-rw-r--r-- | ucb/source/ucp/tdoc/tdoc_docmgr.cxx | 6 | ||||
-rw-r--r-- | ucb/source/ucp/tdoc/tdoc_provider.cxx | 4 | ||||
-rw-r--r-- | ucb/source/ucp/tdoc/tdoc_storage.cxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/tdoc/tdoc_uri.cxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/tdoc/tdoc_uri.hxx | 2 |
7 files changed, 21 insertions, 21 deletions
diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx index 19400a6e7ce9..a8634a6d1f87 100644 --- a/ucb/source/ucp/tdoc/tdoc_content.cxx +++ b/ucb/source/ucp/tdoc/tdoc_content.cxx @@ -132,7 +132,7 @@ Content* Content::create( const uno::Reference< ucb::XContentIdentifier >& Identifier, const ucb::ContentInfo& Info ) { - if ( !Info.Type.getLength() ) + if ( Info.Type.isEmpty() ) return 0; if ( !Info.Type.equalsAsciiL( @@ -739,7 +739,7 @@ Content::createNewContent( const ucb::ContentInfo& Info ) { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - if ( !Info.Type.getLength() ) + if ( Info.Type.isEmpty() ) return uno::Reference< ucb::XContent >(); sal_Bool bCreateFolder = @@ -765,7 +765,7 @@ Content::createNewContent( const ucb::ContentInfo& Info ) rtl::OUString aURL = m_xIdentifier->getContentIdentifier(); - OSL_ENSURE( aURL.getLength() > 0, + OSL_ENSURE( !aURL.isEmpty(), "Content::createNewContent - empty identifier!" ); if ( ( aURL.lastIndexOf( '/' ) + 1 ) != aURL.getLength() ) @@ -1275,7 +1275,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( if ( rValue.Value >>= aNewValue ) { // No empty titles! - if ( aNewValue.getLength() > 0 ) + if ( !aNewValue.isEmpty() ) { if ( aNewValue != m_aProps.getTitle() ) { @@ -1439,7 +1439,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( } } - if ( aOldTitle.getLength() ) + if ( !aOldTitle.isEmpty() ) { aEvent.PropertyName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title")); aEvent.OldValue = uno::makeAny( aOldTitle ); @@ -1708,7 +1708,7 @@ void Content::insert( const uno::Reference< io::XInputStream >& xData, { // Required: Title - if ( m_aProps.getTitle().getLength() == 0 ) + if ( m_aProps.getTitle().isEmpty() ) m_aProps.setTitle( aUri.getDecodedName() ); } else // stream @@ -1727,7 +1727,7 @@ void Content::insert( const uno::Reference< io::XInputStream >& xData, // Required: Title - if ( m_aProps.getTitle().getLength() == 0 ) + if ( m_aProps.getTitle().isEmpty() ) m_aProps.setTitle( aUri.getDecodedName() ); } @@ -2169,7 +2169,7 @@ void Content::transfer( // Copy data. ///////////////////////////////////////////////////////////////////////// - rtl::OUString aNewName( rInfo.NewTitle.getLength() > 0 + rtl::OUString aNewName( !rInfo.NewTitle.isEmpty() ? rInfo.NewTitle : aSourceUri.getDecodedName() ); @@ -2201,7 +2201,7 @@ void Content::transfer( if ( ( aTargetUri.lastIndexOf( '/' ) + 1 ) != aTargetUri.getLength() ) aTargetUri += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); - if ( rInfo.NewTitle.getLength() > 0 ) + if ( !rInfo.NewTitle.isEmpty() ) aTargetUri += ::ucb_impl::urihelper::encodeSegment( rInfo.NewTitle ); else aTargetUri += aSourceUri.getName(); diff --git a/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx b/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx index 8e545b9f1750..87dc380412af 100644 --- a/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx +++ b/ucb/source/ucp/tdoc/tdoc_datasupplier.cxx @@ -149,7 +149,7 @@ ResultSetDataSupplier::queryContentIdentifierString( sal_uInt32 nIndex ) if ( nIndex < m_pImpl->m_aResults.size() ) { rtl::OUString aId = m_pImpl->m_aResults[ nIndex ]->aURL; - if ( aId.getLength() ) + if ( !aId.isEmpty() ) { // Already cached. return aId; @@ -183,7 +183,7 @@ ResultSetDataSupplier::queryContentIdentifier( sal_uInt32 nIndex ) } rtl::OUString aId = queryContentIdentifierString( nIndex ); - if ( aId.getLength() ) + if ( !aId.isEmpty() ) { uno::Reference< ucb::XContentIdentifier > xId = new ::ucbhelper::ContentIdentifier( aId ); @@ -262,7 +262,7 @@ sal_Bool ResultSetDataSupplier::getResult( sal_uInt32 nIndex ) const rtl::OUString & rName = m_pImpl->m_pNamesOfChildren->getConstArray()[ n ]; - if ( !rName.getLength() ) + if ( rName.isEmpty() ) { OSL_FAIL( "ResultDataSupplier::getResult - Empty name!" ); break; @@ -322,7 +322,7 @@ sal_uInt32 ResultSetDataSupplier::totalCount() const rtl::OUString & rName = m_pImpl->m_pNamesOfChildren->getConstArray()[ n ]; - if ( !rName.getLength() ) + if ( rName.isEmpty() ) { OSL_FAIL( "ResultDataSupplier::getResult - Empty name!" ); break; diff --git a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx index 78dd66fd2bfd..e9f064e26519 100644 --- a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx +++ b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx @@ -170,7 +170,7 @@ getDocumentId( const uno::Reference< uno::XInterface > & xDoc ) } } - if ( aId.getLength() == 0 ) + if ( aId.isEmpty() ) { // fallback: generate UID from document's this pointer. // normalize the interface pointer first. Else, calls with different @@ -181,7 +181,7 @@ getDocumentId( const uno::Reference< uno::XInterface > & xDoc ) aId = rtl::OUString::valueOf( nId ); } - OSL_ENSURE( aId.getLength() > 0, "getDocumentId - Empty id!" ); + OSL_ENSURE( !aId.isEmpty(), "getDocumentId - Empty id!" ); return aId; } @@ -741,7 +741,7 @@ bool OfficeDocumentsManager::isBasicIDE( OSL_FAIL( "Caught UnknownModuleException!" ); } - if ( aModule.getLength() > 0 ) + if ( !aModule.isEmpty() ) { // Filter unwanted items, that are no real documents. if ( aModule.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( diff --git a/ucb/source/ucp/tdoc/tdoc_provider.cxx b/ucb/source/ucp/tdoc/tdoc_provider.cxx index 9b983d5111e3..be5a4f1920fb 100644 --- a/ucb/source/ucp/tdoc/tdoc_provider.cxx +++ b/ucb/source/ucp/tdoc/tdoc_provider.cxx @@ -172,7 +172,7 @@ ContentProvider::createDocumentContent( if ( m_xDocsMgr.is() ) { rtl::OUString aDocId = m_xDocsMgr->queryDocumentId( Model ); - if ( aDocId.getLength() > 0 ) + if ( !aDocId.isEmpty() ) { rtl::OUStringBuffer aBuffer; aBuffer.appendAscii( TDOC_URL_SCHEME ":/" ); @@ -603,7 +603,7 @@ ContentProvider::queryStorageTitle( const rtl::OUString & rUri ) const aTitle = aUri.getDecodedName(); } - OSL_ENSURE( ( aTitle.getLength() > 0 ) || aUri.isRoot(), + OSL_ENSURE( !aTitle.isEmpty() || aUri.isRoot(), "ContentProvider::queryStorageTitle - empty title!" ); return aTitle; } diff --git a/ucb/source/ucp/tdoc/tdoc_storage.cxx b/ucb/source/ucp/tdoc/tdoc_storage.cxx index 8d1f1f71ab95..a395bf548008 100644 --- a/ucb/source/ucp/tdoc/tdoc_storage.cxx +++ b/ucb/source/ucp/tdoc/tdoc_storage.cxx @@ -648,7 +648,7 @@ StorageElementFactory::queryStream( // No object re-usage mechanism; streams are seekable => not stateless. uno::Reference< io::XStream > xStream; - if ( rPassword.getLength() > 0 ) + if ( !rPassword.isEmpty() ) { if ( eMode == READ ) { diff --git a/ucb/source/ucp/tdoc/tdoc_uri.cxx b/ucb/source/ucp/tdoc/tdoc_uri.cxx index cf7097cee42d..5da084d9de41 100644 --- a/ucb/source/ucp/tdoc/tdoc_uri.cxx +++ b/ucb/source/ucp/tdoc/tdoc_uri.cxx @@ -120,7 +120,7 @@ void Uri::init() const m_aDocId = m_aPath.copy( 1, nSlash - 1 ); } - if ( m_aDocId.getLength() > 0 ) + if ( !m_aDocId.isEmpty() ) { sal_Int32 nSlash = m_aPath.indexOf( '/', 1 ); if ( nSlash != - 1 ) diff --git a/ucb/source/ucp/tdoc/tdoc_uri.hxx b/ucb/source/ucp/tdoc/tdoc_uri.hxx index 363fb2746127..7bd8aa595170 100644 --- a/ucb/source/ucp/tdoc/tdoc_uri.hxx +++ b/ucb/source/ucp/tdoc/tdoc_uri.hxx @@ -117,7 +117,7 @@ inline sal_Bool Uri::isRoot() const inline sal_Bool Uri::isDocument() const { init(); - return ( ( m_aDocId.getLength() > 0 ) /* not root */ + return ( ( !m_aDocId.isEmpty() ) /* not root */ && ( m_aPath.copy( m_aDocId.getLength() + 1 ).getLength() < 2 ) ); } |