diff options
author | Michael Stahl <mst@openoffice.org> | 2010-01-08 17:13:52 +0100 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2010-01-08 17:13:52 +0100 |
commit | 1f8d8b1e17487074cf77595ab9d9569858e6f04e (patch) | |
tree | 73a3f60d94e65634a9419ed93d9271cce9cf8c12 /sw/inc/unotextrange.hxx | |
parent | swunolocking1: #i105557#: SwXTextRange: (diff) | |
download | core-1f8d8b1e17487074cf77595ab9d9569858e6f04e.tar.gz core-1f8d8b1e17487074cf77595ab9d9569858e6f04e.zip |
swunolocking1: #i105557#: fix locking for SwXTextRange:
add Impl struct, and use UnoImplPtr to lock destructor.
move all implementation details out of header, into Impl struct.
use new XUnoTunnel and XServiceInfo helpers.
clean up the implementation a little.
Diffstat (limited to 'sw/inc/unotextrange.hxx')
-rw-r--r-- | sw/inc/unotextrange.hxx | 54 |
1 files changed, 14 insertions, 40 deletions
diff --git a/sw/inc/unotextrange.hxx b/sw/inc/unotextrange.hxx index 079296d2a441..8b34ce7f94c1 100644 --- a/sw/inc/unotextrange.hxx +++ b/sw/inc/unotextrange.hxx @@ -45,26 +45,15 @@ #include <cppuhelper/implbase3.hxx> #include <cppuhelper/implbase8.hxx> -#include <calbck.hxx> #include <pam.hxx> #include <unobaseclass.hxx> -class String; -class SfxItemPropertySet; class SwDoc; -class SwStartNode; struct SwPosition; class SwPaM; class SwUnoCrsr; class SwFrmFmt; -class SwTableBox; - -namespace sw { - namespace mark { - class IMark; - } -} /* -----------------29.04.98 07:35------------------- * @@ -104,13 +93,15 @@ typedef ::cppu::WeakImplHelper8 class SW_DLLPUBLIC SwXTextRange : public SwXTextRange_Base - , private SwClient { private: friend class SwXText; + class Impl; + ::sw::UnoImplPtr<Impl> m_pImpl; + enum RangePosition { RANGE_IN_TEXT, // "ordinary" ::com::sun::star::text::TextRange @@ -118,26 +109,14 @@ private: RANGE_IN_CELL, // position created with a cell that has no uno object RANGE_IS_TABLE, // anchor of a table RANGE_INVALID // created by NewInstance - } eRangePosition; - - SwDoc* pDoc; - SwTableBox* pBox; - const SwStartNode* pBoxStartNode; - SwDepend aObjectDepend; // register at format of table or frame - const SfxItemPropertySet* m_pPropSet; - //SwDepend aFrameDepend; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > - xParentText; - ::sw::mark::IMark* pMark; - - const ::sw::mark::IMark * GetBookmark() const - { return pMark; } + }; + void SetPositions(SwPaM const& rPam); //TODO: new exception type for protected content - void DeleteAndInsert(const String& rText, const bool bForceExpandHints) + void DeleteAndInsert( + const ::rtl::OUString& rText, const bool bForceExpandHints) throw (::com::sun::star::uno::RuntimeException); - -protected: + void Invalidate(); virtual ~SwXTextRange(); @@ -146,31 +125,26 @@ public: SwXTextRange(SwPaM& rPam, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > & xParent, - enum RangePosition eRange = RANGE_IN_TEXT); + const enum RangePosition eRange = RANGE_IN_TEXT); // only for RANGE_IS_TABLE SwXTextRange(SwFrmFmt& rTblFmt); - BOOL GetPositions(SwPaM& rToFill) const; - const SwDoc* GetDoc() const - { return pDoc; } - SwDoc* GetDoc() - { return pDoc; } + const SwDoc* GetDoc() const; + SwDoc* GetDoc(); + bool GetPositions(SwPaM & rToFill) const; static BOOL XTextRangeToSwPaM(SwUnoInternalPaM& rToFill, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange); + static ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > CreateTextRangeFromPosition( SwDoc* pDoc, const SwPosition& rPos, const SwPosition* pMark); + static ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > CreateParentXText(SwDoc* pDoc, const SwPosition& rPos); - TYPEINFO(); - - // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); - static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); // XUnoTunnel |