Use public derivation, and remove then-unnecessary downcasts

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

Change-Id: I30ec84b6a30c029cfbeb848ad37c9a532fec0a96
This commit is contained in:
Stephan Bergmann
2016-01-08 16:39:24 +01:00
parent 5e2a0f007b
commit 63b67ab5ca

View File

@@ -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:
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:
{ {
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());
} }