summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2018-10-11 18:49:34 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-15 07:56:42 +0200
commit9ec8bf8f22fe74884185492ef2576ce79b41e4f1 (patch)
tree0b162c71c51a55125a2ce6055632d4f96180f431 /lotuswordpro
parenta84e3df74eecc8778e3d5be5dd80ad4ddb511edf (diff)
add SvStream::TellEnd
and simplify callsites to use it instead of the current "seek to end, find pos, seek back to original pos" pattern Change-Id: Ib5828868f73c341891efc759af8bd4695ae2f33c Reviewed-on: https://gerrit.libreoffice.org/61738 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/bencont.cxx14
-rw-r--r--lotuswordpro/source/filter/lwpgrfobj.cxx5
2 files changed, 3 insertions, 16 deletions
diff --git a/lotuswordpro/source/filter/bencont.cxx b/lotuswordpro/source/filter/bencont.cxx
index cb2f97f9d924..06be40c8a614 100644
--- a/lotuswordpro/source/filter/bencont.cxx
+++ b/lotuswordpro/source/filter/bencont.cxx
@@ -246,16 +246,6 @@ LtcUtBenValueStream * LtcBenContainer::FindValueStreamWithPropertyName(const cha
return FindNextValueStreamWithPropertyName(sPropertyName);
}
-static sal_uInt64 GetSvStreamSize(SvStream * pStream)
-{
- sal_uInt64 nCurPos = pStream->Tell();
- pStream->Seek(STREAM_SEEK_TO_END);
- sal_uInt64 ulLength = pStream->Tell();
- pStream->Seek(nCurPos);
-
- return ulLength;
-}
-
namespace
{
void readDataInBlocks(SvStream& rSt, sal_uInt64 nDLen, std::vector<sal_uInt8>& rData)
@@ -303,12 +293,12 @@ std::vector<sal_uInt8> LtcBenContainer::GetGraphicData(const char *pObjectName)
sal_uInt64 nDLen = 0;
if (xD)
{
- nDLen = GetSvStreamSize(xD.get());
+ nDLen = xD->TellEnd();
}
sal_uInt64 nSLen = 0;
if (xS)
{
- nSLen = GetSvStreamSize(xS.get()) ;
+ nSLen = xS->TellEnd();
}
sal_uInt64 nLen = nDLen + nSLen;
diff --git a/lotuswordpro/source/filter/lwpgrfobj.cxx b/lotuswordpro/source/filter/lwpgrfobj.cxx
index 2fc8d2ee3380..61f35d0879e4 100644
--- a/lotuswordpro/source/filter/lwpgrfobj.cxx
+++ b/lotuswordpro/source/filter/lwpgrfobj.cxx
@@ -384,10 +384,7 @@ sal_uInt32 LwpGraphicObject::GetGrafData(sal_uInt8*& pGrafData)
if (pMemGrafStream)
{
// read image data
- sal_uInt32 nPos = pGrafStream->Tell();
- pGrafStream->Seek(STREAM_SEEK_TO_END);
- sal_uInt32 nDataLen = pGrafStream->Tell();
- pGrafStream->Seek(nPos);
+ sal_uInt32 nDataLen = pGrafStream->TellEnd();
pGrafData = new sal_uInt8 [nDataLen];
pMemGrafStream->ReadBytes(pGrafData, nDataLen);