diff options
author | Olivier Hallot <olivier.hallot@alta.org.br> | 2011-12-21 19:54:11 -0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-12-22 14:26:46 +0000 |
commit | 7c0c3362de894ddd4526f56e1849f116eb25cedd (patch) | |
tree | 997471cefa62eaf2cb7be3c6782690ce0d919159 /embeddedobj/source/commonembedding | |
parent | 7248aaed7aca6c241683f6d83bb6caa00c447b0d (diff) |
Fix for fdo43460 Part XV getLength() to isEmpty()
Part XV
Module
embeddeobj
Diffstat (limited to 'embeddedobj/source/commonembedding')
-rw-r--r-- | embeddedobj/source/commonembedding/persistence.cxx | 34 | ||||
-rw-r--r-- | embeddedobj/source/commonembedding/xfactory.cxx | 22 |
2 files changed, 28 insertions, 28 deletions
diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx index 8afe92d881b1..654e221ee892 100644 --- a/embeddedobj/source/commonembedding/persistence.cxx +++ b/embeddedobj/source/commonembedding/persistence.cxx @@ -246,7 +246,7 @@ static void SetDocToEmbedded( const uno::Reference< frame::XModel > xDocument, c aSeq[0].Value <<= sal_True; xDocument->attachResource( ::rtl::OUString(), aSeq ); - if ( aModuleName.getLength() ) + if ( !aModuleName.isEmpty() ) { try { @@ -465,7 +465,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadLink_Impl() ::rtl::OUString OCommonEmbeddedObject::GetFilterName( sal_Int32 nVersion ) const { ::rtl::OUString aFilterName = GetPresetFilterName(); - if ( !aFilterName.getLength() ) + if ( aFilterName.isEmpty() ) { try { ::comphelper::MimeConfigurationHelper aHelper( m_xFactory ); @@ -486,8 +486,8 @@ void OCommonEmbeddedObject::FillDefaultLoadArgs_Impl( const uno::Reference< embe o_rLoadArgs.put( "ReadOnly", m_bReadOnly ); ::rtl::OUString aFilterName = GetFilterName( ::comphelper::OStorageHelper::GetXStorageFormat( i_rxStorage ) ); - OSL_ENSURE( aFilterName.getLength(), "OCommonEmbeddedObject::FillDefaultLoadArgs_Impl: Wrong document service name!" ); - if ( !aFilterName.getLength() ) + OSL_ENSURE( !aFilterName.isEmpty(), "OCommonEmbeddedObject::FillDefaultLoadArgs_Impl: Wrong document service name!" ); + if ( aFilterName.isEmpty() ) throw io::IOException(); // TODO: error message/code o_rLoadArgs.put( "FilterName", aFilterName ); @@ -543,7 +543,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorag { } - OSL_ENSURE( aTempFileURL.getLength(), "Coudn't retrieve temporary file URL!\n" ); + OSL_ENSURE( !aTempFileURL.isEmpty(), "Coudn't retrieve temporary file URL!\n" ); aLoadArgs.put( "URL", aTempFileURL ); aLoadArgs.put( "InputStream", xTempInpStream ); @@ -613,8 +613,8 @@ uno::Reference< io::XInputStream > OCommonEmbeddedObject::StoreDocumentToTempStr ::rtl::OUString aFilterName = GetFilterName( nStorageFormat ); - OSL_ENSURE( aFilterName.getLength(), "Wrong document service name!" ); - if ( !aFilterName.getLength() ) + OSL_ENSURE( !aFilterName.isEmpty(), "Wrong document service name!" ); + if ( aFilterName.isEmpty() ) throw io::IOException(); // TODO: uno::Sequence< beans::PropertyValue > aArgs( 4 ); @@ -692,7 +692,7 @@ void OCommonEmbeddedObject::SaveObject_Impl() {} } - if ( !aBaseURL.getLength() ) + if ( aBaseURL.isEmpty() ) { for ( nInd = 0; nInd < m_aDocMediaDescriptor.getLength(); nInd++ ) if ( m_aDocMediaDescriptor[nInd].Name.equals( @@ -703,7 +703,7 @@ void OCommonEmbeddedObject::SaveObject_Impl() } } - if ( !aBaseURL.getLength() ) + if ( aBaseURL.isEmpty() ) aBaseURL = m_aDefaultParentBaseURL; return aBaseURL; @@ -724,7 +724,7 @@ void OCommonEmbeddedObject::SaveObject_Impl() break; } - if ( !aBaseURL.getLength() ) + if ( aBaseURL.isEmpty() ) { for ( nInd = 0; nInd < lObjArgs.getLength(); nInd++ ) if ( lObjArgs[nInd].Name.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultParentBaseURL" ) ) ) ) @@ -775,8 +775,8 @@ void OCommonEmbeddedObject::StoreDocToStorage_Impl( const uno::Reference< embed: { ::rtl::OUString aFilterName = GetFilterName( nStorageFormat ); - OSL_ENSURE( aFilterName.getLength(), "Wrong document service name!" ); - if ( !aFilterName.getLength() ) + OSL_ENSURE( !aFilterName.isEmpty(), "Wrong document service name!" ); + if ( aFilterName.isEmpty() ) throw io::IOException(); // TODO: uno::Sequence< beans::PropertyValue > aArgs( 3 ); @@ -896,7 +896,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::CreateTempDocFromLink_ { } - OSL_ENSURE( aTempFileURL.getLength(), "Couldn't retrieve temporary file URL!\n" ); + OSL_ENSURE( !aTempFileURL.isEmpty(), "Couldn't retrieve temporary file URL!\n" ); aTempMediaDescr[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "URL" )); aTempMediaDescr[0].Value <<= aTempFileURL; @@ -948,7 +948,7 @@ void SAL_CALL OCommonEmbeddedObject::setPersistentEntry( uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 1 ); - if ( !sEntName.getLength() ) + if ( sEntName.isEmpty() ) throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Empty element name is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 2 ); @@ -1717,9 +1717,9 @@ void SAL_CALL OCommonEmbeddedObject::reload( } ::comphelper::MimeConfigurationHelper aHelper( m_xFactory ); - if ( !m_aLinkFilterName.getLength() ) + if ( m_aLinkFilterName.isEmpty() ) { - if ( aNewLinkFilter.getLength() ) + if ( !aNewLinkFilter.isEmpty() ) m_aLinkFilterName = aNewLinkFilter; else { @@ -1814,7 +1814,7 @@ void SAL_CALL OCommonEmbeddedObject::breakLink( const uno::Reference< embed::XSt uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 1 ); - if ( !sEntName.getLength() ) + if ( sEntName.isEmpty() ) throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Empty element name is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 2 ); diff --git a/embeddedobj/source/commonembedding/xfactory.cxx b/embeddedobj/source/commonembedding/xfactory.cxx index e12a939f88c9..56662e95fa67 100644 --- a/embeddedobj/source/commonembedding/xfactory.cxx +++ b/embeddedobj/source/commonembedding/xfactory.cxx @@ -85,7 +85,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 1 ); - if ( !sEntName.getLength() ) + if ( sEntName.isEmpty() ) throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Empty element name is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 2 ); @@ -176,7 +176,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 1 ); - if ( !sEntName.getLength() ) + if ( sEntName.isEmpty() ) throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Empty element name is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 2 ); @@ -189,7 +189,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta uno::Reference< uno::XInterface > xResult; // find document service name - if ( aFilterName.getLength() ) + if ( !aFilterName.isEmpty() ) { uno::Sequence< beans::NamedValue > aObject = m_aConfigHelper.GetObjectPropsByFilter( aFilterName ); if ( !aObject.getLength() ) @@ -243,7 +243,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 3 ); - if ( !sEntName.getLength() ) + if ( sEntName.isEmpty() ) throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Empty element name is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 4 ); @@ -295,7 +295,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 1 ); - if ( !sEntName.getLength() ) + if ( sEntName.isEmpty() ) throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Empty element name is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 2 ); @@ -308,7 +308,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta if ( nEntryConnectionMode == embed::EntryInitModes::MEDIA_DESCRIPTOR_INIT ) { ::rtl::OUString aFilterName = m_aConfigHelper.UpdateMediaDescriptorWithFilterName( aTempMedDescr, aObject ); - if ( !aFilterName.getLength() ) + if ( aFilterName.isEmpty() ) // the object must be OOo embedded object, if it is not an exception must be thrown throw io::IOException(); // TODO: } @@ -359,14 +359,14 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta if ( aTempMedDescr[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "URL" ) ) ) aTempMedDescr[nInd].Value >>= aURL; - if ( !aURL.getLength() ) + if ( aURL.isEmpty() ) throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "No URL for the link is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 3 ); ::rtl::OUString aFilterName = m_aConfigHelper.UpdateMediaDescriptorWithFilterName( aTempMedDescr, sal_False ); - if ( aFilterName.getLength() ) + if ( !aFilterName.isEmpty() ) { uno::Sequence< beans::NamedValue > aObject = m_aConfigHelper.GetObjectPropsByFilter( aFilterName ); if ( !aObject.getLength() ) @@ -413,7 +413,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 1 ); - if ( !sEntName.getLength() ) + if ( sEntName.isEmpty() ) throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Empty element name is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 2 ); @@ -425,7 +425,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta if ( aTempMedDescr[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "URL" ) ) ) aTempMedDescr[nInd].Value >>= aURL; - if ( !aURL.getLength() ) + if ( aURL.isEmpty() ) throw lang::IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "No URL for the link is provided!\n" )), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ), 3 ); @@ -436,7 +436,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta ::rtl::OUString aFilterName = m_aConfigHelper.UpdateMediaDescriptorWithFilterName( aTempMedDescr, aObject ); - if ( aFilterName.getLength() ) + if ( !aFilterName.isEmpty() ) { xResult = uno::Reference< uno::XInterface >( |