summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-04-25 22:24:58 +0200
committerMichael Stahl <mstahl@redhat.com>2015-04-25 23:01:32 +0200
commitc23dd470d49d722197c148f4ef64a6a3350af88d (patch)
tree01ce5a4c9d30367fbb349e15e1f17516aa3b367b
parentbdf3c9bff607e3977c8455927b21ba292530d25a (diff)
sw: same treatment for SwCursor's fake "copy constructor"
Change-Id: Id627274ca6ad87e7e85b5ce64419ed68a5d4c9c3
-rw-r--r--sw/inc/swcrsr.hxx7
-rw-r--r--sw/inc/viscrs.hxx1
-rw-r--r--sw/source/core/crsr/swcrsr.cxx4
-rw-r--r--sw/source/core/crsr/viscrs.cxx2
4 files changed, 9 insertions, 5 deletions
diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx
index 1e84b16537ef..5e3ea0a228b0 100644
--- a/sw/inc/swcrsr.hxx
+++ b/sw/inc/swcrsr.hxx
@@ -69,6 +69,8 @@ class SW_DLLPUBLIC SwCursor : public SwPaM
using SwPaM::Find;
+ SwCursor(SwCursor const& rPaM) SAL_DELETED_FUNCTION;
+
protected:
_SwCursor_SavePos* CreateNewSavePos() const;
void SaveState();
@@ -86,8 +88,9 @@ public:
SwCursor( const SwPosition &rPos, SwPaM* pRing, bool bColumnSel );
virtual ~SwCursor();
- // @@@ semantic: no copy ctor.
- SwCursor( SwCursor& rCpy);
+ /// this takes a second parameter, which indicates the Ring that
+ /// the new cursor should be part of (may be null)
+ SwCursor(SwCursor const& rCursor, SwPaM* pRing);
public:
diff --git a/sw/inc/viscrs.hxx b/sw/inc/viscrs.hxx
index a96d366c596e..99b25f761f22 100644
--- a/sw/inc/viscrs.hxx
+++ b/sw/inc/viscrs.hxx
@@ -126,6 +126,7 @@ public:
SwShellCrsr( const SwCrsrShell& rCrsrSh, const SwPosition &rPos );
SwShellCrsr( const SwCrsrShell& rCrsrSh, const SwPosition &rPos,
const Point& rPtPos, SwPaM* pRing = 0 );
+ // note: *intentionally* links the new shell cursor into the old one's Ring
SwShellCrsr( SwShellCrsr& );
virtual ~SwShellCrsr();
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index e0a1a9ce4734..dcca20dbf38c 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -123,8 +123,8 @@ SwCursor::SwCursor( const SwPosition &rPos, SwPaM* pRing, bool bColumnSel )
}
// @@@ semantic: no copy ctor.
-SwCursor::SwCursor( SwCursor& rCpy )
- : SwPaM( rCpy, &rCpy )
+SwCursor::SwCursor(SwCursor const& rCpy, SwPaM *const pRing)
+ : SwPaM( rCpy, pRing )
, m_pSavePos(nullptr)
, m_nRowSpanOffset(rCpy.m_nRowSpanOffset)
, m_nCursorBidiLevel(rCpy.m_nCursorBidiLevel)
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 11ef0f5effc0..f5cdeb8a1299 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -528,7 +528,7 @@ SwShellCrsr::SwShellCrsr(
{}
SwShellCrsr::SwShellCrsr( SwShellCrsr& rICrsr )
- : SwCursor(rICrsr)
+ : SwCursor(rICrsr, &rICrsr)
, SwSelPaintRects(*rICrsr.GetShell())
, m_MarkPt(rICrsr.GetMkPos())
, m_PointPt(rICrsr.GetPtPos())