summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2014-12-05 04:29:45 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2014-12-05 16:10:35 +0100
commitdd21dac3ea6f0d78061d602c99c7d952a29661ad (patch)
treec3b1e17f1de65677e64eb7fd3c07c48d549a3c66
parentee9344b68fcca2d1db8eba99d39874edc4aec822 (diff)
Rename GetNext/GetPrev to GetPrevInRing/GetNextInRing ...
... and make them protected. We already have way too many GetNexts in Writer. For now heal this by providing wrappers in the derived classes. This should allow to remove these classes from exposing these one at a time. Change-Id: Iabe3a56e22a4e640e6887aa98decf4e021e627bc
-rw-r--r--sw/inc/pam.hxx8
-rw-r--r--sw/inc/ring.hxx30
-rw-r--r--sw/inc/viewsh.hxx8
-rw-r--r--sw/source/core/doc/doccomp.cxx4
4 files changed, 33 insertions, 17 deletions
diff --git a/sw/inc/pam.hxx b/sw/inc/pam.hxx
index 9e696d838bc4..4e34cc41c222 100644
--- a/sw/inc/pam.hxx
+++ b/sw/inc/pam.hxx
@@ -304,6 +304,14 @@ public:
OUString GetTxt() const;
void InvalidatePaM();
+ SwPaM* GetNext()
+ { return GetNextInRing(); }
+ const SwPaM* GetNext() const
+ { return GetNextInRing(); }
+ SwPaM* GetPrev()
+ { return GetPrevInRing(); }
+ const SwPaM* GetPrev() const
+ { return GetPrevInRing(); }
};
std::ostream &operator <<(std::ostream& s, const SwPaM& pam);
diff --git a/sw/inc/ring.hxx b/sw/inc/ring.hxx
index 3589cef4b87d..f83ce3e622a6 100644
--- a/sw/inc/ring.hxx
+++ b/sw/inc/ring.hxx
@@ -65,18 +65,6 @@ namespace sw
std::swap(*(&pPrev->pNext), *(&pDestRing->pPrev->pNext));
std::swap(*(&pPrev), *(&pDestRing->pPrev));
}
- /** @return the next item in the ring container */
- value_type* GetNext()
- { return pNext; }
- /** @return the previous item in the ring container */
- value_type* GetPrev()
- { return pPrev; }
- /** @return the next item in the ring container */
- const_value_type* GetNext() const
- { return pNext; }
- /** @return the previous item in the ring container */
- const_value_type* GetPrev() const
- { return pPrev; }
/** @return a stl-like container with begin()/end() for iteration */
ring_container GetRingContainer();
/** @return a stl-like container with begin()/end() for const iteration */
@@ -97,6 +85,18 @@ namespace sw
* @param pRing ring container to add the created item to
*/
Ring( value_type* pRing );
+ /** @return the next item in the ring container */
+ value_type* GetNextInRing()
+ { return pNext; }
+ /** @return the previous item in the ring container */
+ value_type* GetPrevInRing()
+ { return pPrev; }
+ /** @return the next item in the ring container */
+ const_value_type* GetNextInRing() const
+ { return pNext; }
+ /** @return the previous item in the ring container */
+ const_value_type* GetPrevInRing() const
+ { return pPrev; }
private:
/** internal implementation class -- not for external use */
@@ -105,9 +105,9 @@ namespace sw
typedef value_type node;
typedef value_type* node_ptr;
typedef const value_type* const_node_ptr;
- static node_ptr get_next(const_node_ptr n) { return const_cast<node_ptr>(static_cast<const_node_ptr>(n))->GetNext(); };
+ static node_ptr get_next(const_node_ptr n) { return const_cast<node_ptr>(static_cast<const_node_ptr>(n))->GetNextInRing(); };
static void set_next(node_ptr n, node_ptr next) { n->pNext = next; };
- static node_ptr get_previous(const_node_ptr n) { return const_cast<node_ptr>(static_cast<const_node_ptr>(n))->GetPrev(); };
+ static node_ptr get_previous(const_node_ptr n) { return const_cast<node_ptr>(static_cast<const_node_ptr>(n))->GetPrevInRing(); };
static void set_previous(node_ptr n, node_ptr previous) { n->pPrev = previous; };
};
friend typename ring_container::iterator;
@@ -202,7 +202,7 @@ namespace sw
private:
friend class boost::iterator_core_access;
void increment()
- { m_pCurrent = m_pCurrent ? m_pCurrent->GetNext() : m_pStart->GetNext(); }
+ { m_pCurrent = m_pCurrent ? m_pCurrent->GetNextInRing() : m_pStart->GetNext(); }
bool equal(RingIterator const& other) const
{
// we never want to compare iterators from
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 6896e9ee4638..1c5eddb2a5f5 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -572,6 +572,14 @@ public:
bool IsShowHeaderFooterSeparator( FrameControlType eControl ) { return (eControl == Header)? mbShowHeaderSeparator: mbShowFooterSeparator; }
virtual void SetShowHeaderFooterSeparator( FrameControlType eControl, bool bShow ) { if ( eControl == Header ) mbShowHeaderSeparator = bShow; else mbShowFooterSeparator = bShow; }
bool IsSelectAll() { return mbSelectAll; }
+ SwViewShell* GetNext()
+ { return GetNextInRing(); }
+ const SwViewShell* GetNext() const
+ { return GetNextInRing(); }
+ SwViewShell* GetPrev()
+ { return GetPrevInRing(); }
+ const SwViewShell* GetPrev() const
+ { return GetPrevInRing(); }
};
// manages global ShellPointer
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index 588051ef3f56..077d4600f06f 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -1837,9 +1837,9 @@ public:
const SwRangeRedline& rSrcRedl, _SaveMergeRedlines* pRing );
sal_uInt16 InsertRedline();
_SaveMergeRedlines* GetNext()
- { return GetNext(); }
+ { return GetNextInRing(); }
_SaveMergeRedlines* GetPrev()
- { return GetPrev(); }
+ { return GetPrevInRing(); }
};
_SaveMergeRedlines::_SaveMergeRedlines( const SwNode& rDstNd,