Kaydet (Commit) 63b67ab5 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Use public derivation, and remove then-unnecessary downcasts

...the implicitly-private derivation was presumably introduced by accident in
23fd991f "separate the sane from the less sane
in SwClient"

Change-Id: I30ec84b6a30c029cfbeb848ad37c9a532fec0a96
üst 5e2a0f00
...@@ -90,7 +90,7 @@ namespace sw ...@@ -90,7 +90,7 @@ namespace sw
}; };
} }
// SwClient // SwClient
class SW_DLLPUBLIC SwClient : ::sw::WriterListener class SW_DLLPUBLIC SwClient : public ::sw::WriterListener
{ {
// avoids making the details of the linked list and the callback method public // avoids making the details of the linked list and the callback method public
friend class SwModify; friend class SwModify;
...@@ -297,7 +297,7 @@ public: ...@@ -297,7 +297,7 @@ public:
return static_cast<TElementType*>(Sync()); return static_cast<TElementType*>(Sync());
while(GetRightOfPos()) while(GetRightOfPos())
m_pPosition = GetRightOfPos(); m_pPosition = GetRightOfPos();
if(dynamic_cast<const TElementType *>(static_cast<SwClient*>(m_pPosition)) != nullptr) if(dynamic_cast<const TElementType *>(m_pPosition) != nullptr)
return static_cast<TElementType*>(Sync()); return static_cast<TElementType*>(Sync());
return Previous(); return Previous();
} }
...@@ -305,14 +305,14 @@ public: ...@@ -305,14 +305,14 @@ public:
{ {
if(!IsChanged()) if(!IsChanged())
m_pPosition = GetRightOfPos(); m_pPosition = GetRightOfPos();
while(m_pPosition && dynamic_cast<const TElementType *>(static_cast<SwClient*>(m_pPosition)) == nullptr) while(m_pPosition && dynamic_cast<const TElementType *>(m_pPosition) == nullptr)
m_pPosition = GetRightOfPos(); m_pPosition = GetRightOfPos();
return static_cast<TElementType*>(Sync()); return static_cast<TElementType*>(Sync());
} }
TElementType* Previous() TElementType* Previous()
{ {
m_pPosition = GetLeftOfPos(); m_pPosition = GetLeftOfPos();
while(m_pPosition && dynamic_cast<const TElementType *>(static_cast<SwClient*>(m_pPosition)) == nullptr) while(m_pPosition && dynamic_cast<const TElementType *>(m_pPosition) == nullptr)
m_pPosition = GetLeftOfPos(); m_pPosition = GetLeftOfPos();
return static_cast<TElementType*>(Sync()); return static_cast<TElementType*>(Sync());
} }
......
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