Kaydet (Commit) 4dfa19d6 authored tarafından Eike Rathke's avatar Eike Rathke

Revert "tdf#89319 remove redundant file seekings in XLS export"

As the crash tests have shown, the assert introduced with
71b630e5 to force verification of the
assumption made in 8e2293e0 was hit in
120 documents.

Citing from https://gerrit.libreoffice.org/#/c/14427/ comment:
"The assumptions behind this patch are wrong. This only works if every
single part of the export goes through StartRecord/EndRecord calls. We
have some features that don't use that and need the STREAM_SEEK_TO_END
in the beginning of the StartRecord."

Revert "replace an OSL_ENSURE() with assert(), tdf#89319 related"

This reverts commit 71b630e5.

Revert "tdf#89319 remove redundant file seekings in XLS export"

This reverts commit 8e2293e0.
üst a62d7f3b
...@@ -109,8 +109,6 @@ void XclExpStream::StartRecord( sal_uInt16 nRecId, sal_Size nRecSize ) ...@@ -109,8 +109,6 @@ void XclExpStream::StartRecord( sal_uInt16 nRecId, sal_Size nRecSize )
DisableEncryption(); DisableEncryption();
mnMaxContSize = mnCurrMaxSize = mnMaxRecSize; mnMaxContSize = mnCurrMaxSize = mnMaxRecSize;
mnPredictSize = nRecSize; mnPredictSize = nRecSize;
if ( mbInRec )
mrStrm.Seek( STREAM_SEEK_TO_END );
mbInRec = true; mbInRec = true;
InitRecord( nRecId ); InitRecord( nRecId );
SetSliceSize( 0 ); SetSliceSize( 0 );
...@@ -382,7 +380,7 @@ sal_uInt64 XclExpStream::SetSvStreamPos(sal_uInt64 const nPos) ...@@ -382,7 +380,7 @@ sal_uInt64 XclExpStream::SetSvStreamPos(sal_uInt64 const nPos)
void XclExpStream::InitRecord( sal_uInt16 nRecId ) void XclExpStream::InitRecord( sal_uInt16 nRecId )
{ {
assert(mrStrm.remainingSize() == 0); // stream must be at end position mrStrm.Seek( STREAM_SEEK_TO_END );
mrStrm.WriteUInt16( nRecId ); mrStrm.WriteUInt16( nRecId );
mnLastSizePos = mrStrm.Tell(); mnLastSizePos = mrStrm.Tell();
...@@ -419,7 +417,6 @@ void XclExpStream::StartContinue() ...@@ -419,7 +417,6 @@ void XclExpStream::StartContinue()
UpdateRecSize(); UpdateRecSize();
mnCurrMaxSize = mnMaxContSize; mnCurrMaxSize = mnMaxContSize;
mnPredictSize -= mnCurrSize; mnPredictSize -= mnCurrSize;
mrStrm.Seek( STREAM_SEEK_TO_END );
InitRecord( EXC_ID_CONT ); InitRecord( EXC_ID_CONT );
} }
......
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