diff options
author | Michael Stahl <mst@openoffice.org> | 2010-01-08 17:13:50 +0100 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2010-01-08 17:13:50 +0100 |
commit | ee9d6d30959b5467fb5f2407ce5aa24fe1043fc5 (patch) | |
tree | 1aedb97a7d68051322ce7011b03162422ad458cd /sw/inc/unoparagraph.hxx | |
parent | 440e521dad8c97e939460af857c6a851b220c52e (diff) |
swunolocking1: #i105557#: fix locking for SwXParagraph:
add Impl struct, and use UnoImplPtr to lock destructor.
move all implementation details out of header, into Impl struct.
make SwXParagraph instances reusable with a WeakReference in SwTxtNode.
make constructor private, and add factory function CreateXParagraph.
use new XUnoTunnel and XServiceInfo helpers.
clean up the implementation a little.
Diffstat (limited to 'sw/inc/unoparagraph.hxx')
-rw-r--r-- | sw/inc/unoparagraph.hxx | 75 |
1 files changed, 21 insertions, 54 deletions
diff --git a/sw/inc/unoparagraph.hxx b/sw/inc/unoparagraph.hxx index 984786b0d1fb..d5c5e2ed2832 100644 --- a/sw/inc/unoparagraph.hxx +++ b/sw/inc/unoparagraph.hxx @@ -48,12 +48,11 @@ #include <sfx2/Metadatable.hxx> #include <calbck.hxx> -#include <unoevtlstnr.hxx> #include <unobaseclass.hxx> -class SfxItemPropertySet; struct SwPosition; +class SwPaM; class SwUnoCrsr; class SwStartNode; class SwTxtNode; @@ -80,73 +79,41 @@ typedef ::cppu::ImplInheritanceHelper10 class SwXParagraph : public SwXParagraph_Base - , public SwClient { private: - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; - SwEventListenerContainer aLstnrCntnr; - const SfxItemPropertySet* m_pPropSet; - ::rtl::OUString m_sText; - sal_Int32 nSelectionStartPos; - sal_Int32 nSelectionEndPos; - BOOL m_bIsDescriptor; - -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 >& rValues) - 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); - - ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL - GetPropertyValuesTolerant_Impl( - const ::com::sun::star::uno::Sequence< ::rtl::OUString >& - rPropertyNames, - sal_Bool bDirectValuesOnly) - throw (::com::sun::star::uno::RuntimeException); + class Impl; + ::sw::UnoImplPtr<Impl> m_pImpl; virtual ~SwXParagraph(); + SwXParagraph(::com::sun::star::uno::Reference< + ::com::sun::star::text::XText > const & xParent, + SwTxtNode & rTxtNode, + const sal_Int32 nSelStart = -1, const sal_Int32 nSelEnd = - 1); + public: + /// descriptor SwXParagraph(); - SwXParagraph(::com::sun::star::uno::Reference< - ::com::sun::star::text::XText > const & i_xParent, - SwTxtNode * i_pTxtNode, - sal_Int32 nSelStart = -1, sal_Int32 nSelEnd = - 1); - BOOL IsDescriptor() const {return m_bIsDescriptor;} + static ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent> + CreateXParagraph(SwDoc & rDoc, SwTxtNode& rTxtNode, + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText> + const& xParentText = 0, + const sal_Int32 nSelStart = -1, const sal_Int32 nSelEnd = - 1); const SwTxtNode * GetTxtNode() const; - SwTxtNode * GetTxtNode(); - - static BOOL getDefaultTextContentValue(::com::sun::star::uno::Any& rAny, - const ::rtl::OUString& rPropertyName, USHORT nWID = 0); - static SwXParagraph* GetImplementation( - ::com::sun::star::uno::Reference< - ::com::sun::star::uno::XInterface> xRef); + bool IsDescriptor() const; + /// make rPaM select the paragraph + bool SelectPaM(SwPaM & rPaM); + /// for SwXText void attachToText(SwXText & rParent, SwTxtNode & rTxtNode); - TYPEINFO(); - - // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + static bool getDefaultTextContentValue(::com::sun::star::uno::Any& rAny, + const ::rtl::OUString& rPropertyName, USHORT nWID = 0); // MetadatableMixin virtual ::sfx2::Metadatable* GetCoreObject(); |