summaryrefslogtreecommitdiff
path: root/sw/inc/ring.hxx
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 /sw/inc/ring.hxx
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
Diffstat (limited to 'sw/inc/ring.hxx')
-rw-r--r--sw/inc/ring.hxx30
1 files changed, 15 insertions, 15 deletions
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