summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-07-08 10:22:20 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-07-08 10:23:03 +0200
commit44fb7631cc03bbab655391593d248ba3875f308b (patch)
tree17b8a81fe69ba5b0c6b5e84b76c40b9fc7469585
parent9da4e46957bd1a69c4339eeb1d107546c400e6e3 (diff)
Avoid undefined downcasts to wrong type
...CUtList::cDummyElmt is always only of type CUtListElmt, not a derived type. Change-Id: Ibc372642e2a53c548421b5cfa7cc496986036815
-rw-r--r--lotuswordpro/source/filter/bencont.cxx4
-rw-r--r--lotuswordpro/source/filter/benlist.cxx8
-rw-r--r--lotuswordpro/source/filter/benname.cxx2
-rw-r--r--lotuswordpro/source/filter/benobj.cxx2
-rw-r--r--lotuswordpro/source/filter/bento.hxx14
-rw-r--r--lotuswordpro/source/filter/first.hxx4
-rw-r--r--lotuswordpro/source/filter/tocread.cxx6
7 files changed, 20 insertions, 20 deletions
diff --git a/lotuswordpro/source/filter/bencont.cxx b/lotuswordpro/source/filter/bencont.cxx
index 1033f67e98fa..340b7cc49ddd 100644
--- a/lotuswordpro/source/filter/bencont.cxx
+++ b/lotuswordpro/source/filter/bencont.cxx
@@ -117,7 +117,7 @@ BenError
LtcBenContainer::RegisterPropertyName(const char * sPropertyName,
pCBenPropertyName * ppPropertyName)
{
- pCBenNamedObjectListElmt pPrevNamedObjectListElmt;
+ pCUtListElmt pPrevNamedObjectListElmt;
pCBenNamedObject pNamedObject = FindNamedObject(&cNamedObjects,
sPropertyName, &pPrevNamedObjectListElmt);
@@ -129,7 +129,7 @@ LtcBenContainer::RegisterPropertyName(const char * sPropertyName,
}
else
{
- pCBenIDListElmt pPrevObject;
+ pCUtListElmt pPrevObject;
if (FindID(&cObjects, cNextAvailObjectID, &pPrevObject) != NULL)
return BenErr_DuplicateObjectID;
diff --git a/lotuswordpro/source/filter/benlist.cxx b/lotuswordpro/source/filter/benlist.cxx
index 39943c470c86..2e3fcd1772b1 100644
--- a/lotuswordpro/source/filter/benlist.cxx
+++ b/lotuswordpro/source/filter/benlist.cxx
@@ -59,7 +59,7 @@ namespace OpenStormBento
pCBenNamedObject
FindNamedObject(pCUtList pList, const char * sName,
- pCBenNamedObjectListElmt * ppPrev)
+ pCUtListElmt * ppPrev)
{
CUtListElmt& rTerminating = pList->GetTerminating();
for (pCUtListElmt pCurr = pList->GetLast(); pCurr != &rTerminating;
@@ -84,13 +84,13 @@ FindNamedObject(pCUtList pList, const char * sName,
}
if (ppPrev != NULL)
- *ppPrev = (pCBenNamedObjectListElmt) &rTerminating;
+ *ppPrev = &rTerminating;
return NULL;
}
// Assume list is of BenIDListElmt list elements, sorted by ID
pCBenIDListElmt
-FindID(pCUtList pList, BenObjectID ObjectID, pCBenIDListElmt * ppPrev)
+FindID(pCUtList pList, BenObjectID ObjectID, pCUtListElmt * ppPrev)
{
CUtListElmt& rTerminating = pList->GetTerminating();
for (pCUtListElmt pCurr = pList->GetLast(); pCurr != &rTerminating;
@@ -111,7 +111,7 @@ FindID(pCUtList pList, BenObjectID ObjectID, pCBenIDListElmt * ppPrev)
}
if (ppPrev != NULL)
- *ppPrev = (pCBenIDListElmt) &rTerminating;
+ *ppPrev = &rTerminating;
return NULL;
}
} //end namespace OpenStormBento
diff --git a/lotuswordpro/source/filter/benname.cxx b/lotuswordpro/source/filter/benname.cxx
index 24806ad0817f..b8ecab7399a7 100644
--- a/lotuswordpro/source/filter/benname.cxx
+++ b/lotuswordpro/source/filter/benname.cxx
@@ -59,7 +59,7 @@ namespace OpenStormBento
// changed to remove warning
CBenNamedObject::CBenNamedObject(pLtcBenContainer pContainer,
BenObjectID ObjectID, pCBenObject pPrevObject, const char * sName,
- pCBenNamedObjectListElmt pPrevNamedObjectListElmt)
+ pCUtListElmt pPrevNamedObjectListElmt)
: CBenObject(pContainer, ObjectID, pPrevObject)
, csName(sName)
, cNameListElmt(pPrevNamedObjectListElmt)
diff --git a/lotuswordpro/source/filter/benobj.cxx b/lotuswordpro/source/filter/benobj.cxx
index f9efc9056358..500fe737de42 100644
--- a/lotuswordpro/source/filter/benobj.cxx
+++ b/lotuswordpro/source/filter/benobj.cxx
@@ -66,7 +66,7 @@ CBenObject::IsNamedObject()
pCBenProperty
CBenObject::UseProperty(BenObjectID PropertyID)
{
- pCBenIDListElmt pPrev;
+ pCUtListElmt pPrev;
return (pCBenProperty) FindID(&cProperties, PropertyID, &pPrev);
}
diff --git a/lotuswordpro/source/filter/bento.hxx b/lotuswordpro/source/filter/bento.hxx
index 677533105fb8..ec6abfea4e2a 100644
--- a/lotuswordpro/source/filter/bento.hxx
+++ b/lotuswordpro/source/filter/bento.hxx
@@ -144,7 +144,7 @@ sal_uLong BenOpenContainer(LwpSvStream * pStream, pLtcBenContainer * ppContainer
class CBenIDListElmt : public CUtListElmt
{
public: // Internal methods
- CBenIDListElmt(BenObjectID ID, pCBenIDListElmt pPrev) : CUtListElmt(pPrev)
+ CBenIDListElmt(BenObjectID ID, pCUtListElmt pPrev) : CUtListElmt(pPrev)
{ cID = ID; }
CBenIDListElmt(BenObjectID ID) { cID = ID; }
BenObjectID GetID() { return cID; }
@@ -157,7 +157,7 @@ class CBenNamedObjectListElmt : public CUtListElmt
{
public: // Methods
// added to remove warning
- CBenNamedObjectListElmt(pCBenNamedObjectListElmt pPrev) : CUtListElmt(pPrev)
+ CBenNamedObjectListElmt(pCUtListElmt pPrev) : CUtListElmt(pPrev)
{ cpNamedObject = NULL; }
void SetNamedObject(pCBenNamedObject pObj)
{
@@ -255,7 +255,7 @@ public:
BenObjectID GetObjectID() { return GetID(); }
public: // Internal methods
CBenObject(pLtcBenContainer pContainer, BenObjectID ObjectID,
- pCBenIDListElmt pPrev) : CBenIDListElmt(ObjectID, pPrev)
+ pCUtListElmt pPrev) : CBenIDListElmt(ObjectID, pPrev)
{ cpContainer = pContainer; }
CUtList& GetProperties() { return cProperties; }
@@ -320,7 +320,7 @@ public:
public: // Internal methods
// changed to remove WARNING here
CBenProperty(pCBenObject pObject, BenObjectID PropertyID,
- BenObjectID TypeID, pCBenIDListElmt pPrevProperty) :
+ BenObjectID TypeID, pCUtListElmt pPrevProperty) :
CBenIDListElmt(PropertyID, pPrevProperty), cValue(TypeID)
{
cpObject = pObject;
@@ -403,7 +403,7 @@ public: // Methods
public: // Internal methods
CBenNamedObject(pLtcBenContainer pContainer, BenObjectID ObjectID,
pCBenObject pPrevObject, const char * sName,
- pCBenNamedObjectListElmt pPrevNamedObjectListElmt);
+ pCUtListElmt pPrevNamedObjectListElmt);
const char * GetName() { return csName.data(); }
const char * GetNameCStr() { return csName.c_str(); }
@@ -424,7 +424,7 @@ class CBenPropertyName : public CBenNamedObject
public: // Internal methods
CBenPropertyName(pLtcBenContainer pContainer, BenObjectID ObjectID,
pCBenObject pPrevObject, const char * sName,
- pCBenNamedObjectListElmt pPrevNamedObjectListElmt) :
+ pCUtListElmt pPrevNamedObjectListElmt) :
CBenNamedObject(pContainer, ObjectID, pPrevObject, sName,
pPrevNamedObjectListElmt) { ; }
virtual bool IsPropertyName() SAL_OVERRIDE;
@@ -435,7 +435,7 @@ class CBenTypeName : public CBenNamedObject
public: // Internal methods
CBenTypeName(pLtcBenContainer pContainer, BenObjectID ObjectID,
pCBenObject pPrevObject, const char * sName,
- pCBenNamedObjectListElmt pPrevNamedObjectListElmt) :
+ pCUtListElmt pPrevNamedObjectListElmt) :
CBenNamedObject(pContainer, ObjectID, pPrevObject, sName,
pPrevNamedObjectListElmt) { ; }
virtual bool IsTypeName() SAL_OVERRIDE;
diff --git a/lotuswordpro/source/filter/first.hxx b/lotuswordpro/source/filter/first.hxx
index 08d35cd65ac3..68d20ce2d0a9 100644
--- a/lotuswordpro/source/filter/first.hxx
+++ b/lotuswordpro/source/filter/first.hxx
@@ -68,10 +68,10 @@ typedef BenByte * BenByteDataPtr;
typedef const BenByte * BenConstByteDataPtr;
pCBenNamedObject FindNamedObject(pCUtList pList, const char * sName,
- pCBenNamedObjectListElmt * ppPrev);
+ pCUtListElmt * ppPrev);
pCBenIDListElmt FindID(pCUtList pList, BenObjectID ObjectID,
- pCBenIDListElmt * ppPrev);
+ pCUtListElmt * ppPrev);
} // end namespace
// Private headers
diff --git a/lotuswordpro/source/filter/tocread.cxx b/lotuswordpro/source/filter/tocread.cxx
index b924d93c96d5..77dbdb166bc0 100644
--- a/lotuswordpro/source/filter/tocread.cxx
+++ b/lotuswordpro/source/filter/tocread.cxx
@@ -287,7 +287,7 @@ CBenTOCReader::ReadTOC()
return Err;
}
- pCBenNamedObjectListElmt pPrevNamedObjectListElmt;
+ pCUtListElmt pPrevNamedObjectListElmt;
if (FindNamedObject(&cpContainer->GetNamedObjects(),
sBuffer, &pPrevNamedObjectListElmt) != NULL)
{
@@ -342,10 +342,10 @@ CBenTOCReader::ReadTOC()
if (pObject == NULL)
pObject = new CBenObject(cpContainer, ObjectID,
- (pCBenObject) cpContainer->GetObjects().GetLast());
+ cpContainer->GetObjects().GetLast());
pProperty = new CBenProperty(pObject, PropertyID, TypeID,
- (pCBenProperty) pObject->GetProperties().GetLast());
+ pObject->GetProperties().GetLast());
if ((Err = ReadSegments(&pProperty->UseValue(),
&LookAhead)) != BenErr_OK)