Kaydet (Commit) 31e8084f authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen Kaydeden (comit) Björn Michaelsen

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/13334Reviewed-by: 's avatarBjörn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: 's avatarBjörn Michaelsen <bjoern.michaelsen@canonical.com>
üst b5677f2d
...@@ -154,6 +154,7 @@ namespace sw ...@@ -154,6 +154,7 @@ namespace sw
private: private:
/** the item in the ring where iteration starts */ /** the item in the ring where iteration starts */
value_type* m_pStart; value_type* m_pStart;
typedef typename std::remove_const<value_type>::type nonconst_value_type;
public: public:
RingContainer( value_type* pRing ) : m_pStart(pRing) {}; RingContainer( value_type* pRing ) : m_pStart(pRing) {};
...@@ -201,9 +202,9 @@ namespace sw ...@@ -201,9 +202,9 @@ namespace sw
: m_pCurrent(nullptr) : m_pCurrent(nullptr)
, m_pStart(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_pCurrent(nullptr)
, m_pStart(const_cast<nonconst_value_type*>(pRing)) , m_pStart(pRing)
{ {
if(!bStart) if(!bStart)
m_pCurrent = m_pStart; m_pCurrent = m_pStart;
...@@ -239,23 +240,23 @@ namespace sw ...@@ -239,23 +240,23 @@ namespace sw
template <typename value_type> template <typename value_type>
inline typename Ring<value_type>::const_ring_container Ring<value_type>::GetRingContainer() const 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> template <typename value_type>
inline typename RingContainer<value_type>::iterator RingContainer<value_type>::begin() 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> template <typename value_type>
inline typename RingContainer<value_type>::iterator RingContainer<value_type>::end() 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> template <typename value_type>
inline typename RingContainer<value_type>::const_iterator RingContainer<value_type>::begin() const 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> template <typename value_type>
inline typename RingContainer<value_type>::const_iterator RingContainer<value_type>::end() const 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 #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment