summaryrefslogtreecommitdiff
path: root/sot/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-02-06 09:22:50 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-02-06 09:23:14 +0000
commit523fc71115071b6f74c8f05c1f8aeeeed775f8af (patch)
treeaa893fe4066bfb86f896095d5f4d6a345791545a /sot/source
parent9cb3bd3967b4313320906a32f13b56803687eba6 (diff)
pOptionalCalcSize is never null
Change-Id: I830d02cbac6d281ab7fbeaf43e7af6136896b503
Diffstat (limited to 'sot/source')
-rw-r--r--sot/source/sdstor/stgstrms.cxx10
-rw-r--r--sot/source/sdstor/stgstrms.hxx2
2 files changed, 5 insertions, 7 deletions
diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx
index 17958544d880..8e5093fe9a91 100644
--- a/sot/source/sdstor/stgstrms.cxx
+++ b/sot/source/sdstor/stgstrms.cxx
@@ -353,7 +353,7 @@ void StgStrm::SetEntry( StgDirEntry& r )
* for this each time build a simple flat in-memory vector list
* of pages.
*/
-void StgStrm::scanBuildPageChainCache(sal_Int32 *pOptionalCalcSize)
+sal_Int32 StgStrm::scanBuildPageChainCache()
{
if (m_nSize > 0)
m_aPagesCache.reserve(m_nSize/m_nPageSize);
@@ -384,12 +384,10 @@ void StgStrm::scanBuildPageChainCache(sal_Int32 *pOptionalCalcSize)
if (bError)
{
SAL_WARN("sot", "returning wrong format error");
- if (pOptionalCalcSize)
- m_rIo.SetError( ERRCODE_IO_WRONGFORMAT );
+ m_rIo.SetError( ERRCODE_IO_WRONGFORMAT );
m_aPagesCache.clear();
}
- if (pOptionalCalcSize)
- *pOptionalCalcSize = nOptSize;
+ return nOptSize;
}
// Compute page number and offset for the given byte position.
@@ -851,7 +849,7 @@ void StgDataStrm::Init( sal_Int32 nBgn, sal_Int32 nLen )
{
// determine the actual size of the stream by scanning
// the FAT chain and counting the # of pages allocated
- scanBuildPageChainCache( &m_nSize );
+ m_nSize = scanBuildPageChainCache();
}
}
diff --git a/sot/source/sdstor/stgstrms.hxx b/sot/source/sdstor/stgstrms.hxx
index 0a6589f204f7..a2c8ca6de383 100644
--- a/sot/source/sdstor/stgstrms.hxx
+++ b/sot/source/sdstor/stgstrms.hxx
@@ -73,7 +73,7 @@ protected:
short m_nOffset; // offset into current page
short m_nPageSize; // logical page size
std::vector<sal_Int32> m_aPagesCache;
- void scanBuildPageChainCache(sal_Int32 *pOptionalCalcSize);
+ sal_Int32 scanBuildPageChainCache();
bool Copy( sal_Int32 nFrom, sal_Int32 nBytes );
explicit StgStrm( StgIo& );
public: