diff options
author | Radu Ioan <ioan.radu.g@gmail.com> | 2013-05-27 00:22:20 +0300 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-05-31 18:08:02 +0000 |
commit | 660b67a413fed152bc273bdc534e53b01b1e9d77 (patch) | |
tree | 1bdaad775c26d63325d32c8529d303cf0261b587 /embeddedobj | |
parent | 2c7b6aa7a3127370afa41c1e83b2c198da504055 (diff) |
fdo#63690 - replace RTL_CONTEXT_ macros with SAL_INFO
- replaced RTL_CONTEXT_ with SAL_INFO
- replace OSL_* with SAL_*
Change-Id: Id4e90b83a7275bfd30914f7514a609cebbfbf4ac
Reviewed-on: https://gerrit.libreoffice.org/4044
Reviewed-by: Luboš Luňák <l.lunak@suse.cz>
Tested-by: Luboš Luňák <l.lunak@suse.cz>
Diffstat (limited to 'embeddedobj')
-rw-r--r-- | embeddedobj/source/commonembedding/embedobj.cxx | 13 | ||||
-rw-r--r-- | embeddedobj/source/commonembedding/persistence.cxx | 66 | ||||
-rw-r--r-- | embeddedobj/source/commonembedding/visobj.cxx | 18 | ||||
-rw-r--r-- | embeddedobj/source/commonembedding/xfactory.cxx | 13 | ||||
-rw-r--r-- | embeddedobj/source/general/xcreator.cxx | 13 | ||||
-rw-r--r-- | embeddedobj/source/msole/oleembed.cxx | 15 | ||||
-rw-r--r-- | embeddedobj/source/msole/olepersist.cxx | 44 | ||||
-rw-r--r-- | embeddedobj/source/msole/olevisual.cxx | 22 | ||||
-rw-r--r-- | embeddedobj/source/msole/xolefactory.cxx | 13 |
9 files changed, 101 insertions, 116 deletions
diff --git a/embeddedobj/source/commonembedding/embedobj.cxx b/embeddedobj/source/commonembedding/embedobj.cxx index 24a7850427ca..6983fc0de2e3 100644 --- a/embeddedobj/source/commonembedding/embedobj.cxx +++ b/embeddedobj/source/commonembedding/embedobj.cxx @@ -39,7 +39,6 @@ #include <com/sun/star/embed/EmbedMisc.hpp> #include <comphelper/processfactory.hxx> -#include <rtl/logfile.hxx> #include <vcl/svapp.hxx> #include <targetstatecontrol.hxx> @@ -205,7 +204,7 @@ void OCommonEmbeddedObject::SwitchStateTo_Impl( sal_Int32 nNextState ) } else { - OSL_FAIL( "Unacceptable state switch!\n" ); + SAL_WARN( "embeddedobj.common", "Unacceptable state switch!" ); throw uno::RuntimeException(); // TODO } } @@ -277,7 +276,7 @@ void OCommonEmbeddedObject::SwitchStateTo_Impl( sal_Int32 nNextState ) } else { - OSL_FAIL( "Unacceptable state switch!\n" ); + SAL_WARN( "embeddedobj.common", "Unacceptable state switch!" ); throw uno::RuntimeException(); // TODO } } @@ -347,7 +346,7 @@ void OCommonEmbeddedObject::SwitchStateTo_Impl( sal_Int32 nNextState ) } else { - OSL_FAIL( "Unacceptable state switch!\n" ); + SAL_WARN( "embeddedobj.common", "Unacceptable state switch!" ); throw uno::RuntimeException(); // TODO } } @@ -360,7 +359,7 @@ void OCommonEmbeddedObject::SwitchStateTo_Impl( sal_Int32 nNextState ) } else { - OSL_FAIL( "Unacceptable state switch!\n" ); + SAL_WARN( "embeddedobj.common", "Unacceptable state switch!" ); throw uno::RuntimeException(); // TODO } } @@ -425,7 +424,7 @@ void SAL_CALL OCommonEmbeddedObject::changeState( sal_Int32 nNewState ) uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OCommonEmbeddedObject::changeState" ); + SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033) OCommonEmbeddedObject::changeState" ); uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >( this ), uno::UNO_QUERY); { @@ -529,7 +528,7 @@ void SAL_CALL OCommonEmbeddedObject::doVerb( sal_Int32 nVerbID ) uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OCommonEmbeddedObject::doVerb" ); + SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033) OCommonEmbeddedObject::doVerb" ); SolarMutexGuard aSolarGuard; //TODO: a gross hack to avoid deadlocks when this is called from the diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx index cc99b3b8beae..06868e7b4a20 100644 --- a/embeddedobj/source/commonembedding/persistence.cxx +++ b/embeddedobj/source/commonembedding/persistence.cxx @@ -52,8 +52,6 @@ #include <comphelper/mimeconfighelper.hxx> #include <comphelper/namedvaluecollection.hxx> -#include <rtl/logfile.hxx> - #include <tools/diagnose_ex.h> using namespace ::com::sun::star; @@ -120,7 +118,7 @@ uno::Reference< io::XInputStream > createTempInpStreamFromStor( const uno::Reference< embed::XStorage >& xStorage, const uno::Reference< uno::XComponentContext >& xContext ) { - OSL_ENSURE( xStorage.is(), "The storage can not be empty!" ); + SAL_WARN_IF( !xStorage.is(), "embeddedobj.common", "The storage can not be empty!" ); uno::Reference< io::XInputStream > xResult; @@ -149,7 +147,7 @@ uno::Reference< io::XInputStream > createTempInpStreamFromStor( try { uno::Reference< lang::XComponent > xComponent( xTempStorage, uno::UNO_QUERY ); - OSL_ENSURE( xComponent.is(), "Wrong storage implementation!" ); + SAL_WARN_IF( !xComponent.is(), "embeddedobj.common", "Wrong storage implementation!" ); if ( xComponent.is() ) xComponent->dispose(); } @@ -246,7 +244,7 @@ void OCommonEmbeddedObject::SwitchOwnPersistence( const uno::Reference< embed::X { if ( xNewParentStorage == m_xParentStorage && aNewName.equals( m_aEntryName ) ) { - OSL_ENSURE( xNewObjectStorage == m_xObjectStorage, "The storage must be the same!\n" ); + SAL_WARN_IF( xNewObjectStorage != m_xObjectStorage, "embeddedobj.common", "The storage must be the same!" ); return; } @@ -284,7 +282,7 @@ void OCommonEmbeddedObject::SwitchOwnPersistence( const uno::Reference< embed::X sal_Int32 nStorageMode = m_bReadOnly ? embed::ElementModes::READ : embed::ElementModes::READWRITE; uno::Reference< embed::XStorage > xNewOwnStorage = xNewParentStorage->openStorageElement( aNewName, nStorageMode ); - OSL_ENSURE( xNewOwnStorage.is(), "The method can not return empty reference!" ); + SAL_WARN_IF( !xNewOwnStorage.is(), "embeddedobj.common", "The method can not return empty reference!" ); SwitchOwnPersistence( xNewParentStorage, xNewOwnStorage, aNewName ); } @@ -302,7 +300,7 @@ void OCommonEmbeddedObject::EmbedAndReparentDoc_Impl( const uno::Reference< util } catch( const lang::NoSupportException & ) { - OSL_FAIL( "OCommonEmbeddedObject::EmbedAndReparentDoc: cannot set parent at document!" ); + SAL_WARN( "embeddedobj.common", "OCommonEmbeddedObject::EmbedAndReparentDoc: cannot set parent at document!" ); } } @@ -327,7 +325,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::InitNewDocument_Impl() if ( m_xRecoveryStorage.is() ) { uno::Reference< document::XStorageBasedDocument > xDoc( xLoadable, uno::UNO_QUERY ); - OSL_ENSURE( xDoc.is(), "OCommonEmbeddedObject::InitNewDocument_Impl: cannot recover from a storage when the document is not storage based!" ); + SAL_WARN_IF( !xDoc.is(), "embeddedobj.common", "OCommonEmbeddedObject::InitNewDocument_Impl: cannot recover from a storage when the document is not storage based!" ); if ( xDoc.is() ) { ::comphelper::NamedValueCollection aLoadArgs; @@ -463,7 +461,7 @@ void OCommonEmbeddedObject::FillDefaultLoadArgs_Impl( const uno::Reference< embe o_rLoadArgs.put( "ReadOnly", m_bReadOnly ); OUString aFilterName = GetFilterName( ::comphelper::OStorageHelper::GetXStorageFormat( i_rxStorage ) ); - OSL_ENSURE( !aFilterName.isEmpty(), "OCommonEmbeddedObject::FillDefaultLoadArgs_Impl: Wrong document service name!" ); + SAL_WARN_IF( aFilterName.isEmpty(), "embeddedobj.common", "OCommonEmbeddedObject::FillDefaultLoadArgs_Impl: Wrong document service name!" ); if ( aFilterName.isEmpty() ) throw io::IOException(); // TODO: error message/code @@ -516,7 +514,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorag { } - OSL_ENSURE( !aTempFileURL.isEmpty(), "Coudn't retrieve temporary file URL!\n" ); + SAL_WARN_IF( aTempFileURL.isEmpty(), "embeddedobj.common", "Coudn't retrieve temporary file URL!" ); aLoadArgs.put( "URL", aTempFileURL ); aLoadArgs.put( "InputStream", xTempInpStream ); @@ -586,7 +584,7 @@ uno::Reference< io::XInputStream > OCommonEmbeddedObject::StoreDocumentToTempStr OUString aFilterName = GetFilterName( nStorageFormat ); - OSL_ENSURE( !aFilterName.isEmpty(), "Wrong document service name!" ); + SAL_WARN_IF( aFilterName.isEmpty(), "embeddedobj.common", "Wrong document service name!" ); if ( aFilterName.isEmpty() ) throw io::IOException(); // TODO: @@ -607,7 +605,7 @@ uno::Reference< io::XInputStream > OCommonEmbeddedObject::StoreDocumentToTempStr } catch( const uno::Exception& ) { - OSL_FAIL( "Looks like stream was closed already" ); + SAL_WARN( "embeddedobj.common", "Looks like stream was closed already" ); } return aResult; @@ -634,7 +632,7 @@ void OCommonEmbeddedObject::SaveObject_Impl() } catch( const uno::Exception& ) { - OSL_FAIL( "The object was not stored!\n" ); + SAL_WARN( "embeddedobj.common", "The object was not stored!" ); } } } @@ -731,7 +729,7 @@ void OCommonEmbeddedObject::StoreDocToStorage_Impl( const uno::Reference< embed: const OUString& aHierarchName, sal_Bool bAttachToTheStorage ) { - OSL_ENSURE( xStorage.is(), "No storage is provided for storing!" ); + SAL_WARN_IF( !xStorage.is(), "embeddedobj.common", "No storage is provided for storing!" ); if ( !xStorage.is() ) throw uno::RuntimeException(); // TODO: @@ -747,7 +745,7 @@ void OCommonEmbeddedObject::StoreDocToStorage_Impl( const uno::Reference< embed: { OUString aFilterName = GetFilterName( nStorageFormat ); - OSL_ENSURE( !aFilterName.isEmpty(), "Wrong document service name!" ); + SAL_WARN_IF( aFilterName.isEmpty(), "embeddedobj.common", "Wrong document service name!" ); if ( aFilterName.isEmpty() ) throw io::IOException(); // TODO: @@ -768,7 +766,7 @@ void OCommonEmbeddedObject::StoreDocToStorage_Impl( const uno::Reference< embed: // store document to temporary stream based on temporary file uno::Reference < io::XInputStream > xTempIn = StoreDocumentToTempStream_Impl( nStorageFormat, aBaseURL, aHierarchName ); - OSL_ENSURE( xTempIn.is(), "The stream reference can not be empty!\n" ); + SAL_WARN_IF( !xTempIn.is(), "embeddedobj.common", "The stream reference can not be empty!" ); // open storage based on document temporary file for reading uno::Reference < lang::XSingleServiceFactory > xStorageFactory = embed::StorageFactory::create(m_xContext); @@ -828,7 +826,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::CreateTempDocFromLink_ { uno::Reference< util::XCloseable > xResult; - OSL_ENSURE( m_bIsLink, "The object is not a linked one!\n" ); + SAL_WARN_IF( !m_bIsLink, "embeddedobj.common", "The object is not a linked one!" ); uno::Sequence< beans::PropertyValue > aTempMediaDescr; @@ -842,7 +840,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::CreateTempDocFromLink_ } catch ( const uno::Exception& ) { - OSL_FAIL( "Can not retrieve storage media type!\n" ); + SAL_WARN( "embeddedobj.common", "Can not retrieve storage media type!" ); } if ( m_pDocHolder->GetComponent().is() ) @@ -865,7 +863,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::CreateTempDocFromLink_ { } - OSL_ENSURE( !aTempFileURL.isEmpty(), "Couldn't retrieve temporary file URL!\n" ); + SAL_WARN_IF( aTempFileURL.isEmpty(), "embeddedobj.common", "Couldn't retrieve temporary file URL!" ); aTempMediaDescr[0].Name = OUString( "URL" ); aTempMediaDescr[0].Value <<= aTempFileURL; @@ -903,7 +901,7 @@ void SAL_CALL OCommonEmbeddedObject::setPersistentEntry( uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OCommonEmbeddedObject::setPersistentEntry" ); + SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033) OCommonEmbeddedObject::setPersistentEntry" ); // the type of the object must be already set // a kind of typedetection should be done in the factory @@ -1040,7 +1038,7 @@ void SAL_CALL OCommonEmbeddedObject::setPersistentEntry( m_pDocHolder->SetOutplaceFrameProperties( aOutFrameProps ); } else - OSL_FAIL( "OCommonEmbeddedObject::setPersistentEntry: illegal type for argument 'OutplaceFrameProperties'!" ); + SAL_WARN( "embeddedobj.common", "OCommonEmbeddedObject::setPersistentEntry: illegal type for argument 'OutplaceFrameProperties'!" ); } else if ( lObjArgs[nObjInd].Name == "ModuleName" ) { @@ -1131,7 +1129,7 @@ void SAL_CALL OCommonEmbeddedObject::storeToEntry( const uno::Reference< embed:: uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OCommonEmbeddedObject::storeToEntry" ); + SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033) OCommonEmbeddedObject::storeToEntry" ); ::osl::ResettableMutexGuard aGuard( m_aMutex ); if ( m_bDisposed ) @@ -1168,7 +1166,7 @@ void SAL_CALL OCommonEmbeddedObject::storeToEntry( const uno::Reference< embed:: } catch ( const uno::Exception& ) { - OSL_FAIL( "Can not retrieve target storage media type!\n" ); + SAL_WARN( "embeddedobj.common", "Can not retrieve target storage media type!" ); } try @@ -1181,7 +1179,7 @@ void SAL_CALL OCommonEmbeddedObject::storeToEntry( const uno::Reference< embed:: } catch ( const uno::Exception& ) { - OSL_FAIL( "Can not retrieve own storage media type!\n" ); + SAL_WARN( "embeddedobj.common", "Can not retrieve own storage media type!" ); } sal_Bool bTryOptimization = sal_False; @@ -1257,7 +1255,7 @@ void SAL_CALL OCommonEmbeddedObject::storeAsEntry( const uno::Reference< embed:: uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OCommonEmbeddedObject::storeAsEntry" ); + SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033) OCommonEmbeddedObject::storeAsEntry" ); // TODO: use lObjArgs @@ -1299,7 +1297,7 @@ void SAL_CALL OCommonEmbeddedObject::storeAsEntry( const uno::Reference< embed:: } catch ( const uno::Exception& ) { - OSL_FAIL( "Can not retrieve target storage media type!\n" ); + SAL_WARN( "embeddedobj.common", "Can not retrieve target storage media type!" ); } try @@ -1312,7 +1310,7 @@ void SAL_CALL OCommonEmbeddedObject::storeAsEntry( const uno::Reference< embed:: } catch ( const uno::Exception& ) { - OSL_FAIL( "Can not retrieve own storage media type!\n" ); + SAL_WARN( "embeddedobj.common", "Can not retrieve own storage media type!" ); } PostEvent_Impl( OUString( "OnSaveAs" ) ); @@ -1394,7 +1392,7 @@ void SAL_CALL OCommonEmbeddedObject::saveCompleted( sal_Bool bUseNew ) uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OCommonEmbeddedObject::saveCompleted" ); + SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033) OCommonEmbeddedObject::saveCompleted" ); ::osl::MutexGuard aGuard( m_aMutex ); if ( m_bDisposed ) @@ -1422,7 +1420,7 @@ void SAL_CALL OCommonEmbeddedObject::saveCompleted( sal_Bool bUseNew ) if ( !m_bWaitSaveCompleted && !bUseNew ) return; - OSL_ENSURE( m_bWaitSaveCompleted, "Unexpected saveCompleted() call!\n" ); + SAL_WARN_IF( !m_bWaitSaveCompleted, "embeddedobj.common", "Unexpected saveCompleted() call!" ); if ( !m_bWaitSaveCompleted ) throw io::IOException(); // TODO: illegal call @@ -1445,7 +1443,7 @@ void SAL_CALL OCommonEmbeddedObject::saveCompleted( sal_Bool bUseNew ) { try { uno::Reference< lang::XComponent > xComponent( m_xNewObjectStorage, uno::UNO_QUERY ); - OSL_ENSURE( xComponent.is(), "Wrong storage implementation!" ); + SAL_WARN_IF( !xComponent.is(), "embeddedobj.common", "Wrong storage implementation!" ); if ( xComponent.is() ) xComponent->dispose(); } @@ -1522,7 +1520,7 @@ void SAL_CALL OCommonEmbeddedObject::storeOwn() uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OCommonEmbeddedObject::storeOwn" ); + SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033) OCommonEmbeddedObject::storeOwn" ); // during switching from Activated to Running and from Running to Loaded states the object will // ask container to store the object, the container has to make decision @@ -1553,7 +1551,7 @@ void SAL_CALL OCommonEmbeddedObject::storeOwn() PostEvent_Impl( OUString( "OnSave" ) ); - OSL_ENSURE( m_pDocHolder->GetComponent().is(), "If an object is activated or in running state it must have a document!\n" ); + SAL_WARN_IF( !m_pDocHolder->GetComponent().is(), "embeddedobj.common", "If an object is activated or in running state it must have a document!" ); if ( !m_pDocHolder->GetComponent().is() ) throw uno::RuntimeException(); @@ -1588,7 +1586,7 @@ void SAL_CALL OCommonEmbeddedObject::storeOwn() } catch ( const uno::Exception& ) { - OSL_FAIL( "Can not retrieve storage media type!\n" ); + SAL_WARN( "embeddedobj.common", "Can not retrieve storage media type!" ); } aGuard.clear(); @@ -1830,7 +1828,7 @@ void SAL_CALL OCommonEmbeddedObject::breakLink( const uno::Reference< embed::XSt {} m_pDocHolder->SetComponent( xDocument, m_bReadOnly ); - OSL_ENSURE( m_pDocHolder->GetComponent().is(), "If document cant be created, an exception must be thrown!\n" ); + SAL_WARN_IF( !m_pDocHolder->GetComponent().is(), "embeddedobj.common", "If document cant be created, an exception must be thrown!" ); if ( m_nObjectState == embed::EmbedStates::LOADED ) { diff --git a/embeddedobj/source/commonembedding/visobj.cxx b/embeddedobj/source/commonembedding/visobj.cxx index 38c89fd704c3..046be33b1ed7 100644 --- a/embeddedobj/source/commonembedding/visobj.cxx +++ b/embeddedobj/source/commonembedding/visobj.cxx @@ -23,8 +23,6 @@ #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/lang/DisposedException.hpp> -#include <rtl/logfile.hxx> - #include <commonembobj.hxx> @@ -37,13 +35,13 @@ void SAL_CALL OCommonEmbeddedObject::setVisualAreaSize( sal_Int64 nAspect, const uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OCommonEmbeddedObject::setVisualAreaSize" ); + SAL_WARN( "embeddedobj.common", "embeddedobj (mv76033) OCommonEmbeddedObject::setVisualAreaSize" ); ::osl::MutexGuard aGuard( m_aMutex ); if ( m_bDisposed ) throw lang::DisposedException(); // TODO - OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON, "For iconified objects no graphical replacement is required!\n" ); + SAL_WARN_IF( nAspect == embed::Aspects::MSOLE_ICON, "embeddedobj.common", "For iconified objects no graphical replacement is required!" ); if ( nAspect == embed::Aspects::MSOLE_ICON ) // no representation can be retrieved throw embed::WrongStateException( OUString( "Illegal call!\n" ), @@ -79,7 +77,7 @@ awt::Size SAL_CALL OCommonEmbeddedObject::getVisualAreaSize( sal_Int64 nAspect ) uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OCommonEmbeddedObject::getVisualAreaSize" ); + SAL_WARN( "embeddedobj.common", "embeddedobj (mv76033) OCommonEmbeddedObject::getVisualAreaSize" ); ::osl::MutexGuard aGuard( m_aMutex ); if ( m_bDisposed ) @@ -89,7 +87,7 @@ awt::Size SAL_CALL OCommonEmbeddedObject::getVisualAreaSize( sal_Int64 nAspect ) throw embed::WrongStateException( OUString( "The own object has no persistence!\n" ), uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); - OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON, "For iconified objects no graphical replacement is required!\n" ); + SAL_WARN_IF( nAspect == embed::Aspects::MSOLE_ICON, "embeddedobj.common", "For iconified objects no graphical replacement is required!" ); if ( m_bHasClonedSize ) return m_aClonedSize; @@ -123,7 +121,7 @@ sal_Int32 SAL_CALL OCommonEmbeddedObject::getMapUnit( sal_Int64 nAspect ) if ( m_bDisposed ) throw lang::DisposedException(); // TODO - OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON, "For iconified objects no graphical replacement is required!\n" ); + SAL_WARN_IF( nAspect == embed::Aspects::MSOLE_ICON, "embeddedobj.common", "For iconified objects no graphical replacement is required!" ); if ( nAspect == embed::Aspects::MSOLE_ICON ) // no representation can be retrieved throw embed::WrongStateException( OUString( "Illegal call!\n" ), @@ -162,7 +160,7 @@ embed::VisualRepresentation SAL_CALL OCommonEmbeddedObject::getPreferredVisualRe uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OCommonEmbeddedObject::getPrefferedVisualRepresentation" ); + SAL_WARN( "embeddedobj.common", "embeddedobj (mv76033) OCommonEmbeddedObject::getPrefferedVisualRepresentation" ); ::osl::MutexGuard aGuard( m_aMutex ); if ( m_bDisposed ) @@ -173,7 +171,7 @@ embed::VisualRepresentation SAL_CALL OCommonEmbeddedObject::getPreferredVisualRe uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) ); - OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON, "For iconified objects no graphical replacement is required!\n" ); + SAL_WARN_IF( nAspect == embed::Aspects::MSOLE_ICON, "embeddedobj.common", "For iconified objects no graphical replacement is required!" ); if ( nAspect == embed::Aspects::MSOLE_ICON ) // no representation can be retrieved throw embed::WrongStateException( OUString( "Illegal call!\n" ), @@ -188,7 +186,7 @@ embed::VisualRepresentation SAL_CALL OCommonEmbeddedObject::getPreferredVisualRe bBackToLoaded = m_bIsLink; } - OSL_ENSURE( m_pDocHolder->GetComponent().is(), "Running or Active object has no component!\n" ); + SAL_WARN_IF( !m_pDocHolder->GetComponent().is(), "embeddedobj.common", "Running or Active object has no component!" ); // TODO: return for the aspect of the document embed::VisualRepresentation aVisualRepresentation; diff --git a/embeddedobj/source/commonembedding/xfactory.cxx b/embeddedobj/source/commonembedding/xfactory.cxx index 74e4d4f0563a..0ccd7b1028aa 100644 --- a/embeddedobj/source/commonembedding/xfactory.cxx +++ b/embeddedobj/source/commonembedding/xfactory.cxx @@ -24,7 +24,6 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/XNameAccess.hpp> -#include <rtl/logfile.hxx> #include <comphelper/processfactory.hxx> @@ -70,7 +69,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta uno::Exception, uno::RuntimeException) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OOoEmbeddedObjectFactory::createInstanceInitFromEntry" ); + SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033) OOoEmbeddedObjectFactory::createInstanceInitFromEntry" ); if ( !xStorage.is() ) throw lang::IllegalArgumentException( OUString( "No parent storage is provided!\n" ), @@ -161,7 +160,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta uno::Exception, uno::RuntimeException) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OOoEmbeddedObjectFactory::createInstanceInitFromMediaDescriptor" ); + SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033) OOoEmbeddedObjectFactory::createInstanceInitFromMediaDescriptor" ); if ( !xStorage.is() ) throw lang::IllegalArgumentException( OUString( "No parent storage is provided!\n" ), @@ -226,7 +225,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta uno::Exception, uno::RuntimeException) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OOoEmbeddedObjectFactory::createInstanceInitNew" ); + SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033) OOoEmbeddedObjectFactory::createInstanceInitNew" ); uno::Reference< uno::XInterface > xResult; @@ -279,7 +278,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OOoEmbeddedObjectFactory::createInstanceUserInit" ); + SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033) OOoEmbeddedObjectFactory::createInstanceUserInit" ); // the initialization is completelly controlled by user if ( !xStorage.is() ) @@ -339,7 +338,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OOoEmbeddedObjectFactory::createInstanceLink" ); + SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033) OOoEmbeddedObjectFactory::createInstanceLink" ); uno::Reference< uno::XInterface > xResult; @@ -395,7 +394,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OOoEmbeddedObjectFactory::createInstanceLinkUserInit" ); + SAL_INFO( "embeddedobj.common", "embeddedobj (mv76033) OOoEmbeddedObjectFactory::createInstanceLinkUserInit" ); uno::Reference< uno::XInterface > xResult; diff --git a/embeddedobj/source/general/xcreator.cxx b/embeddedobj/source/general/xcreator.cxx index b3e025777260..734f8c5461bc 100644 --- a/embeddedobj/source/general/xcreator.cxx +++ b/embeddedobj/source/general/xcreator.cxx @@ -29,7 +29,6 @@ #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/lang/XComponent.hpp> -#include <rtl/logfile.hxx> #include <comphelper/processfactory.hxx> @@ -74,7 +73,7 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta uno::Exception, uno::RuntimeException) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) UNOEmbeddedObjectCreator::createInstanceInitNew" ); + SAL_INFO( "embeddedobj.general", "embeddedobj (mv76033) UNOEmbeddedObjectCreator::createInstanceInitNew" ); uno::Reference< uno::XInterface > xResult; @@ -119,7 +118,7 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta uno::Exception, uno::RuntimeException) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) UNOEmbeddedObjectCreator::createInstanceInitFromEntry" ); + SAL_INFO( "embeddedobj.general", "embeddedobj (mv76033) UNOEmbeddedObjectCreator::createInstanceInitFromEntry" ); if ( !xStorage.is() ) throw lang::IllegalArgumentException( OUString( "No parent storage is provided!\n" ), @@ -238,7 +237,7 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta uno::Exception, uno::RuntimeException) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) UNOEmbeddedObjectCreator::createInstanceInitFromMediaDescriptor" ); + SAL_INFO( "embeddedobj.general", "embeddedobj (mv76033) UNOEmbeddedObjectCreator::createInstanceInitFromMediaDescriptor" ); // TODO: use lObjArgs @@ -303,7 +302,7 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta uno::Exception, uno::RuntimeException) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) UNOEmbeddedObjectCreator::createInstanceUserInit" ); + SAL_INFO( "embeddedobj.general", "embeddedobj (mv76033) UNOEmbeddedObjectCreator::createInstanceUserInit" ); uno::Reference< uno::XInterface > xResult; @@ -344,7 +343,7 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) UNOEmbeddedObjectCreator::createInstanceLink" ); + SAL_INFO( "embeddedobj.general", "embeddedobj (mv76033) UNOEmbeddedObjectCreator::createInstanceLink" ); uno::Reference< uno::XInterface > xResult; @@ -419,7 +418,7 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) UNOEmbeddedObjectCreator::createInstanceLinkUserInit" ); + SAL_INFO( "embeddedobj.general", "embeddedobj (mv76033) UNOEmbeddedObjectCreator::createInstanceLinkUserInit" ); uno::Reference< uno::XInterface > xResult; diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx index 859a9b9fdebb..3773a21f4fc3 100644 --- a/embeddedobj/source/msole/oleembed.cxx +++ b/embeddedobj/source/msole/oleembed.cxx @@ -42,7 +42,6 @@ #include <com/sun/star/system/SystemShellExecute.hpp> #include <com/sun/star/system/SystemShellExecuteFlags.hpp> -#include <rtl/logfile.hxx> #include <cppuhelper/interfacecontainer.h> #include <comphelper/processfactory.hxx> #include <comphelper/mimeconfighelper.hxx> @@ -104,7 +103,7 @@ uno::Sequence< sal_Int32 > OleEmbeddedObject::GetReachableStatesList_Impl( //---------------------------------------------- uno::Sequence< sal_Int32 > OleEmbeddedObject::GetIntermediateVerbsSequence_Impl( sal_Int32 nNewState ) { - OSL_ENSURE( m_nObjectState != embed::EmbedStates::LOADED, "Loaded object is switched to running state without verbs using!" ); + SAL_WARN_IF( m_nObjectState == embed::EmbedStates::LOADED, "embeddedobj.ole", "Loaded object is switched to running state without verbs using!" ); // actually there will be only one verb if ( m_nObjectState == embed::EmbedStates::RUNNING && nNewState == embed::EmbedStates::ACTIVE ) @@ -415,7 +414,7 @@ sal_Bool OleEmbeddedObject::TryToConvertToOOo() if ( !aStorageName.isEmpty() ) try { m_xParentStorage->removeElement( aStorageName ); - } catch( const uno::Exception& ) { OSL_FAIL( "Can not remove temporary storage!" ); } + } catch( const uno::Exception& ) { SAL_WARN( "embeddedobj.ole", "Can not remove temporary storage!" ); } break; } } @@ -445,7 +444,7 @@ void SAL_CALL OleEmbeddedObject::changeState( sal_Int32 nNewState ) uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::changeState" ); + SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::changeState" ); // begin wrapping related part ==================== uno::Reference< embed::XEmbeddedObject > xWrappedObject = m_xWrappedObject; @@ -603,7 +602,7 @@ uno::Sequence< sal_Int32 > SAL_CALL OleEmbeddedObject::getReachableStates() throw ( embed::WrongStateException, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::getReachableStates" ); + SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::getReachableStates" ); // begin wrapping related part ==================== uno::Reference< embed::XEmbeddedObject > xWrappedObject = m_xWrappedObject; @@ -762,7 +761,7 @@ void SAL_CALL OleEmbeddedObject::doVerb( sal_Int32 nVerbID ) uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::doVerb" ); + SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::doVerb" ); // begin wrapping related part ==================== uno::Reference< embed::XEmbeddedObject > xWrappedObject = m_xWrappedObject; @@ -898,7 +897,7 @@ uno::Sequence< embed::VerbDescriptor > SAL_CALL OleEmbeddedObject::getSupportedV throw ( embed::WrongStateException, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::getSupportedVerb" ); + SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::getSupportedVerb" ); // begin wrapping related part ==================== uno::Reference< embed::XEmbeddedObject > xWrappedObject = m_xWrappedObject; @@ -1022,7 +1021,7 @@ void SAL_CALL OleEmbeddedObject::update() else { // the object must be up to date - OSL_ENSURE( m_nUpdateMode == embed::EmbedUpdateModes::ALWAYS_UPDATE, "Unknown update mode!\n" ); + SAL_WARN_IF( m_nUpdateMode != embed::EmbedUpdateModes::ALWAYS_UPDATE, "embeddedobj.ole", "Unknown update mode!" ); } } diff --git a/embeddedobj/source/msole/olepersist.cxx b/embeddedobj/source/msole/olepersist.cxx index 7b683ceb198b..8f88131b8e1a 100644 --- a/embeddedobj/source/msole/olepersist.cxx +++ b/embeddedobj/source/msole/olepersist.cxx @@ -37,8 +37,6 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/ucb/SimpleFileAccess.hpp> -#include <rtl/logfile.hxx> - #include <comphelper/processfactory.hxx> #include <comphelper/storagehelper.hxx> #include <comphelper/mimeconfighelper.hxx> @@ -77,7 +75,7 @@ sal_Bool KillFile_Impl( const OUString& aURL, const uno::Reference< lang::XMulti //---------------------------------------------- OUString GetNewTempFileURL_Impl( const uno::Reference< lang::XMultiServiceFactory >& xFactory ) { - OSL_ENSURE( xFactory.is(), "No factory is provided!\n" ); + SAL_WARN_IF( !xFactory.is(), "embeddedobj.ole", "No factory is provided!" ); OUString aResult; @@ -263,7 +261,7 @@ void VerbExecutionController::UnlockNotification() uno::Reference< io::XStream > OleEmbeddedObject::GetNewFilledTempStream_Impl( const uno::Reference< io::XInputStream >& xInStream ) throw( io::IOException ) { - OSL_ENSURE( xInStream.is(), "Wrong parameter is provided!\n" ); + SAL_WARN_IF( !xInStream.is(), "embeddedobj.ole", "Wrong parameter is provided!" ); uno::Reference < io::XStream > xTempFile( io::TempFile::create(comphelper::getComponentContext(m_xFactory)), @@ -481,7 +479,7 @@ void OleEmbeddedObject::InsertVisualCache_Impl( const uno::Reference< io::XStrea sal_Int64 nLength = xTempSeek->getLength() - 40; if ( nLength < 0 || nLength >= 0xFFFFFFFF ) { - OSL_FAIL( "Length is not acceptable!" ); + SAL_WARN( "embeddedobj.ole", "Length is not acceptable!" ); return; } for ( sal_Int32 nInd = 0; nInd < 4; nInd++ ) @@ -566,7 +564,7 @@ sal_Bool OleEmbeddedObject::HasVisReplInStream() SetVisReplInStream( sal_True ); else { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::HasVisualReplInStream, analizing" ); + SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::HasVisualReplInStream, analizing" ); uno::Reference< io::XInputStream > xStream; @@ -634,7 +632,7 @@ uno::Reference< io::XStream > OleEmbeddedObject::TryToRetrieveCachedVisualRepres if ( xStream.is() ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::TryToRetrieveCachedVisualRepresentation, retrieving" ); + SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::TryToRetrieveCachedVisualRepresentation, retrieving" ); uno::Reference< container::XNameContainer > xNameContainer; uno::Sequence< uno::Any > aArgs( 2 ); @@ -768,7 +766,7 @@ void OleEmbeddedObject::SwitchOwnPersistence( const uno::Reference< embed::XStor { if ( xNewParentStorage == m_xParentStorage && aNewName.equals( m_aEntryName ) ) { - OSL_ENSURE( xNewObjectStream == m_xObjectStream, "The streams must be the same!\n" ); + SAL_WARN_IF( xNewObjectStream != m_xObjectStream, "embeddedobj.ole", "The streams must be the same!" ); return; } @@ -797,7 +795,7 @@ void OleEmbeddedObject::SwitchOwnPersistence( const uno::Reference< embed::XStor sal_Int32 nStreamMode = m_bReadOnly ? embed::ElementModes::READ : embed::ElementModes::READWRITE; uno::Reference< io::XStream > xNewOwnStream = xNewParentStorage->openStreamElement( aNewName, nStreamMode ); - OSL_ENSURE( xNewOwnStream.is(), "The method can not return empty reference!" ); + SAL_WARN_IF( !xNewOwnStream.is(), "embeddedobj.ole", "The method can not return empty reference!" ); SwitchOwnPersistence( xNewParentStorage, xNewOwnStream, aNewName ); } @@ -830,8 +828,8 @@ sal_Bool OleEmbeddedObject::OnShowWindow_Impl( sal_Bool bShow ) sal_Bool bResult = sal_False; - OSL_ENSURE( m_nObjectState != -1, "The object has no persistence!\n" ); - OSL_ENSURE( m_nObjectState != embed::EmbedStates::LOADED, "The object get OnShowWindow in loaded state!\n" ); + SAL_WARN_IF( m_nObjectState == -1, "embeddedobj.ole", "The object has no persistence!" ); + SAL_WARN_IF( m_nObjectState == embed::EmbedStates::LOADED, "embeddedobj.ole", "The object get OnShowWindow in loaded state!" ); if ( m_nObjectState == -1 || m_nObjectState == embed::EmbedStates::LOADED ) return sal_False; @@ -923,7 +921,7 @@ void OleEmbeddedObject::OnClosed_Impl() //------------------------------------------------------ OUString OleEmbeddedObject::CreateTempURLEmpty_Impl() { - OSL_ENSURE( m_aTempURL.isEmpty(), "The object has already the temporary file!" ); + SAL_WARN_IF( !m_aTempURL.isEmpty(), "embeddedobj.ole", "The object has already the temporary file!" ); m_aTempURL = GetNewTempFileURL_Impl( m_xFactory ); return m_aTempURL; @@ -934,7 +932,7 @@ OUString OleEmbeddedObject::GetTempURL_Impl() { if ( m_aTempURL.isEmpty() ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::GetTempURL_Impl, tempfile creation" ); + SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::GetTempURL_Impl, tempfile creation" ); // if there is no temporary file, it will be created from the own entry uno::Reference< embed::XOptimizedStorage > xOptParStorage( m_xParentStorage, uno::UNO_QUERY ); @@ -1046,7 +1044,7 @@ void OleEmbeddedObject::StoreObjectToStream( uno::Reference< io::XOutputStream > ucb::SimpleFileAccess::create( comphelper::getComponentContext(m_xFactory) ) ); uno::Reference< io::XInputStream > xTempInStream = xTempAccess->openFileRead( m_aTempURL ); - OSL_ENSURE( xTempInStream.is(), "The object's temporary file can not be reopened for reading!\n" ); + SAL_WARN_IF( !xTempInStream.is(), "embeddedobj.ole", "The object's temporary file can not be reopened for reading!" ); // TODO: use bStoreVisReplace @@ -1218,7 +1216,7 @@ void OleEmbeddedObject::StoreToLocation_Impl( if ( !xCachedVisualRepresentation.is() ) xCachedVisualRepresentation = TryToRetrieveCachedVisualRepresentation_Impl( xTargetStream ); - OSL_ENSURE( xCachedVisualRepresentation.is(), "No representation is available!" ); + SAL_WARN_IF( !xCachedVisualRepresentation.is(), "embeddedobj.ole", "No representation is available!" ); // the following copying will be done in case it is SaveAs anyway // if it is not SaveAs the seekable access is not required currently @@ -1293,7 +1291,7 @@ void SAL_CALL OleEmbeddedObject::setPersistentEntry( uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::setPersistentEntry" ); + SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::setPersistentEntry" ); // begin wrapping related part ==================== uno::Reference< embed::XEmbedPersist > xWrappedObject( m_xWrappedObject, uno::UNO_QUERY ); @@ -1501,7 +1499,7 @@ void SAL_CALL OleEmbeddedObject::storeToEntry( const uno::Reference< embed::XSto uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::storeToEntry" ); + SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::storeToEntry" ); // begin wrapping related part ==================== uno::Reference< embed::XEmbedPersist > xWrappedObject( m_xWrappedObject, uno::UNO_QUERY ); @@ -1535,7 +1533,7 @@ void SAL_CALL OleEmbeddedObject::storeAsEntry( const uno::Reference< embed::XSto uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::storeAsEntry" ); + SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::storeAsEntry" ); // begin wrapping related part ==================== uno::Reference< embed::XEmbedPersist > xWrappedObject( m_xWrappedObject, uno::UNO_QUERY ); @@ -1564,7 +1562,7 @@ void SAL_CALL OleEmbeddedObject::saveCompleted( sal_Bool bUseNew ) uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::saveCompleted" ); + SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::saveCompleted" ); // begin wrapping related part ==================== uno::Reference< embed::XEmbedPersist > xWrappedObject( m_xWrappedObject, uno::UNO_QUERY ); @@ -1591,7 +1589,7 @@ void SAL_CALL OleEmbeddedObject::saveCompleted( sal_Bool bUseNew ) if ( !m_bWaitSaveCompleted && !bUseNew ) return; - OSL_ENSURE( m_bWaitSaveCompleted, "Unexpected saveCompleted() call!\n" ); + SAL_WARN_IF( !m_bWaitSaveCompleted, "embeddedobj.ole", "Unexpected saveCompleted() call!\n" ); if ( !m_bWaitSaveCompleted ) throw io::IOException(); // TODO: illegal call @@ -1611,7 +1609,7 @@ void SAL_CALL OleEmbeddedObject::saveCompleted( sal_Bool bUseNew ) // close remembered stream try { uno::Reference< lang::XComponent > xComponent( m_xNewObjectStream, uno::UNO_QUERY ); - OSL_ENSURE( xComponent.is(), "Wrong storage implementation!" ); + SAL_WARN_IF( !xComponent.is(), "embeddedobj.ole", "Wrong storage implementation!" ); if ( xComponent.is() ) xComponent->dispose(); } @@ -1729,7 +1727,7 @@ void SAL_CALL OleEmbeddedObject::storeOwn() uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::storeOwn" ); + SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::storeOwn" ); // begin wrapping related part ==================== uno::Reference< embed::XEmbedPersist > xWrappedObject( m_xWrappedObject, uno::UNO_QUERY ); @@ -1805,7 +1803,7 @@ void SAL_CALL OleEmbeddedObject::storeOwn() else { m_xCachedVisualRepresentation = TryToRetrieveCachedVisualRepresentation_Impl( m_xObjectStream ); - OSL_ENSURE( m_xCachedVisualRepresentation.is(), "No representation is available!" ); + SAL_WARN_IF( !m_xCachedVisualRepresentation.is(), "embeddedobj.ole", "No representation is available!" ); } } else diff --git a/embeddedobj/source/msole/olevisual.cxx b/embeddedobj/source/msole/olevisual.cxx index d09d2aad93ca..bd3747c3bd66 100644 --- a/embeddedobj/source/msole/olevisual.cxx +++ b/embeddedobj/source/msole/olevisual.cxx @@ -25,8 +25,6 @@ #include <com/sun/star/io/XSeekable.hpp> #include <com/sun/star/embed/NoVisualAreaSizeException.hpp> -#include <rtl/logfile.hxx> - #include <oleembobj.hxx> #include <olecomponent.hxx> #include <comphelper/mimeconfighelper.hxx> @@ -81,7 +79,7 @@ void SAL_CALL OleEmbeddedObject::setVisualAreaSize( sal_Int64 nAspect, const awt uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::setVisualAreaSize" ); + SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::setVisualAreaSize" ); // begin wrapping related part ==================== uno::Reference< embed::XEmbeddedObject > xWrappedObject = m_xWrappedObject; @@ -97,7 +95,7 @@ void SAL_CALL OleEmbeddedObject::setVisualAreaSize( sal_Int64 nAspect, const awt if ( m_bDisposed ) throw lang::DisposedException(); // TODO - OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON, "For iconified objects no graphical replacement is required!\n" ); + SAL_WARN_IF( nAspect == embed::Aspects::MSOLE_ICON, "embeddedobj.ole", "For iconified objects no graphical replacement is required!\n" ); if ( nAspect == embed::Aspects::MSOLE_ICON ) // no representation can be retrieved throw embed::WrongStateException( OUString( "Illegal call!\n" ), @@ -126,7 +124,7 @@ void SAL_CALL OleEmbeddedObject::setVisualAreaSize( sal_Int64 nAspect, const awt } catch( const uno::Exception& ) { - OSL_FAIL( "The object should not be resized without activation!\n" ); + SAL_WARN( "embeddedobj.ole", "The object should not be resized without activation!\n" ); } aGuard.reset(); } @@ -162,7 +160,7 @@ awt::Size SAL_CALL OleEmbeddedObject::getVisualAreaSize( sal_Int64 nAspect ) uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::getVisualAreaSize" ); + SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::getVisualAreaSize" ); // begin wrapping related part ==================== uno::Reference< embed::XEmbeddedObject > xWrappedObject = m_xWrappedObject; @@ -177,7 +175,7 @@ awt::Size SAL_CALL OleEmbeddedObject::getVisualAreaSize( sal_Int64 nAspect ) if ( m_bDisposed ) throw lang::DisposedException(); // TODO - OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON, "For iconified objects no graphical replacement is required!\n" ); + SAL_WARN_IF( nAspect == embed::Aspects::MSOLE_ICON, "embeddedobj.ole", "For iconified objects no graphical replacement is required!" ); if ( nAspect == embed::Aspects::MSOLE_ICON ) // no representation can be retrieved throw embed::WrongStateException( OUString( "Illegal call!\n" ), @@ -209,7 +207,7 @@ awt::Size SAL_CALL OleEmbeddedObject::getVisualAreaSize( sal_Int64 nAspect ) sal_Bool bSuccess = sal_False; if ( getCurrentState() == embed::EmbedStates::LOADED ) { - OSL_FAIL( "Loaded object has no cached size!\n" ); + SAL_WARN( "embeddedobj.ole", "Loaded object has no cached size!" ); // try to switch the object to RUNNING state and request the value again try { @@ -290,7 +288,7 @@ awt::Size SAL_CALL OleEmbeddedObject::getVisualAreaSize( sal_Int64 nAspect ) // return cached value if ( m_bHasCachedSize ) { - OSL_ENSURE( nAspect == m_nCachedAspect, "Unexpected aspect is requested!\n" ); + SAL_WARN_IF( nAspect != m_nCachedAspect, "embeddedobj.ole", "Unexpected aspect is requested!" ); aResult = m_aCachedSize; } else @@ -310,7 +308,7 @@ embed::VisualRepresentation SAL_CALL OleEmbeddedObject::getPreferredVisualRepres uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObject::getPreferredVisualRepresentation" ); + SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObject::getPreferredVisualRepresentation" ); // begin wrapping related part ==================== uno::Reference< embed::XEmbeddedObject > xWrappedObject = m_xWrappedObject; @@ -325,7 +323,7 @@ embed::VisualRepresentation SAL_CALL OleEmbeddedObject::getPreferredVisualRepres if ( m_bDisposed ) throw lang::DisposedException(); // TODO - OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON, "For iconified objects no graphical replacement is required!\n" ); + SAL_WARN_IF( nAspect == embed::Aspects::MSOLE_ICON, "embeddedobj.ole", "For iconified objects no graphical replacement is required!" ); if ( nAspect == embed::Aspects::MSOLE_ICON ) // no representation can be retrieved throw embed::WrongStateException( OUString( "Illegal call!\n" ), @@ -418,7 +416,7 @@ sal_Int32 SAL_CALL OleEmbeddedObject::getMapUnit( sal_Int64 nAspect ) if ( m_bDisposed ) throw lang::DisposedException(); // TODO - OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON, "For iconified objects no graphical replacement is required!\n" ); + SAL_WARN_IF( nAspect == embed::Aspects::MSOLE_ICON, "embeddedobj.ole", "For iconified objects no graphical replacement is required!" ); if ( nAspect == embed::Aspects::MSOLE_ICON ) // no representation can be retrieved throw embed::WrongStateException( OUString( "Illegal call!\n" ), diff --git a/embeddedobj/source/msole/xolefactory.cxx b/embeddedobj/source/msole/xolefactory.cxx index fb3baeb05e66..11e7a7f6fe3f 100644 --- a/embeddedobj/source/msole/xolefactory.cxx +++ b/embeddedobj/source/msole/xolefactory.cxx @@ -24,9 +24,6 @@ #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/embed/Aspects.hpp> -#include <rtl/logfile.hxx> - - #include "xolefactory.hxx" #include "oleembobj.hxx" @@ -69,7 +66,7 @@ uno::Reference< uno::XInterface > SAL_CALL OleEmbeddedObjectFactory::createInsta uno::Exception, uno::RuntimeException) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObjectFactory::createInstanceInitFromEntry" ); + SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObjectFactory::createInstanceInitFromEntry" ); if ( !xStorage.is() ) throw lang::IllegalArgumentException( OUString( "No parent storage is provided!\n" ), @@ -141,7 +138,7 @@ uno::Reference< uno::XInterface > SAL_CALL OleEmbeddedObjectFactory::createInsta uno::Exception, uno::RuntimeException) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObjectFactory::createInstanceInitFromMediaDescriptor" ); + SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObjectFactory::createInstanceInitFromMediaDescriptor" ); if ( !xStorage.is() ) throw lang::IllegalArgumentException( OUString( "No parent storage is provided!\n" ), @@ -183,7 +180,7 @@ uno::Reference< uno::XInterface > SAL_CALL OleEmbeddedObjectFactory::createInsta uno::Exception, uno::RuntimeException) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObjectFactory::createInstanceInitNew" ); + SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObjectFactory::createInstanceInitNew" ); if ( !xStorage.is() ) throw lang::IllegalArgumentException( OUString( "No parent storage is provided!\n" ), @@ -224,7 +221,7 @@ uno::Reference< uno::XInterface > SAL_CALL OleEmbeddedObjectFactory::createInsta uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObjectFactory::createInstanceLink" ); + SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObjectFactory::createInstanceLink" ); if ( !xStorage.is() ) throw lang::IllegalArgumentException( OUString( "No parent storage is provided!\n" ), @@ -270,7 +267,7 @@ uno::Reference< uno::XInterface > SAL_CALL OleEmbeddedObjectFactory::createInsta uno::Exception, uno::RuntimeException ) { - RTL_LOGFILE_CONTEXT( aLog, "embeddedobj (mv76033) OleEmbeddedObjectFactory::createInstanceUserInit" ); + SAL_INFO( "embeddedobj.ole", "embeddedobj (mv76033) OleEmbeddedObjectFactory::createInstanceUserInit" ); // the initialization is completelly controlled by user if ( !xStorage.is() ) |