diff options
author | Noel Grandin <noel@peralex.com> | 2013-01-31 11:29:04 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-02-11 08:02:17 +0200 |
commit | 5bef4dc30c3dc70bc4d4b2cfbd2d1f729d714dfe (patch) | |
tree | 63aa0ce59af7e58e9f673d17571e14f5c5157747 | |
parent | 89fed427f080862cf9615e2b2b57faefb639d6ce (diff) |
fdo#46808, use service constructor for document::DocumentIOLogRing
Change-Id: I39f6d9f671dcb03779d594df5af60c9a0e3ca451
-rw-r--r-- | package/source/xstor/owriteablestream.cxx | 15 | ||||
-rw-r--r-- | package/source/xstor/xstorage.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/doc/docfile.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/doc/objmisc.cxx | 11 |
4 files changed, 17 insertions, 21 deletions
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx index 4da325384247..73a7198bd89c 100644 --- a/package/source/xstor/owriteablestream.cxx +++ b/package/source/xstor/owriteablestream.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/lang/XTypeProvider.hpp> +#include <com/sun/star/logging/DocumentIOLogRing.hpp> #include <com/sun/star/io/TempFile.hpp> #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/IOException.hpp> @@ -85,12 +86,9 @@ void StaticAddLog( const ::rtl::OUString& aMessage ) { try { - ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); - if ( aContext.is() ) - { - uno::Reference< logging::XSimpleLogRing > xLogRing( aContext.getSingleton( "com.sun.star.logging.DocumentIOLogRing" ), uno::UNO_QUERY_THROW ); - xLogRing->logString( aMessage ); - } + uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + uno::Reference< logging::XSimpleLogRing > xLogRing( logging::DocumentIOLogRing::get(xContext) ); + xLogRing->logString( aMessage ); } catch( const uno::Exception& ) { @@ -351,9 +349,8 @@ void OWriteStream_Impl::AddLog( const ::rtl::OUString& aMessage ) { try { - ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); - if ( aContext.is() ) - m_xLogRing.set( aContext.getSingleton( "com.sun.star.logging.DocumentIOLogRing" ), uno::UNO_QUERY_THROW ); + uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); + m_xLogRing = logging::DocumentIOLogRing::get(xContext); } catch( const uno::Exception& ) { diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index bfd2302a47b7..8c98b87bab72 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/embed/StorageFormats.hpp> #include <com/sun/star/ucb/XProgressHandler.hpp> #include <com/sun/star/io/TempFile.hpp> +#include <com/sun/star/logging/DocumentIOLogRing.hpp> #include <com/sun/star/ucb/SimpleFileAccess.hpp> #include <com/sun/star/container/XHierarchicalNameAccess.hpp> #include <com/sun/star/container/XEnumerationAccess.hpp> @@ -403,9 +404,8 @@ void OStorage_Impl::AddLog( const ::rtl::OUString& aMessage ) { try { - ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); - if ( aContext.is() ) - m_xLogRing.set( aContext.getSingleton( "com.sun.star.logging.DocumentIOLogRing" ), uno::UNO_QUERY_THROW ); + uno::Reference<uno::XComponentContext> xContext( ::comphelper::getProcessComponentContext() ); + m_xLogRing = logging::DocumentIOLogRing::get(xContext); } catch( const uno::Exception& ) { 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& ) {} |