diff options
author | Noel Grandin <noel@peralex.com> | 2016-07-04 11:55:35 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-07-04 12:28:41 +0000 |
commit | 6964c17415ae2d77a6aa50eeb8464faba7a47d14 (patch) | |
tree | af6a02bbb54f837e67c3922137dcf5e79920a5d0 | |
parent | c752aad43352478ef7065ca7ab844650811e6745 (diff) |
merge sfx2::IXmlIdRegistrySupplier with SfxObjectShell
Change-Id: I7e8bad6b1c944f14b850b91b902b82613c26faeb
Reviewed-on: https://gerrit.libreoffice.org/26899
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r-- | compilerplugins/clang/mergeclasses.results | 1 | ||||
-rw-r--r-- | include/sfx2/DocumentMetadataAccess.hxx | 7 | ||||
-rw-r--r-- | include/sfx2/XmlIdRegistry.hxx | 18 | ||||
-rw-r--r-- | include/sfx2/objsh.hxx | 5 | ||||
-rw-r--r-- | sfx2/source/doc/DocumentMetadataAccess.cxx | 9 |
5 files changed, 12 insertions, 28 deletions
diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results index 1785f4cecf3f..5b4c8e1538c9 100644 --- a/compilerplugins/clang/mergeclasses.results +++ b/compilerplugins/clang/mergeclasses.results @@ -326,7 +326,6 @@ merge sdr::contact::ObjectContactOfPagePainter with sdr::contact::PagePrimitiveE merge sdr::event::EventHandler with sdr::event::TimerEventHandler merge sdr::table::TableDesignUser with sdr::table::SdrTableObjImpl merge sfx2::IXmlIdRegistry with sfx2::XmlIdRegistry -merge sfx2::IXmlIdRegistrySupplier with SfxObjectShell merge sfx::DummyWindowWrapper with sfx::DummyItemConnection merge sfx::MultiControlWrapperHelper with sfx::MultiControlWrapper merge slideshow::internal::(anonymous namespace)::EventContainer with slideshow::internal::ClickEventHandler diff --git a/include/sfx2/DocumentMetadataAccess.hxx b/include/sfx2/DocumentMetadataAccess.hxx index 131fa4e336c1..d77875eb099e 100644 --- a/include/sfx2/DocumentMetadataAccess.hxx +++ b/include/sfx2/DocumentMetadataAccess.hxx @@ -44,6 +44,7 @@ namespace com { namespace sun { namespace star { namespace embed { class XStorage; } } } } +class SfxObjectShell; namespace sfx2 { @@ -65,10 +66,8 @@ createBaseURI( OUString const & i_rSubDocument = OUString()); -class IXmlIdRegistrySupplier; struct DocumentMetadataAccess_Impl; - class SFX2_DLLPUBLIC DocumentMetadataAccess : public ::cppu::WeakImplHelper1< css::rdf::XDocumentMetadataAccess> { @@ -76,12 +75,12 @@ class SFX2_DLLPUBLIC DocumentMetadataAccess : DocumentMetadataAccess& operator=( const DocumentMetadataAccess& ) = delete; public: explicit DocumentMetadataAccess(css::uno::Reference< css::uno::XComponentContext > const & i_xContext, - IXmlIdRegistrySupplier const & i_rRegistrySupplier, + SfxObjectShell const & i_rRegistrySupplier, OUString const & i_rBaseURI); // N.B.: in contrast to previous, this constructor does _not_ initialize! // caller must immediately call loadFromStorage/Medium! explicit DocumentMetadataAccess(css::uno::Reference< css::uno::XComponentContext > const & i_xContext, - IXmlIdRegistrySupplier const & i_rRegistrySupplier); + SfxObjectShell const & i_rRegistrySupplier); virtual ~DocumentMetadataAccess(); // css::rdf::XNode: diff --git a/include/sfx2/XmlIdRegistry.hxx b/include/sfx2/XmlIdRegistry.hxx index d16735480adf..c728e9dd4caf 100644 --- a/include/sfx2/XmlIdRegistry.hxx +++ b/include/sfx2/XmlIdRegistry.hxx @@ -58,24 +58,6 @@ public: }; -/** supplier interface for the registry. - - This indirection is unfortunately necessary, because the SwDocShell - is not always connected to a SwDoc, so we cannot guarantee that a - registry given to a SfxBaseModel/DocumentMetadataAccess remains valid; - it has to be retrieved from this supplier interface on access. - */ -class SFX2_DLLPUBLIC IXmlIdRegistrySupplier -{ - -public: - virtual ~IXmlIdRegistrySupplier() { } - - /** override this if you have a XmlIdRegistry. */ - virtual const IXmlIdRegistry* GetXmlIdRegistry() const { return nullptr; } - -}; - } // namespace sfx2 #endif // INCLUDED_SFX2_XMLIDREGISTRY_HXX diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx index 6b694f984435..cc4b74ca0b3e 100644 --- a/include/sfx2/objsh.hxx +++ b/include/sfx2/objsh.hxx @@ -199,7 +199,7 @@ template<class T> bool checkSfxObjectShell(const SfxObjectShell* pShell) class SFX2_DLLPUBLIC SfxObjectShell : public SfxShell, virtual public SotObject, - public ::comphelper::IEmbeddedHelper, public ::sfx2::IXmlIdRegistrySupplier + public ::comphelper::IEmbeddedHelper { friend struct ModifyBlocker_Impl; friend class SfxObjectShellLock; @@ -720,6 +720,9 @@ public: SAL_DLLPRIVATE void CancelCheckOut( ); SAL_DLLPRIVATE void CheckIn( ); SAL_DLLPRIVATE css::uno::Sequence< css::document::CmisVersion > GetCmisVersions(); + + /** override this if you have a XmlIdRegistry. */ + virtual const sfx2::IXmlIdRegistry* GetXmlIdRegistry() const { return nullptr; } }; #define SFX_GLOBAL_CLASSID \ diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx index 87d5b282030e..6c1813f160ea 100644 --- a/sfx2/source/doc/DocumentMetadataAccess.cxx +++ b/sfx2/source/doc/DocumentMetadataAccess.cxx @@ -45,6 +45,7 @@ #include <sfx2/docfile.hxx> #include <sfx2/XmlIdRegistry.hxx> +#include <sfx2/objsh.hxx> #include <libxml/tree.h> @@ -188,13 +189,13 @@ struct DocumentMetadataAccess_Impl { // note: these are all initialized in constructor, and loadFromStorage const uno::Reference<uno::XComponentContext> m_xContext; - const IXmlIdRegistrySupplier & m_rXmlIdRegistrySupplier; + const SfxObjectShell & m_rXmlIdRegistrySupplier; uno::Reference<rdf::XURI> m_xBaseURI; uno::Reference<rdf::XRepository> m_xRepository; uno::Reference<rdf::XNamedGraph> m_xManifest; DocumentMetadataAccess_Impl( uno::Reference<uno::XComponentContext> const& i_xContext, - IXmlIdRegistrySupplier const & i_rRegistrySupplier) + SfxObjectShell const & i_rRegistrySupplier) : m_xContext(i_xContext) , m_rXmlIdRegistrySupplier(i_rRegistrySupplier) , m_xBaseURI() @@ -768,7 +769,7 @@ static void init(struct DocumentMetadataAccess_Impl & i_rImpl) DocumentMetadataAccess::DocumentMetadataAccess( uno::Reference< uno::XComponentContext > const & i_xContext, - const IXmlIdRegistrySupplier & i_rRegistrySupplier) + const SfxObjectShell & i_rRegistrySupplier) : m_pImpl(new DocumentMetadataAccess_Impl(i_xContext, i_rRegistrySupplier)) { // no initialization: must call loadFrom... @@ -776,7 +777,7 @@ DocumentMetadataAccess::DocumentMetadataAccess( DocumentMetadataAccess::DocumentMetadataAccess( uno::Reference< uno::XComponentContext > const & i_xContext, - const IXmlIdRegistrySupplier & i_rRegistrySupplier, + const SfxObjectShell & i_rRegistrySupplier, OUString const & i_rURI) : m_pImpl(new DocumentMetadataAccess_Impl(i_xContext, i_rRegistrySupplier)) { |