diff options
author | Noel Grandin <noel@peralex.com> | 2013-01-09 16:30:29 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-01-28 08:23:03 +0200 |
commit | 29f17580a59421d7dd5f8c6bef980ae30cc63bb6 (patch) | |
tree | aa4681bd7afc32a6a5195c69e9180653136211f7 | |
parent | 09cf6fe83a9d895dc6d5b3db91fd54aeaf4d0ea7 (diff) |
fdo#46808, Convert svl/lockfile code to XComponentContext
Change-Id: I380944aa5e16b160ac76f939a839c513d4fbf232
-rw-r--r-- | svl/inc/svl/documentlockfile.hxx | 3 | ||||
-rw-r--r-- | svl/inc/svl/lockfilecommon.hxx | 6 | ||||
-rw-r--r-- | svl/inc/svl/sharecontrolfile.hxx | 5 | ||||
-rw-r--r-- | svl/source/misc/documentlockfile.cxx | 6 | ||||
-rw-r--r-- | svl/source/misc/lockfilecommon.cxx | 6 | ||||
-rw-r--r-- | svl/source/misc/sharecontrolfile.cxx | 4 |
6 files changed, 10 insertions, 20 deletions
diff --git a/svl/inc/svl/documentlockfile.hxx b/svl/inc/svl/documentlockfile.hxx index b7de77e70cd1..f0c105e17200 100644 --- a/svl/inc/svl/documentlockfile.hxx +++ b/svl/inc/svl/documentlockfile.hxx @@ -27,7 +27,6 @@ #include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/io/XSeekable.hpp> #include <com/sun/star/io/XTruncate.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <svl/lockfilecommon.hxx> @@ -43,7 +42,7 @@ class SVL_DLLPUBLIC DocumentLockFile : public LockFileCommon void WriteEntryToStream( ::com::sun::star::uno::Sequence< ::rtl::OUString > aEntry, ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > xStream ); public: - DocumentLockFile( const ::rtl::OUString& aOrigURL, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory = ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >() ); + DocumentLockFile( const ::rtl::OUString& aOrigURL ); ~DocumentLockFile(); sal_Bool CreateOwnLockFile(); diff --git a/svl/inc/svl/lockfilecommon.hxx b/svl/inc/svl/lockfilecommon.hxx index 6bff195794b9..bcf0d58088dd 100644 --- a/svl/inc/svl/lockfilecommon.hxx +++ b/svl/inc/svl/lockfilecommon.hxx @@ -27,7 +27,6 @@ #include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/io/XSeekable.hpp> #include <com/sun/star/io/XTruncate.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <osl/mutex.hxx> #include <tools/urlobj.hxx> @@ -46,15 +45,12 @@ class SVL_DLLPUBLIC LockFileCommon { protected: ::osl::Mutex m_aMutex; - - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory; ::rtl::OUString m_aURL; - INetURLObject ResolveLinks( const INetURLObject& aDocURL ); public: - LockFileCommon( const ::rtl::OUString& aOrigURL, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory, const ::rtl::OUString& aPrefix ); + LockFileCommon( const ::rtl::OUString& aOrigURL, const ::rtl::OUString& aPrefix ); ~LockFileCommon(); static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > > ParseList( const ::com::sun::star::uno::Sequence< sal_Int8 >& aBuffer ); diff --git a/svl/inc/svl/sharecontrolfile.hxx b/svl/inc/svl/sharecontrolfile.hxx index 8cb560169ed3..8ac3abacd969 100644 --- a/svl/inc/svl/sharecontrolfile.hxx +++ b/svl/inc/svl/sharecontrolfile.hxx @@ -27,7 +27,6 @@ #include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/io/XSeekable.hpp> #include <com/sun/star/io/XTruncate.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <svl/lockfilecommon.hxx> @@ -54,13 +53,13 @@ class SVL_DLLPUBLIC ShareControlFile : public LockFileCommon void Close(); sal_Bool IsValid() { - return ( m_xFactory.is() && m_xStream.is() && m_xInputStream.is() && m_xOutputStream.is() && m_xSeekable.is() && m_xTruncate.is() ); + return ( m_xStream.is() && m_xInputStream.is() && m_xOutputStream.is() && m_xSeekable.is() && m_xTruncate.is() ); } public: // The constructor will throw exception in case the stream can not be opened - ShareControlFile( const ::rtl::OUString& aOrigURL, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory = ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >() ); + ShareControlFile( const ::rtl::OUString& aOrigURL ); ~ShareControlFile(); ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > > GetUsersData(); diff --git a/svl/source/misc/documentlockfile.cxx b/svl/source/misc/documentlockfile.cxx index cebc89b26b1c..5bb2d58eb63f 100644 --- a/svl/source/misc/documentlockfile.cxx +++ b/svl/source/misc/documentlockfile.cxx @@ -53,8 +53,8 @@ namespace svt { sal_Bool DocumentLockFile::m_bAllowInteraction = sal_True; // ---------------------------------------------------------------------- -DocumentLockFile::DocumentLockFile( const ::rtl::OUString& aOrigURL, const uno::Reference< lang::XMultiServiceFactory >& xFactory ) -: LockFileCommon( aOrigURL, xFactory, ::rtl::OUString( ".~lock." ) ) +DocumentLockFile::DocumentLockFile( const ::rtl::OUString& aOrigURL ) +: LockFileCommon( aOrigURL, ::rtl::OUString( ".~lock." ) ) { } @@ -92,7 +92,7 @@ sal_Bool DocumentLockFile::CreateOwnLockFile() try { uno::Reference< io::XStream > xTempFile( - io::TempFile::create(comphelper::getComponentContext(m_xFactory)), + io::TempFile::create( comphelper::getProcessComponentContext() ), uno::UNO_QUERY_THROW ); uno::Reference< io::XSeekable > xSeekable( xTempFile, uno::UNO_QUERY_THROW ); diff --git a/svl/source/misc/lockfilecommon.cxx b/svl/source/misc/lockfilecommon.cxx index 7df914d7f6f5..bb5ae628bf6b 100644 --- a/svl/source/misc/lockfilecommon.cxx +++ b/svl/source/misc/lockfilecommon.cxx @@ -54,12 +54,8 @@ using namespace ::com::sun::star; namespace svt { // ---------------------------------------------------------------------- -LockFileCommon::LockFileCommon( const ::rtl::OUString& aOrigURL, const uno::Reference< lang::XMultiServiceFactory >& xFactory, const ::rtl::OUString& aPrefix ) -: m_xFactory( xFactory ) +LockFileCommon::LockFileCommon( const ::rtl::OUString& aOrigURL, const ::rtl::OUString& aPrefix ) { - if ( !m_xFactory.is() ) - m_xFactory = ::comphelper::getProcessServiceFactory(); - INetURLObject aDocURL = ResolveLinks( INetURLObject( aOrigURL ) ); ::rtl::OUString aShareURLString = aDocURL.GetPartBeforeLastName(); diff --git a/svl/source/misc/sharecontrolfile.cxx b/svl/source/misc/sharecontrolfile.cxx index c0e7daa539bc..9d6c481d89a0 100644 --- a/svl/source/misc/sharecontrolfile.cxx +++ b/svl/source/misc/sharecontrolfile.cxx @@ -52,8 +52,8 @@ using namespace ::com::sun::star; namespace svt { // ---------------------------------------------------------------------- -ShareControlFile::ShareControlFile( const ::rtl::OUString& aOrigURL, const uno::Reference< lang::XMultiServiceFactory >& xFactory ) -: LockFileCommon( aOrigURL, xFactory, ::rtl::OUString( ".~sharing." ) ) +ShareControlFile::ShareControlFile( const ::rtl::OUString& aOrigURL ) +: LockFileCommon( aOrigURL, ::rtl::OUString( ".~sharing." ) ) { OpenStream(); |