summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-08-11 13:53:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-08-13 08:34:28 +0200
commiteb841c06f879df11142c659b372e365c361a231b (patch)
treeb1e67bd2895569325d11392a3d67769e3061068c /lotuswordpro
parentff4d6a7e5b166bb98bbe8d0f59cc4db36e7002aa (diff)
loplugin:returnconstant in linguistic,lotuswordpro
Change-Id: If5c7d936020e5470b09c2fe54d41fb006c296a34 Reviewed-on: https://gerrit.libreoffice.org/58877 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/bencont.cxx13
-rw-r--r--lotuswordpro/source/filter/bento.hxx6
-rw-r--r--lotuswordpro/source/filter/benval.cxx11
-rw-r--r--lotuswordpro/source/filter/tocread.cxx18
4 files changed, 15 insertions, 33 deletions
diff --git a/lotuswordpro/source/filter/bencont.cxx b/lotuswordpro/source/filter/bencont.cxx
index a39650c6de01..19c7a446eaba 100644
--- a/lotuswordpro/source/filter/bencont.cxx
+++ b/lotuswordpro/source/filter/bencont.cxx
@@ -168,13 +168,11 @@ LtcBenContainer::LtcBenContainer(LwpSvStream * pStream)
* @param buffer pointer
* @param buffer size
* @param number of bytes read
-* @return BenError
*/
-BenError LtcBenContainer::Read(void * pBuffer, size_t MaxSize,
+void LtcBenContainer::Read(void * pBuffer, size_t MaxSize,
size_t* pAmtRead)
{
*pAmtRead = cpStream->Read(pBuffer, MaxSize);
- return BenErr_OK;
}
/**
* Read buffer from bento file with specified size
@@ -194,24 +192,19 @@ BenError LtcBenContainer::ReadKnownSize(void * pBuffer, size_t Amt)
/**
* Seek to position from the beginning of the bento file
* @param position in container file from beginning
-* @return BenError
*/
-BenError LtcBenContainer::SeekToPosition(BenContainerPos Pos)
+void LtcBenContainer::SeekToPosition(BenContainerPos Pos)
{
cpStream->Seek(Pos);
- return BenErr_OK;
}
/**
* Seek to position compare to end of bento file
* @param position in container file from end
-* @return BenError
*/
-BenError LtcBenContainer::SeekFromEnd(long Offset)
+void LtcBenContainer::SeekFromEnd(long Offset)
{
cpStream->Seek(STREAM_SEEK_TO_END);
cpStream->SeekRel(Offset);
-
- return BenErr_OK;
}
/**
* Find the next value stream with property name
diff --git a/lotuswordpro/source/filter/bento.hxx b/lotuswordpro/source/filter/bento.hxx
index dd1692af1ce7..4b294183a8eb 100644
--- a/lotuswordpro/source/filter/bento.hxx
+++ b/lotuswordpro/source/filter/bento.hxx
@@ -209,11 +209,11 @@ public: // Internal methods
~LtcBenContainer();
sal_uLong remainingSize() const;
- BenError Read(void * pBuffer, size_t MaxSize,
+ void Read(void * pBuffer, size_t MaxSize,
size_t* pAmtRead);
BenError ReadKnownSize(void * pBuffer, size_t Amt);
- BenError SeekToPosition(BenContainerPos Pos);
- BenError SeekFromEnd(long Offset);
+ void SeekToPosition(BenContainerPos Pos);
+ void SeekFromEnd(long Offset);
void SetNextAvailObjectID(BenObjectID ID) { cNextAvailObjectID = ID; }
CUtList& GetObjects() { return cObjects; }
diff --git a/lotuswordpro/source/filter/benval.cxx b/lotuswordpro/source/filter/benval.cxx
index 9cd7404f996d..2d93626ececd 100644
--- a/lotuswordpro/source/filter/benval.cxx
+++ b/lotuswordpro/source/filter/benval.cxx
@@ -78,7 +78,6 @@ void
CBenValue::ReadValueData(void * pReadBuffer, size_t Offset,
size_t Amt, size_t* pAmtRead)
{
- BenError Err;
size_t SegOffset = 0;
*pAmtRead = 0;
CBenValueSegment * pCurrSeg = nullptr;
@@ -114,13 +113,9 @@ CBenValue::ReadValueData(void * pReadBuffer, size_t Offset,
}
else
{
- if ((Err = pContainer->SeekToPosition(pCurrSeg->GetPosition() +
- OffsetIntoSeg)) != BenErr_OK)
- return;
-
- if ((Err = pContainer->Read(pBuffer, AmtThisSeg,
- &AmtReadThisSeg)) != BenErr_OK)
- return;
+ pContainer->SeekToPosition(pCurrSeg->GetPosition() +
+ OffsetIntoSeg);
+ pContainer->Read(pBuffer, AmtThisSeg, &AmtReadThisSeg);
}
*pAmtRead += AmtReadThisSeg;
diff --git a/lotuswordpro/source/filter/tocread.cxx b/lotuswordpro/source/filter/tocread.cxx
index 93d5a451d993..baf84184319b 100644
--- a/lotuswordpro/source/filter/tocread.cxx
+++ b/lotuswordpro/source/filter/tocread.cxx
@@ -81,8 +81,7 @@ CBenTOCReader::ReadLabelAndTOC()
if (cTOCSize > nLength - TOCOffset)
return BenErr_ReadPastEndOfTOC;
- if ((Err = cpContainer->SeekToPosition(TOCOffset)) != BenErr_OK)
- return Err;
+ cpContainer->SeekToPosition(TOCOffset);
cpTOC.reset( new BenByte[cTOCSize] );
if ((Err = cpContainer->ReadKnownSize(cpTOC.get(), cTOCSize)) != BenErr_OK)
@@ -100,8 +99,7 @@ CBenTOCReader::ReadLabel(unsigned long * pTOCOffset, unsigned long * pTOCSize)
// If seek fails, then probably because stream is smaller than
// BEN_LABEL_SIZE and thus can't be Bento container
BenError Err;
- if ((Err = cpContainer->SeekFromEnd(-BEN_LABEL_SIZE)) != BenErr_OK)
- return BenErr_NotBentoContainer;
+ cpContainer->SeekFromEnd(-BEN_LABEL_SIZE);
BenByte Label[BEN_LABEL_SIZE];
if ((Err = cpContainer->ReadKnownSize(Label, BEN_LABEL_SIZE)) != BenErr_OK)
@@ -172,9 +170,7 @@ CBenTOCReader::SearchForLabel(BenByte * pLabel)
UsedBufferSize = CurrOffset;
else UsedBufferSize = LABEL_READ_BUFFER_SIZE;
- if ((Err = cpContainer->SeekToPosition(CurrOffset - UsedBufferSize))
- != BenErr_OK)
- return Err;
+ cpContainer->SeekToPosition(CurrOffset - UsedBufferSize);
if ((Err = cpContainer->ReadKnownSize(Buffer, UsedBufferSize)) !=
BenErr_OK)
@@ -186,9 +182,8 @@ CBenTOCReader::SearchForLabel(BenByte * pLabel)
if (memcmp(Buffer + (CurrOffset - BEN_MAGIC_BYTES_SIZE -
BufferStartOffset), gsBenMagicBytes, BEN_MAGIC_BYTES_SIZE) == 0)
{
- if ((Err = cpContainer->SeekToPosition(CurrOffset -
- BEN_MAGIC_BYTES_SIZE)) != BenErr_OK)
- return Err;
+ cpContainer->SeekToPosition(CurrOffset -
+ BEN_MAGIC_BYTES_SIZE);
return cpContainer->ReadKnownSize(pLabel, BEN_LABEL_SIZE);
}
@@ -265,8 +260,7 @@ CBenTOCReader::ReadTOC()
return Err;
LookAhead = GetCode();
- if ((Err = cpContainer->SeekToPosition(Pos)) != BenErr_OK)
- return Err;
+ cpContainer->SeekToPosition(Pos);
const auto nRemainingSize = cpContainer->remainingSize();
if (Length > nRemainingSize)