Kaydet (Commit) 9e37ccf4 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Get rid of some unnecessary macros

Change-Id: I872dd72429eae8d183ea1ca8d76fb30b0e8be715
Reviewed-on: https://gerrit.libreoffice.org/35321Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst d920613f
......@@ -70,7 +70,7 @@ const char gsBenMagicBytes[] = BEN_MAGIC_BYTES;
* @param pointer to pointer of Bento Container object
* @return error code
*/
sal_uLong BenOpenContainer(LwpSvStream * pStream, pLtcBenContainer * ppContainer)
sal_uLong BenOpenContainer(LwpSvStream * pStream, LtcBenContainer ** ppContainer)
{
BenError Err;
......@@ -81,7 +81,7 @@ sal_uLong BenOpenContainer(LwpSvStream * pStream, pLtcBenContainer * ppContainer
return BenErr_ContainerWithNoObjects;
}
pLtcBenContainer pContainer = new LtcBenContainer(pStream);
LtcBenContainer * pContainer = new LtcBenContainer(pStream);
if ((Err = pContainer->Open()) != BenErr_OK) // delete two inputs
{
delete pContainer;
......@@ -110,21 +110,21 @@ LtcBenContainer::Open() // delete two inputs
void
LtcBenContainer::RegisterPropertyName(const char * sPropertyName,
pCBenPropertyName * ppPropertyName)
CBenPropertyName ** ppPropertyName)
{
pCUtListElmt pPrevNamedObjectListElmt;
pCBenNamedObject pNamedObject = FindNamedObject(&cNamedObjects,
CUtListElmt * pPrevNamedObjectListElmt;
CBenNamedObject * pNamedObject = FindNamedObject(&cNamedObjects,
sPropertyName, &pPrevNamedObjectListElmt);
if (pNamedObject != nullptr)
{
if (! pNamedObject->IsPropertyName())
return;
else *ppPropertyName = static_cast<pCBenPropertyName>(pNamedObject);
else *ppPropertyName = static_cast<CBenPropertyName *>(pNamedObject);
}
else
{
pCUtListElmt pPrevObject;
CUtListElmt * pPrevObject;
if (FindID(&cObjects, cNextAvailObjectID, &pPrevObject) != nullptr)
return;
......@@ -134,14 +134,14 @@ LtcBenContainer::RegisterPropertyName(const char * sPropertyName,
}
}
pCBenObject
LtcBenContainer::GetNextObject(pCBenObject pCurrObject)
CBenObject *
LtcBenContainer::GetNextObject(CBenObject * pCurrObject)
{
return static_cast<pCBenObject>(cObjects.GetNextOrNULL(pCurrObject));
return static_cast<CBenObject *>(cObjects.GetNextOrNULL(pCurrObject));
}
pCBenObject
LtcBenContainer::FindNextObjectWithProperty(pCBenObject pCurrObject,
CBenObject *
LtcBenContainer::FindNextObjectWithProperty(CBenObject * pCurrObject,
BenObjectID PropertyID)
{
while ((pCurrObject = GetNextObject(pCurrObject)) != nullptr)
......
......@@ -57,16 +57,16 @@
namespace OpenStormBento
{
pCBenNamedObject
FindNamedObject(pCUtList pList, const char * sName,
pCUtListElmt * ppPrev)
CBenNamedObject *
FindNamedObject(CUtList * pList, const char * sName,
CUtListElmt ** ppPrev)
{
CUtListElmt& rTerminating = pList->GetTerminating();
for (pCUtListElmt pCurr = pList->GetLast(); pCurr != &rTerminating;
for (CUtListElmt * pCurr = pList->GetLast(); pCurr != &rTerminating;
pCurr = pCurr->GetPrev())
{
pCBenNamedObjectListElmt pCurrNamedObjectListElmt =
static_cast<pCBenNamedObjectListElmt>(pCurr);
CBenNamedObjectListElmt * pCurrNamedObjectListElmt =
static_cast<CBenNamedObjectListElmt *>(pCurr);
int Comp = strcmp(sName, pCurrNamedObjectListElmt->GetNamedObject()->
GetNameCStr());
......@@ -89,14 +89,14 @@ FindNamedObject(pCUtList pList, const char * sName,
}
// Assume list is of BenIDListElmt list elements, sorted by ID
pCBenIDListElmt
FindID(pCUtList pList, BenObjectID ObjectID, pCUtListElmt * ppPrev)
CBenIDListElmt *
FindID(CUtList * pList, BenObjectID ObjectID, CUtListElmt ** ppPrev)
{
CUtListElmt& rTerminating = pList->GetTerminating();
for (pCUtListElmt pCurr = pList->GetLast(); pCurr != &rTerminating;
for (CUtListElmt * pCurr = pList->GetLast(); pCurr != &rTerminating;
pCurr = pCurr->GetPrev())
{
pCBenIDListElmt pCurrIDListElmt = static_cast<pCBenIDListElmt>(pCurr);
CBenIDListElmt * pCurrIDListElmt = static_cast<CBenIDListElmt *>(pCurr);
if (ObjectID == pCurrIDListElmt->GetID())
return pCurrIDListElmt;
......
......@@ -58,9 +58,9 @@
namespace OpenStormBento
{
// changed to remove warning
CBenNamedObject::CBenNamedObject(pLtcBenContainer pContainer,
BenObjectID ObjectID, pCUtListElmt pPrevObject, const char * sName,
pCUtListElmt pPrevNamedObjectListElmt)
CBenNamedObject::CBenNamedObject(LtcBenContainer * pContainer,
BenObjectID ObjectID, CUtListElmt * pPrevObject, const char * sName,
CUtListElmt * pPrevNamedObjectListElmt)
: CBenObject(pContainer, ObjectID, pPrevObject)
, csName(sName)
, cNameListElmt(pPrevNamedObjectListElmt)
......
......@@ -59,17 +59,17 @@
namespace OpenStormBento
{
pCBenProperty
CBenProperty *
CBenObject::UseProperty(BenObjectID PropertyID)
{
pCUtListElmt pPrev;
return static_cast<pCBenProperty>( FindID(&cProperties, PropertyID, &pPrev) );
CUtListElmt * pPrev;
return static_cast<CBenProperty *>( FindID(&cProperties, PropertyID, &pPrev) );
}
pCBenValue
CBenValue *
CBenObject::UseValue(BenObjectID PropertyID)
{
pCBenProperty pProperty = UseProperty(PropertyID);
CBenProperty * pProperty = UseProperty(PropertyID);
if (pProperty == nullptr)
return nullptr;
return &pProperty->UseValue();
......
......@@ -56,6 +56,9 @@
#ifndef INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_BENTO_HXX
#define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_BENTO_HXX
#include <sal/config.h>
#include <cstring>
#include <string>
#include <vector>
#include "lwpsvstream.hxx"
......@@ -117,17 +120,13 @@ enum BenError
// those should start at 200
};
UtDefClassP(LtcBenContainer);
UtDefClassP(CBenIDListElmt);
UtDefClassP(CBenObject);
UtDefClassP(CBenProperty);
UtDefClassP(CBenReference);
UtDefClassP(CBenValue);
UtDefClassP(CBenValueSegment);
UtDefClassP(CBenNamedObjectListElmt);
UtDefClassP(CBenNamedObject);
UtDefClassP(CBenPropertyName);
UtDefClassP(CBenTypeName);
class LtcBenContainer;
class CBenObject;
class CBenProperty;
class CBenValue;
class CBenValueSegment;
class CBenNamedObject;
class CBenPropertyName;
typedef unsigned char BenByte;
typedef unsigned short BenWord;
......@@ -137,12 +136,12 @@ typedef unsigned long BenContainerPos;
typedef unsigned long BenObjectID;
typedef unsigned long BenGeneration;
sal_uLong BenOpenContainer(LwpSvStream * pStream, pLtcBenContainer * ppContainer);
sal_uLong BenOpenContainer(LwpSvStream * pStream, LtcBenContainer ** ppContainer);
class CBenIDListElmt : public CUtListElmt
{
public: // Internal methods
CBenIDListElmt(BenObjectID ID, pCUtListElmt pPrev) : CUtListElmt(pPrev)
CBenIDListElmt(BenObjectID ID, CUtListElmt * pPrev) : CUtListElmt(pPrev)
{ cID = ID; }
explicit CBenIDListElmt(BenObjectID ID) { cID = ID; }
BenObjectID GetID() { return cID; }
......@@ -155,23 +154,23 @@ class CBenNamedObjectListElmt : public CUtListElmt
{
public: // Methods
// added to remove warning
explicit CBenNamedObjectListElmt(pCUtListElmt pPrev) : CUtListElmt(pPrev)
explicit CBenNamedObjectListElmt(CUtListElmt * pPrev) : CUtListElmt(pPrev)
{ cpNamedObject = nullptr; }
void SetNamedObject(pCBenNamedObject pObj)
void SetNamedObject(CBenNamedObject * pObj)
{
cpNamedObject = pObj;
}
pCBenNamedObject GetNamedObject() { return cpNamedObject; }
CBenNamedObject * GetNamedObject() { return cpNamedObject; }
private: // Data
pCBenNamedObject cpNamedObject;
CBenNamedObject * cpNamedObject;
};
class LtcUtBenValueStream : public SvStream
{
public:
explicit LtcUtBenValueStream(pCBenValue pValue);
explicit LtcUtBenValueStream(CBenValue * pValue);
virtual ~LtcUtBenValueStream() override;
public: // Overridden methods
......@@ -187,7 +186,7 @@ protected: // Overridden methods
virtual void FlushData() override;
private: // Data
pCBenValue cpValue;
CBenValue * cpValue;
unsigned long cCurrentPosition;
sal_uLong m_ulValueLength; // Added by , sum of length of all sub-valuesegments
......@@ -199,11 +198,11 @@ class LtcBenContainer
public:
BenError Open();
void RegisterPropertyName(const char * sPropertyName,
pCBenPropertyName * ppPropertyName);
CBenPropertyName ** ppPropertyName);
// Pass NULL to begin iteration. Done when returns NULL.
// Objects are returned in order of increasing ID
pCBenObject GetNextObject(pCBenObject pCurrObject);
pCBenObject FindNextObjectWithProperty(pCBenObject pCurrObject,
CBenObject * GetNextObject(CBenObject * pCurrObject);
CBenObject * FindNextObjectWithProperty(CBenObject * pCurrObject,
BenObjectID PropertyID);
public: // Internal methods
......@@ -236,17 +235,17 @@ private: // Data
class CBenObject : public CBenIDListElmt
{
public:
pCBenProperty UseProperty(BenObjectID PropertyID);
pCBenValue UseValue(BenObjectID PropertyID);
pLtcBenContainer GetContainer() { return cpContainer; }
CBenProperty * UseProperty(BenObjectID PropertyID);
CBenValue * UseValue(BenObjectID PropertyID);
LtcBenContainer * GetContainer() { return cpContainer; }
public: // Internal methods
CBenObject(pLtcBenContainer pContainer, BenObjectID ObjectID,
pCUtListElmt pPrev) : CBenIDListElmt(ObjectID, pPrev)
CBenObject(LtcBenContainer * pContainer, BenObjectID ObjectID,
CUtListElmt * pPrev) : CBenIDListElmt(ObjectID, pPrev)
{ cpContainer = pContainer; }
CUtList& GetProperties() { return cProperties; }
private: // Data
pLtcBenContainer cpContainer;
LtcBenContainer * cpContainer;
CUtOwningList cProperties;
};
......@@ -257,7 +256,7 @@ public:
void ReadValueData(void * pBuffer,
unsigned long Offset, unsigned long MaxSize, unsigned long * pAmtRead);
pCBenProperty BEN_EXPORT GetProperty() { return cpProperty; }
CBenProperty * BEN_EXPORT GetProperty() { return cpProperty; }
public: // Internal methods
// added to remove WARNING
......@@ -266,17 +265,17 @@ public: // Internal methods
cpProperty = nullptr;
}
void SetProperty(pCBenProperty pProperty)
void SetProperty(CBenProperty * pProperty)
{
cpProperty = pProperty;
}
inline pCBenValueSegment GetNextValueSegment(pCBenValueSegment
inline CBenValueSegment * GetNextValueSegment(CBenValueSegment *
pCurrValueSegment);
CUtList& GetValueSegments() { return cValueSegments; }
private: // Data
pCBenProperty cpProperty;
CBenProperty * cpProperty;
CUtOwningList cValueSegments;
};
......@@ -288,41 +287,41 @@ public:
// property has exactly one value
CBenValue& UseValue() { return cValue; }
pCBenObject GetBenObject() { return cpObject; }
pLtcBenContainer GetContainer() { return GetBenObject()->GetContainer(); }
CBenObject * GetBenObject() { return cpObject; }
LtcBenContainer * GetContainer() { return GetBenObject()->GetContainer(); }
public: // Internal methods
// changed to remove WARNING here
CBenProperty(pCBenObject pObject, BenObjectID PropertyID,
BenObjectID TypeID, pCUtListElmt pPrevProperty) :
CBenProperty(CBenObject * pObject, BenObjectID PropertyID,
BenObjectID TypeID, CUtListElmt * pPrevProperty) :
CBenIDListElmt(PropertyID, pPrevProperty), cValue(TypeID)
{
cpObject = pObject;
cValue.SetProperty(this);
}
private: // Data
pCBenObject cpObject;
CBenObject * cpObject;
CBenValue cValue;
};
class CBenValueSegment : public CUtListElmt
{
public: // Internal methods
CBenValueSegment(pCBenValue pValue, BenContainerPos Pos,
CBenValueSegment(CBenValue * pValue, BenContainerPos Pos,
unsigned long Size) : CUtListElmt(&pValue->GetValueSegments())
{ cpValue = pValue; cImmediate = false; cPos = Pos;
cSize = Size; }
CBenValueSegment(pCBenValue pValue, const void * pImmData,
CBenValueSegment(CBenValue * pValue, const void * pImmData,
unsigned short Size) : CUtListElmt(&pValue->GetValueSegments())
{ cpValue = pValue; cImmediate = true;
UtHugeMemcpy(cImmData, pImmData, Size); cSize = Size; }
std::memcpy(cImmData, pImmData, Size); cSize = Size; }
bool IsImmediate() { return cImmediate; }
BenContainerPos GetPosition() { return cPos; }
unsigned long GetSize() { return cSize; }
BenByte * GetImmediateData() { return cImmData; }
private: // Data
pCBenValue cpValue;
CBenValue * cpValue;
bool cImmediate;
union
{
......@@ -332,9 +331,9 @@ private: // Data
unsigned long cSize;
};
inline pCBenValueSegment CBenValue::GetNextValueSegment(pCBenValueSegment
inline CBenValueSegment * CBenValue::GetNextValueSegment(CBenValueSegment *
pCurrValueSegment)
{ return static_cast<pCBenValueSegment>( cValueSegments.GetNextOrNULL(pCurrValueSegment) ); }
{ return static_cast<CBenValueSegment *>( cValueSegments.GetNextOrNULL(pCurrValueSegment) ); }
class CBenNamedObject : public CBenObject
......@@ -343,9 +342,9 @@ public: // Methods
virtual bool IsPropertyName();
public: // Internal methods
CBenNamedObject(pLtcBenContainer pContainer, BenObjectID ObjectID,
pCUtListElmt pPrevObject, const char * sName,
pCUtListElmt pPrevNamedObjectListElmt);
CBenNamedObject(LtcBenContainer * pContainer, BenObjectID ObjectID,
CUtListElmt * pPrevObject, const char * sName,
CUtListElmt * pPrevNamedObjectListElmt);
const char * GetNameCStr() { return csName.c_str(); }
......@@ -357,9 +356,9 @@ private: // Data
class CBenPropertyName : public CBenNamedObject
{
public: // Internal methods
CBenPropertyName(pLtcBenContainer pContainer, BenObjectID ObjectID,
pCUtListElmt pPrevObject, const char * sName,
pCUtListElmt pPrevNamedObjectListElmt) :
CBenPropertyName(LtcBenContainer * pContainer, BenObjectID ObjectID,
CUtListElmt * pPrevObject, const char * sName,
CUtListElmt * pPrevNamedObjectListElmt) :
CBenNamedObject(pContainer, ObjectID, pPrevObject, sName,
pPrevNamedObjectListElmt) { ; }
virtual bool IsPropertyName() override;
......@@ -368,9 +367,9 @@ public: // Internal methods
class CBenTypeName : public CBenNamedObject
{
public: // Internal methods
CBenTypeName(pLtcBenContainer pContainer, BenObjectID ObjectID,
pCBenObject pPrevObject, const char * sName,
pCUtListElmt pPrevNamedObjectListElmt) :
CBenTypeName(LtcBenContainer * pContainer, BenObjectID ObjectID,
CBenObject * pPrevObject, const char * sName,
CUtListElmt * pPrevNamedObjectListElmt) :
CBenNamedObject(pContainer, ObjectID, pPrevObject, sName,
pPrevNamedObjectListElmt) { ; }
};
......
......@@ -53,6 +53,12 @@
*
*
************************************************************************/
#include <sal/config.h>
#include <algorithm>
#include <cstring>
#include "first.hxx"
#include "assert.h"
namespace OpenStormBento
......@@ -62,7 +68,7 @@ unsigned long
CBenValue::GetValueSize()
{
unsigned long Size = 0;
pCBenValueSegment pCurr = nullptr;
CBenValueSegment * pCurr = nullptr;
while ((pCurr = GetNextValueSegment(pCurr)) != nullptr)
Size += pCurr->GetSize();
return Size;
......@@ -75,8 +81,8 @@ CBenValue::ReadValueData(void * pReadBuffer, unsigned long Offset,
BenError Err;
unsigned long SegOffset = 0;
*pAmtRead = 0;
pCBenValueSegment pCurrSeg = nullptr;
pLtcBenContainer pContainer = GetProperty()->GetContainer();
CBenValueSegment * pCurrSeg = nullptr;
LtcBenContainer * pContainer = GetProperty()->GetContainer();
BenByte* pBuffer = static_cast<BenByte*>(pReadBuffer);
/// pReadBuffer -- pointer to buffer of read result, allocated outside this function
......@@ -95,14 +101,14 @@ CBenValue::ReadValueData(void * pReadBuffer, unsigned long Offset,
{
unsigned long OffsetIntoSeg = Offset - SegOffset; /// relative value in this value segment stream
unsigned long AmtThisSeg = UtMin(Amt, pCurrSeg->GetSize() -
unsigned long AmtThisSeg = std::min(Amt, pCurrSeg->GetSize() -
OffsetIntoSeg); /// size read in this segment, it's minimal value between Amt &
/// remain part from OffsetIntoSeg to the end of this segment
unsigned long AmtReadThisSeg; /// actual read size in this segment
if (pCurrSeg->IsImmediate())
{
UtHugeMemcpy(pBuffer, pCurrSeg->GetImmediateData() +
std::memcpy(pBuffer, pCurrSeg->GetImmediateData() +
OffsetIntoSeg, AmtThisSeg);
AmtReadThisSeg = AmtThisSeg;
}
......
......@@ -64,11 +64,11 @@ namespace OpenStormBento
// String constants
extern const char gsBenMagicBytes[];
pCBenNamedObject FindNamedObject(pCUtList pList, const char * sName,
pCUtListElmt * ppPrev);
CBenNamedObject * FindNamedObject(CUtList * pList, const char * sName,
CUtListElmt ** ppPrev);
pCBenIDListElmt FindID(pCUtList pList, BenObjectID ObjectID,
pCUtListElmt * ppPrev);
CBenIDListElmt * FindID(CUtList * pList, BenObjectID ObjectID,
CUtListElmt ** ppPrev);
} // end namespace
// Private headers
......
......@@ -53,6 +53,11 @@
*
*
************************************************************************/
#include <sal/config.h>
#include <cstring>
#include "first.hxx"
#include "assert.h"
namespace OpenStormBento
......@@ -210,7 +215,7 @@ CBenTOCReader::ReadTOC()
BenObjectID ObjectID;
if ((Err = GetDWord(&ObjectID)) != BenErr_OK)
return Err;
pCBenObject pObject = nullptr;
CBenObject * pObject = nullptr;
// Read in all properties for object
do
......@@ -219,7 +224,7 @@ CBenTOCReader::ReadTOC()
if ((Err = GetDWord(&PropertyID)) != BenErr_OK)
return Err;
pCBenProperty pProperty = nullptr;
CBenProperty * pProperty = nullptr;
// Read in all values for property
do
......@@ -288,7 +293,7 @@ CBenTOCReader::ReadTOC()
return Err;
}
pCUtListElmt pPrevNamedObjectListElmt;
CUtListElmt * pPrevNamedObjectListElmt;
if (FindNamedObject(&cpContainer->GetNamedObjects(),
sBuffer, &pPrevNamedObjectListElmt) != nullptr)
{
......@@ -296,7 +301,7 @@ CBenTOCReader::ReadTOC()
return BenErr_DuplicateName;
}
pCBenObject pPrevObject = static_cast<pCBenObject>( cpContainer->
CBenObject * pPrevObject = static_cast<CBenObject *>( cpContainer->
GetObjects().GetLast());
if (PropertyID == BEN_PROPID_GLOBAL_PROPERTY_NAME)
......@@ -362,7 +367,7 @@ CBenTOCReader::ReadTOC()
}
BenError
CBenTOCReader::ReadSegments(pCBenValue pValue, BenByte * pLookAhead)
CBenTOCReader::ReadSegments(CBenValue * pValue, BenByte * pLookAhead)
{
BenError Err;
......@@ -378,7 +383,7 @@ CBenTOCReader::ReadSegments(pCBenValue pValue, BenByte * pLookAhead)
}
BenError
CBenTOCReader::ReadSegment(pCBenValue pValue, BenByte * pLookAhead)
CBenTOCReader::ReadSegment(CBenValue * pValue, BenByte * pLookAhead)
{
BenError Err;
......@@ -502,7 +507,7 @@ CBenTOCReader::GetData(void * pBuffer, unsigned long Amt)
if (! CanGetData(Amt))
return BenErr_ReadPastEndOfTOC;
UtHugeMemcpy(pBuffer, cpTOC.get() + cCurr, Amt);
std::memcpy(pBuffer, cpTOC.get() + cCurr, Amt);
cCurr += Amt;
return BenErr_OK;
}
......
......@@ -61,7 +61,7 @@ namespace OpenStormBento
class CBenTOCReader
{
public: // Methods
explicit CBenTOCReader(pLtcBenContainer pContainer)
explicit CBenTOCReader(LtcBenContainer * pContainer)
: cpContainer(pContainer)
, cBlockSize(0)
, cCurr(0)
......@@ -73,8 +73,8 @@ private: // Methods
BenError ReadLabel(unsigned long * pTOCOffset, unsigned long * pTOCSize);
BenError SearchForLabel(BenByte * pLabel);
BenError ReadTOC();
BenError ReadSegments(pCBenValue pValue, BenByte * pLookAhead);
BenError ReadSegment(pCBenValue pValue, BenByte * pLookAhead);
BenError ReadSegments(CBenValue * pValue, BenByte * pLookAhead);
BenError ReadSegment(CBenValue * pValue, BenByte * pLookAhead);
bool CanGetData(unsigned long Amt);
BenError GetByte(BenByte * pByte);
BenError GetDWord(BenDWord * pDWord);
......@@ -82,7 +82,7 @@ private: // Methods
BenError GetData(void * pBuffer, unsigned long Amt);
private: // Data
pLtcBenContainer cpContainer;
LtcBenContainer * cpContainer;
std::unique_ptr<BenByte[]> cpTOC;
unsigned long cBlockSize;
unsigned long cCurr;
......
......@@ -60,28 +60,13 @@
namespace OpenStormBento
{
#define UtMin(x,y) ((x) < (y) ? (x) : (y))
#define UtMax(x,y) ((x) > (y) ? (x) : (y))
#define UtHugeMemcpy memcpy
#define UtErr_OK 0
#define UtErr_Fail 1
#define UtByte sal_uInt8
#define UtDWord sal_uInt32
#define UtWord sal_uInt16
#define UtDefClassP(Name) class Name; typedef Name * p##Name; \
typedef const Name * pConst##Name
inline UtWord UtGetIntelWord(UtByte * pData)
inline sal_uInt16 UtGetIntelWord(sal_uInt8 * pData)
{ return pData[0] | pData[1] << 8; }
inline UtDWord UtGetIntelDWord(UtByte * pData)
inline sal_uInt32 UtGetIntelDWord(sal_uInt8 * pData)
{ return pData[0] | pData[1] << 8 | pData[2] << 16 | pData[3] << 24; }
inline UtByte UtGetIntelByte(UtByte * pData)
inline sal_uInt8 UtGetIntelByte(sal_uInt8 * pData)
{ return * pData; }
}
......
......@@ -129,7 +129,7 @@ void LtcUtBenValueStream::FlushData()
/**
* Construction
*/
LtcUtBenValueStream::LtcUtBenValueStream(pCBenValue pValue)
LtcUtBenValueStream::LtcUtBenValueStream(CBenValue * pValue)
{
// Calculate the length of the whole value stream
cCurrentPosition = 0;
......
......@@ -58,7 +58,7 @@
namespace OpenStormBento
{
CUtListElmt::CUtListElmt(pCUtList pList)
CUtListElmt::CUtListElmt(CUtList * pList)
: cpNext(nullptr)
, cpPrev(nullptr)
{
......@@ -78,9 +78,9 @@ CUtListElmt::~CUtListElmt()
CUtList::~CUtList()
{
CUtListElmt& rTerminating = GetTerminating();
for (pCUtListElmt pCurr = GetFirst(); pCurr != &rTerminating; )
for (CUtListElmt * pCurr = GetFirst(); pCurr != &rTerminating; )
{
pCUtListElmt pNext = pCurr->GetNext();
CUtListElmt * pNext = pCurr->GetNext();
pCurr->MakeNotOnList();
pCurr = pNext;
}
......@@ -91,10 +91,10 @@ CUtList::~CUtList()
// If pCurr is NULL, returns first item in list. Otherwise, returns item
// in list after pCurr or NULL if no more items in list. Terminating item
// is never returned
pCUtListElmt
CUtList::GetNextOrNULL(pCUtListElmt pCurr)
CUtListElmt *
CUtList::GetNextOrNULL(CUtListElmt * pCurr)
{
pCUtListElmt pNext;
CUtListElmt * pNext;
if (pCurr == nullptr)
pNext = GetFirst();
......@@ -108,9 +108,9 @@ void
CUtList::Destroy()
{
CUtListElmt& rTerminating = GetTerminating();
for (pCUtListElmt pCurr = GetFirst(); pCurr != &rTerminating; )
for (CUtListElmt * pCurr = GetFirst(); pCurr != &rTerminating; )
{
pCUtListElmt pNext = pCurr->GetNext();
CUtListElmt * pNext = pCurr->GetNext();
delete pCurr;
pCurr = pNext;
}
......
......@@ -61,9 +61,7 @@
namespace OpenStormBento
{
UtDefClassP(CUtListElmt);
UtDefClassP(CUtList);
UtDefClassP(CUtComparableListElmt);
class CUtList;
class CUtListElmt
{
......@@ -72,16 +70,16 @@ public: // Methods
: cpNext(nullptr)
, cpPrev(nullptr)
{}
explicit CUtListElmt(pCUtListElmt pPrev) { InsertAfter(pPrev); }
explicit CUtListElmt(pCUtList pList);
explicit CUtListElmt(CUtListElmt * pPrev) { InsertAfter(pPrev); }
explicit CUtListElmt(CUtList * pList);
virtual ~CUtListElmt();
void MakeNotOnList() { cpNext = nullptr; } // Same as Remove but doesn't
// patch up list
pCUtListElmt GetNext() const { return cpNext; }
void SetNext(pCUtListElmt pNext) { cpNext = pNext; }
pCUtListElmt GetPrev() const { return cpPrev; }
void SetPrev(pCUtListElmt pPrev) { cpPrev = pPrev; }
void InsertAfter(pCUtListElmt pPrev)
CUtListElmt * GetNext() const { return cpNext; }
void SetNext(CUtListElmt * pNext) { cpNext = pNext; }
CUtListElmt * GetPrev() const { return cpPrev; }
void SetPrev(CUtListElmt * pPrev) { cpPrev = pPrev; }
void InsertAfter(CUtListElmt * pPrev)
{
cpNext = pPrev->cpNext;
cpPrev = pPrev;
......@@ -90,8 +88,8 @@ public: // Methods
}
private: // Data
pCUtListElmt cpNext;
pCUtListElmt cpPrev;
CUtListElmt * cpNext;
CUtListElmt * cpPrev;
};
class CUtList
......@@ -100,10 +98,10 @@ public: // Methods
CUtList() { cDummyElmt.SetNext(&cDummyElmt);
cDummyElmt.SetPrev(&cDummyElmt); }
virtual ~CUtList();
pCUtListElmt GetFirst() { return cDummyElmt.GetNext(); }
pCUtListElmt GetLast() { return cDummyElmt.GetPrev(); }
CUtListElmt * GetFirst() { return cDummyElmt.GetNext(); }
CUtListElmt * GetLast() { return cDummyElmt.GetPrev(); }
CUtListElmt& GetTerminating() { return cDummyElmt; }
pCUtListElmt GetNextOrNULL(pCUtListElmt pCurr);
CUtListElmt * GetNextOrNULL(CUtListElmt * pCurr);
void Destroy();
......
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