diff options
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/doc/objmisc.cxx | 11 |
2 files changed, 8 insertions, 9 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index b6d1f85ac34a..907e0134d938 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -57,6 +57,7 @@ #include <com/sun/star/ucb/TransferInfo.hpp> #include <com/sun/star/ucb/OpenCommandArgument2.hpp> #include <com/sun/star/ucb/OpenMode.hpp> +#include <com/sun/star/logging/DocumentIOLogRing.hpp> #include <com/sun/star/logging/XSimpleLogRing.hpp> #include <cppuhelper/implbase1.hxx> #include <com/sun/star/beans/PropertyValue.hpp> @@ -387,9 +388,8 @@ void SfxMedium::AddLog( const ::rtl::OUString& aMessage ) { try { - ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); - if ( aContext.is() ) - pImp->m_xLogRing.set( aContext.getSingleton( "com.sun.star.logging.DocumentIOLogRing" ), UNO_QUERY_THROW ); + Reference<XComponentContext> xContext( ::comphelper::getProcessComponentContext() ); + pImp->m_xLogRing.set( logging::DocumentIOLogRing::get(xContext) ); } catch( const uno::Exception& ) {} diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index a1b3c26db956..e7edadcaa681 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -30,6 +30,7 @@ #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> #include <com/sun/star/document/XDocumentProperties.hpp> #include <com/sun/star/document/UpdateDocMode.hpp> +#include <com/sun/star/logging/DocumentIOLogRing.hpp> #include <com/sun/star/script/XTypeConverter.hpp> #include <com/sun/star/script/provider/XScriptProviderFactory.hpp> #include <com/sun/star/script/FinishEngineEvent.hpp> @@ -2030,9 +2031,8 @@ void SfxObjectShell::AddLog( const ::rtl::OUString& aMessage ) { try { - ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); - if ( aContext.is() ) - pImp->m_xLogRing.set( aContext.getSingleton( "com.sun.star.logging.DocumentIOLogRing" ), UNO_QUERY_THROW ); + Reference<XComponentContext> xContext( ::comphelper::getProcessComponentContext() ); + pImp->m_xLogRing.set( logging::DocumentIOLogRing::get(xContext) ); } catch( uno::Exception& ) {} @@ -2066,9 +2066,8 @@ void SfxObjectShell::StoreLog() { try { - ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); - if ( aContext.is() ) - pImp->m_xLogRing.set( aContext.getSingleton( "com.sun.star.logging.DocumentIOLogRing" ), UNO_QUERY_THROW ); + Reference<XComponentContext> xContext( ::comphelper::getProcessComponentContext() ); + pImp->m_xLogRing.set( logging::DocumentIOLogRing::get(xContext) ); } catch( uno::Exception& ) {} |