summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2010-03-16 11:28:36 +0100
committerMichael Stahl <mst@openoffice.org>2010-03-16 11:28:36 +0100
commitf907a057665ac81356218d6ecb05008542b0db22 (patch)
treee222a2b08c5aa37a432cc3574cfa42ef448548ce /sw
parent114b920b0856f4b4acd79f8c288b93a6464161ea (diff)
odfmetadata4: #i109599#: SwXTextSection: add support for xml:id.
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/unosection.hxx12
-rw-r--r--sw/source/core/unocore/unosect.cxx19
2 files changed, 29 insertions, 2 deletions
diff --git a/sw/inc/unosection.hxx b/sw/inc/unosection.hxx
index e5c189c26af0..e54bdd5775af 100644
--- a/sw/inc/unosection.hxx
+++ b/sw/inc/unosection.hxx
@@ -39,6 +39,8 @@
#include <cppuhelper/implbase7.hxx>
+#include <sfx2/Metadatable.hxx>
+
#include <unobaseclass.hxx>
@@ -52,8 +54,9 @@ class SwSectionFmt;
struct SwTextSectionProperties_Impl;
-typedef ::cppu::WeakImplHelper7
-< ::com::sun::star::lang::XUnoTunnel
+typedef ::cppu::ImplInheritanceHelper7
+< ::sfx2::MetadatableMixin
+, ::com::sun::star::lang::XUnoTunnel
, ::com::sun::star::lang::XServiceInfo
, ::com::sun::star::beans::XPropertySet
, ::com::sun::star::beans::XPropertyState
@@ -84,6 +87,11 @@ public:
CreateXTextSection(SwSectionFmt *const pFmt = 0,
const bool bIndexHeader = false);
+ // MetadatableMixin
+ virtual ::sfx2::Metadatable* GetCoreObject();
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
+ GetModel();
+
static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId();
// XUnoTunnel
diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx
index 8654ae5d82b8..1e18cc5becc5 100644
--- a/sw/source/core/unocore/unosect.cxx
+++ b/sw/source/core/unocore/unosect.cxx
@@ -1894,3 +1894,22 @@ SwXTextSection::getSupportedServiceNames() throw (uno::RuntimeException)
g_nServicesTextSection, g_ServicesTextSection);
}
+
+// MetadatableMixin
+::sfx2::Metadatable* SwXTextSection::GetCoreObject()
+{
+ SwSectionFmt *const pSectionFmt( m_pImpl->GetSectionFmt() );
+ return pSectionFmt;
+}
+
+uno::Reference<frame::XModel> SwXTextSection::GetModel()
+{
+ SwSectionFmt *const pSectionFmt( m_pImpl->GetSectionFmt() );
+ if (pSectionFmt)
+ {
+ SwDocShell const*const pShell( pSectionFmt->GetDoc()->GetDocShell() );
+ return (pShell) ? pShell->GetModel() : 0;
+ }
+ return 0;
+}
+