[Libreoffice-commits] core.git: lotuswordpro/source

Stephan Bergmann sbergman at redhat.com
Tue Jul 8 01:23:50 PDT 2014


 lotuswordpro/source/filter/bencont.cxx |    4 ++--
 lotuswordpro/source/filter/benlist.cxx |    8 ++++----
 lotuswordpro/source/filter/benname.cxx |    2 +-
 lotuswordpro/source/filter/benobj.cxx  |    2 +-
 lotuswordpro/source/filter/bento.hxx   |   14 +++++++-------
 lotuswordpro/source/filter/first.hxx   |    4 ++--
 lotuswordpro/source/filter/tocread.cxx |    6 +++---
 7 files changed, 20 insertions(+), 20 deletions(-)

New commits:
commit 44fb7631cc03bbab655391593d248ba3875f308b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jul 8 10:22:20 2014 +0200

    Avoid undefined downcasts to wrong type
    
    ...CUtList::cDummyElmt is always only of type CUtListElmt, not a derived type.
    
    Change-Id: Ibc372642e2a53c548421b5cfa7cc496986036815

diff --git a/lotuswordpro/source/filter/bencont.cxx b/lotuswordpro/source/filter/bencont.cxx
index 1033f67..340b7cc 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 39943c4..2e3fcd1 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 24806ad..b8ecab7 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 f9efc90..500fe73 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 6775331..ec6abfe 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 08d35cd..68d20ce 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 b924d93..77dbdb1 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)


More information about the Libreoffice-commits mailing list