summaryrefslogtreecommitdiff
path: root/sc/source/filter/excel/xestream.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2009-10-15 18:23:29 -0400
committerKohei Yoshida <kyoshida@novell.com>2009-10-15 18:23:29 -0400
commit318dc20fff2fb93b93229e7ee7bebbcd11251089 (patch)
treeaf733996de86bf25b3e4fde4f025d914fc9b3e3e /sc/source/filter/excel/xestream.cxx
parente5c05fab9e453f32a94aad4487764bf58b70573c (diff)
Support slice settings in WriteZeroBytesToRecord().
Diffstat (limited to 'sc/source/filter/excel/xestream.cxx')
-rw-r--r--sc/source/filter/excel/xestream.cxx11
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 )