summaryrefslogtreecommitdiff
path: root/sw/inc/ring.hxx
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2014-12-06 16:28:34 +0100
committerBjörn Michaelsen <bjoern.michaelsen@canonical.com>2014-12-07 06:59:16 +0000
commit31e8084fc07c3de09230c0f0c6ed947b3de98df1 (patch)
treebb41a5b8fb6c91472acf14b93bf74cc124d5240c /sw/inc/ring.hxx
parentb5677f2d962a06f795db18fa264337128664f1fc (diff)
trying to fix Windows breaker into the blind
- ring.hxx(246) : error C2440: ´<function-style-cast>´ : cannot convert from ´const SwViewShell *´ to ´sw::RingIterator<const value_type>´ - ring.hxx(250) : error C2665: ´sw::RingIterator<const value_type>::RingIterator´ : none of the 3 overloads could convert all the argument types - only tested on gcc-4.8 here Change-Id: I181b8a694834133ef31a4a89bf93c90e3ce63b54 Reviewed-on: https://gerrit.libreoffice.org/13334 Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com> Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Diffstat (limited to 'sw/inc/ring.hxx')
-rw-r--r--sw/inc/ring.hxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/sw/inc/ring.hxx b/sw/inc/ring.hxx
index 9c499460721c..b4cb4a0a8cfa 100644
--- a/sw/inc/ring.hxx
+++ b/sw/inc/ring.hxx
@@ -154,6 +154,7 @@ namespace sw
private:
/** the item in the ring where iteration starts */
value_type* m_pStart;
+ typedef typename std::remove_const<value_type>::type nonconst_value_type;
public:
RingContainer( value_type* pRing ) : m_pStart(pRing) {};
@@ -201,9 +202,9 @@ namespace sw
: m_pCurrent(nullptr)
, m_pStart(nullptr)
{}
- explicit RingIterator(value_type* pRing, bool bStart = true)
+ explicit RingIterator(nonconst_value_type* pRing, bool bStart = true)
: m_pCurrent(nullptr)
- , m_pStart(const_cast<nonconst_value_type*>(pRing))
+ , m_pStart(pRing)
{
if(!bStart)
m_pCurrent = m_pStart;
@@ -239,23 +240,23 @@ namespace sw
template <typename value_type>
inline typename Ring<value_type>::const_ring_container Ring<value_type>::GetRingContainer() const
- { return Ring<value_type>::const_ring_container(static_cast< const value_type* >(this)); };
+ { return Ring<value_type>::const_ring_container(static_cast< const_value_type* >(this)); };
template <typename value_type>
inline typename RingContainer<value_type>::iterator RingContainer<value_type>::begin()
- { return RingContainer<value_type>::iterator(m_pStart); };
+ { return RingContainer<value_type>::iterator(const_cast< nonconst_value_type* >(m_pStart)); };
template <typename value_type>
inline typename RingContainer<value_type>::iterator RingContainer<value_type>::end()
- { return RingContainer<value_type>::iterator(m_pStart, false); };
+ { return RingContainer<value_type>::iterator(const_cast< nonconst_value_type* >(m_pStart), false); };
template <typename value_type>
inline typename RingContainer<value_type>::const_iterator RingContainer<value_type>::begin() const
- { return RingContainer<value_type>::const_iterator(m_pStart); };
+ { return RingContainer<value_type>::const_iterator(const_cast< nonconst_value_type* >(m_pStart)); };
template <typename value_type>
inline typename RingContainer<value_type>::const_iterator RingContainer<value_type>::end() const
- { return RingContainer<value_type>::const_iterator(m_pStart, false); };
+ { return RingContainer<value_type>::const_iterator(const_cast< nonconst_value_type* >(m_pStart), false); };
}
#endif