Kaydet (Commit) 523fc711 authored tarafından Caolán McNamara's avatar Caolán McNamara

pOptionalCalcSize is never null

Change-Id: I830d02cbac6d281ab7fbeaf43e7af6136896b503
üst 9cb3bd39
......@@ -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();
}
}
......
......@@ -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:
......
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