summaryrefslogtreecommitdiff
path: root/sw/inc/unosection.hxx
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2010-01-08 17:13:51 +0100
committerMichael Stahl <mst@openoffice.org>2010-01-08 17:13:51 +0100
commit2fee7963e992089b67eeb2fb60da27054037da32 (patch)
tree9b6b4df49fd55cef127e587cc4641c00526afd06 /sw/inc/unosection.hxx
parent77ca8486db12a970aef9aeafea3ac9a4c297d2b2 (diff)
swunolocking1: #i105557#: fix locking for SwXTextSection:
replace SwXTextSectionClient with Impl struct, use UnoImplPtr to lock dtor. move all implementation details out of header, into Impl struct. remove ugly destruction of SwUnoCrsr via Application::PostUserEvent. replace broken SwClient iteration with a WeakReference in SwSectionFmt. add factory function CreateXTextSection. use new XUnoTunnel and XServiceInfo helpers. clean up the implementation a little.
Diffstat (limited to 'sw/inc/unosection.hxx')
-rw-r--r--sw/inc/unosection.hxx102
1 files changed, 8 insertions, 94 deletions
diff --git a/sw/inc/unosection.hxx b/sw/inc/unosection.hxx
index 31d15d7010d4..6f3eb1794c84 100644
--- a/sw/inc/unosection.hxx
+++ b/sw/inc/unosection.hxx
@@ -43,14 +43,9 @@
#include <cppuhelper/implbase7.hxx>
-#include <tools/link.hxx>
-#include <tools/string.hxx>
+#include <unobaseclass.hxx>
-#include <calbck.hxx>
-#include <unoevtlstnr.hxx>
-
-class SfxItemPropertySet;
class SwSectionFmt;
@@ -58,51 +53,6 @@ class SwSectionFmt;
--------------------------------------------------*/
-class SwXTextSection;
-
-class SwXTextSectionClient
- : public SwClient
-{
-
-private:
-
- friend class SwXTextSection;
-
- SwXTextSection * m_pSection;
- ::com::sun::star::uno::WeakReference<
- ::com::sun::star::text::XTextSection > m_xReference;
-
- // SwClient
- virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew);
-
- SwXTextSectionClient(
- SwSectionFmt& rFmt,
- SwXTextSection& rTextSection,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::text::XTextSection > xSection);
-
- virtual ~SwXTextSectionClient();
-
- DECL_STATIC_LINK( SwXTextSectionClient, RemoveSectionClient_Impl,
- SwXTextSectionClient* );
-
-public:
-
- TYPEINFO();
-
- ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextSection >
- GetXTextSection();
-
- static ::com::sun::star::uno::Reference<
- ::com::sun::star::text::XTextSection >
- CreateXTextSection(SwSectionFmt* pFmt = 0, BOOL bIndexHeader = FALSE);
- static SwXTextSectionClient* Create(
- SwXTextSection& rSection,
- ::com::sun::star::uno::Reference<
- ::com::sun::star::text::XTextSection > xSection,
- SwSectionFmt& rFmt);
-};
-
struct SwTextSectionProperties_Impl;
@@ -122,57 +72,21 @@ class SwXTextSection
private:
- friend class SwXTextSectionClient;
-
- SwEventListenerContainer aLstnrCntnr;
- const SfxItemPropertySet* m_pPropSet;
+ class Impl;
+ ::sw::UnoImplPtr<Impl> m_pImpl;
- BOOL m_bIsDescriptor;
- BOOL m_bIndexHeader;
- String m_sName;
- SwTextSectionProperties_Impl* pProps;
- SwXTextSectionClient* m_pClient;
-
-protected:
-
- void SAL_CALL SetPropertyValues_Impl(
- const ::com::sun::star::uno::Sequence< ::rtl::OUString >&
- rPropertyNames,
- const ::com::sun::star::uno::Sequence<
- ::com::sun::star::uno::Any >& aValues)
- throw (::com::sun::star::beans::UnknownPropertyException,
- ::com::sun::star::beans::PropertyVetoException,
- ::com::sun::star::lang::IllegalArgumentException,
- ::com::sun::star::lang::WrappedTargetException,
- ::com::sun::star::uno::RuntimeException);
- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL
- GetPropertyValues_Impl(
- const ::com::sun::star::uno::Sequence< ::rtl::OUString >&
- rPropertyNames)
- throw (::com::sun::star::beans::UnknownPropertyException,
- ::com::sun::star::lang::WrappedTargetException,
- ::com::sun::star::uno::RuntimeException);
-
- SwXTextSection(sal_Bool bWithFormat, sal_Bool bIndexHeader = FALSE);
+ SwXTextSection(SwSectionFmt *const pFmt, const bool bIndexHeader = false);
virtual ~SwXTextSection();
- void ResetClient() { m_pClient = 0; }
- void SetClient(SwXTextSectionClient* pClient) { m_pClient = pClient; }
-
public:
- void attachToRange(
- const ::com::sun::star::uno::Reference<
- ::com::sun::star::text::XTextRange > & xTextRange)
- throw (::com::sun::star::lang::IllegalArgumentException,
- ::com::sun::star::uno::RuntimeException);
-
SwSectionFmt* GetFmt() const;
- static SwXTextSection* GetImplementation(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::uno::XInterface> xRef);
+ static ::com::sun::star::uno::Reference<
+ ::com::sun::star::text::XTextSection >
+ CreateXTextSection(SwSectionFmt *const pFmt = 0,
+ const bool bIndexHeader = false);
static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId();