summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-03-14 00:05:53 +0100
committerMichael Stahl <mstahl@redhat.com>2015-03-14 00:41:31 +0100
commitbe500fc6edfcc192ac71f1a4cc2bd7ab33328489 (patch)
tree3954e3f406811696fee1bee53394d1700a0c8b82
parentce0e635a65dd637d96f63931950f7571b051d128 (diff)
sw: prefix members of SwShellCrsr
Change-Id: I0be44b2686bf5f6d54cda4e26a1b61cb0c078656
-rw-r--r--sw/inc/viscrs.hxx22
-rw-r--r--sw/source/core/crsr/viscrs.cxx20
2 files changed, 22 insertions, 20 deletions
diff --git a/sw/inc/viscrs.hxx b/sw/inc/viscrs.hxx
index db3a964edd88..855107d86599 100644
--- a/sw/inc/viscrs.hxx
+++ b/sw/inc/viscrs.hxx
@@ -114,9 +114,11 @@ public:
class SwShellCrsr : public virtual SwCursor, public SwSelPaintRects
{
+private:
// Document positions of start/end characters of a SSelection.
- Point aMkPt, aPtPt;
- const SwPosition* pPt; // For assignment of GetPoint() to aPtPt.
+ Point m_MarkPt;
+ Point m_PointPt;
+ const SwPosition* m_pInitialPoint; // For assignment of GetPoint() to m_PointPt.
using SwCursor::UpDown;
@@ -135,14 +137,14 @@ public:
void Hide(); // Hide all selections.
void Invalidate( const SwRect& rRect );
- const Point& GetPtPos() const { return( SwPaM::GetPoint() == pPt ? aPtPt : aMkPt ); }
- Point& GetPtPos() { return( SwPaM::GetPoint() == pPt ? aPtPt : aMkPt ); }
- const Point& GetMkPos() const { return( SwPaM::GetMark() == pPt ? aPtPt : aMkPt ); }
- Point& GetMkPos() { return( SwPaM::GetMark() == pPt ? aPtPt : aMkPt ); }
- const Point& GetSttPos() const { return( SwPaM::Start() == pPt ? aPtPt : aMkPt ); }
- Point& GetSttPos() { return( SwPaM::Start() == pPt ? aPtPt : aMkPt ); }
- const Point& GetEndPos() const { return( SwPaM::End() == pPt ? aPtPt : aMkPt ); }
- Point& GetEndPos() { return( SwPaM::End() == pPt ? aPtPt : aMkPt ); }
+ const Point& GetPtPos() const { return (SwPaM::GetPoint() == m_pInitialPoint) ? m_PointPt : m_MarkPt; }
+ Point& GetPtPos() { return (SwPaM::GetPoint() == m_pInitialPoint) ? m_PointPt : m_MarkPt; }
+ const Point& GetMkPos() const { return (SwPaM::GetMark() == m_pInitialPoint) ? m_PointPt : m_MarkPt; }
+ Point& GetMkPos() { return (SwPaM::GetMark() == m_pInitialPoint) ? m_PointPt : m_MarkPt; }
+ const Point& GetSttPos() const { return (SwPaM::Start() == m_pInitialPoint) ? m_PointPt : m_MarkPt; }
+ Point& GetSttPos() { return (SwPaM::Start() == m_pInitialPoint) ? m_PointPt : m_MarkPt; }
+ const Point& GetEndPos() const { return (SwPaM::End() == m_pInitialPoint) ? m_PointPt : m_MarkPt; }
+ Point& GetEndPos() { return (SwPaM::End() == m_pInitialPoint) ? m_PointPt : m_MarkPt; }
virtual void SetMark() SAL_OVERRIDE;
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 4219bbd7756c..b4475f203c57 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -518,7 +518,7 @@ SwShellCrsr::SwShellCrsr(
const SwPosition &rPos )
: SwCursor(rPos,0,false)
, SwSelPaintRects(rCShell)
- , pPt(SwPaM::GetPoint())
+ , m_pInitialPoint(SwPaM::GetPoint())
{}
SwShellCrsr::SwShellCrsr(
@@ -528,17 +528,17 @@ SwShellCrsr::SwShellCrsr(
SwPaM* pRing )
: SwCursor(rPos, pRing, false)
, SwSelPaintRects(rCShell)
- , aMkPt(rPtPos)
- , aPtPt(rPtPos)
- , pPt(SwPaM::GetPoint())
+ , m_MarkPt(rPtPos)
+ , m_PointPt(rPtPos)
+ , m_pInitialPoint(SwPaM::GetPoint())
{}
SwShellCrsr::SwShellCrsr( SwShellCrsr& rICrsr )
: SwCursor(rICrsr)
, SwSelPaintRects(*rICrsr.GetShell())
- , aMkPt(rICrsr.GetMkPos())
- , aPtPt(rICrsr.GetPtPos())
- , pPt(SwPaM::GetPoint())
+ , m_MarkPt(rICrsr.GetMkPos())
+ , m_PointPt(rICrsr.GetPtPos())
+ , m_pInitialPoint(SwPaM::GetPoint())
{}
SwShellCrsr::~SwShellCrsr()
@@ -551,10 +551,10 @@ bool SwShellCrsr::IsReadOnlyAvailable() const
void SwShellCrsr::SetMark()
{
- if( SwPaM::GetPoint() == pPt )
- aMkPt = aPtPt;
+ if (SwPaM::GetPoint() == m_pInitialPoint)
+ m_MarkPt = m_PointPt;
else
- aPtPt = aMkPt;
+ m_PointPt = m_MarkPt;
SwPaM::SetMark();
}