diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2009-10-15 18:23:29 -0400 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2009-10-15 18:23:29 -0400 |
commit | 318dc20fff2fb93b93229e7ee7bebbcd11251089 (patch) | |
tree | af733996de86bf25b3e4fde4f025d914fc9b3e3e /sc/source/filter/excel/xestream.cxx | |
parent | e5c05fab9e453f32a94aad4487764bf58b70573c (diff) |
Support slice settings in WriteZeroBytesToRecord().
Diffstat (limited to 'sc/source/filter/excel/xestream.cxx')
-rw-r--r-- | sc/source/filter/excel/xestream.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index b83df4c5a057..a6c342b0a73a 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -266,8 +266,15 @@ void XclExpStream::WriteZeroBytesToRecord( sal_Size nBytes ) return; sal_uInt8 nZero = 0; - for (sal_Size i = 0; i < nBytes; ++i) - *this << nZero; + sal_Size nBytesLeft = nBytes; + while (nBytesLeft > 0) + { + sal_Size nWriteLen = ::std::min< sal_Size >(PrepareWrite(), nBytesLeft); + for (sal_Size i = 0; i < nWriteLen; ++i) + *this << nZero; + nBytesLeft -= nWriteLen; + UpdateSizeVars(nWriteLen); + } } sal_Size XclExpStream::CopyFromStream( SvStream& rInStrm, sal_Size nBytes ) |