[Libreoffice-commits] core.git: compilerplugins/clang include/sfx2 sfx2/source
Noel Grandin
noel at peralex.com
Mon Jul 4 12:29:15 UTC 2016
compilerplugins/clang/mergeclasses.results | 1 -
include/sfx2/DocumentMetadataAccess.hxx | 7 +++----
include/sfx2/XmlIdRegistry.hxx | 18 ------------------
include/sfx2/objsh.hxx | 5 ++++-
sfx2/source/doc/DocumentMetadataAccess.cxx | 9 +++++----
5 files changed, 12 insertions(+), 28 deletions(-)
New commits:
commit 6964c17415ae2d77a6aa50eeb8464faba7a47d14
Author: Noel Grandin <noel at peralex.com>
Date: Mon Jul 4 11:55:35 2016 +0200
merge sfx2::IXmlIdRegistrySupplier with SfxObjectShell
Change-Id: I7e8bad6b1c944f14b850b91b902b82613c26faeb
Reviewed-on: https://gerrit.libreoffice.org/26899
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results
index 1785f4c..5b4c8e1 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 131fa4e..d77875e 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 d167354..c728e9d 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 6b694f9..cc4b74c 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 87d5b28..6c1813f 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))
{
More information about the Libreoffice-commits
mailing list