summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorFrank Schönheit <fs@openoffice.org>2010-01-21 07:54:11 +0000
committerFrank Schönheit <fs@openoffice.org>2010-01-21 07:54:11 +0000
commitea62ada1ce0c04388de528a21f1e5d2edfab0fcf (patch)
tree9e2994c2d422e19739530a1a216f8ee2c3d83095 /sc
parent0203776ff2c1253188f488be8cc9d80c38d982ce (diff)
copying nn's fix from CWS dba321a herein, original commit comment: #i108488# #i108512# don't remove SC_MF_SCENARIO in ScAttrArray::InsertRow, block-wise skipping in zip stream
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/attarray.cxx3
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx22
2 files changed, 23 insertions, 2 deletions
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index 590f278901d6..a4875ba4d1e3 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -2117,7 +2117,8 @@ void ScAttrArray::InsertRow( SCROW nStartRow, SCSIZE nSize )
}
// Don't duplicate the merge flags in the inserted row.
- RemoveFlags( nStartRow, nStartRow+nSize-1, SC_MF_ALL );
+ // #i108488# SC_MF_SCENARIO has to be allowed.
+ RemoveFlags( nStartRow, nStartRow+nSize-1, SC_MF_HOR | SC_MF_VER | SC_MF_AUTO | SC_MF_BUTTON );
}
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 94613379a32d..c2fd53acb736 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -1575,6 +1575,26 @@ static bool lcl_CopyStreamElement( const uno::Reference< io::XInputStream >& xIn
return true; // successful
}
+static void lcl_SkipBytesInBlocks( const uno::Reference< io::XInputStream >& xInput, sal_Int32 nBytesToSkip )
+{
+ // skipBytes in zip stream is implemented as reading.
+ // For now, split into several calls to avoid allocating a large buffer.
+ // Later, skipBytes should be changed.
+
+ const sal_Int32 nMaxSize = 32*1024;
+
+ if ( nBytesToSkip > 0 )
+ {
+ sal_Int32 nRemaining = nBytesToSkip;
+ while ( nRemaining > 0 )
+ {
+ sal_Int32 nSkip = std::min( nRemaining, nMaxSize );
+ xInput->skipBytes( nSkip );
+ nRemaining -= nSkip;
+ }
+ }
+}
+
void ScXMLExport::CopySourceStream( sal_Int32 nStartOffset, sal_Int32 nEndOffset, sal_Int32& rNewStart, sal_Int32& rNewEnd )
{
uno::Reference<xml::sax::XDocumentHandler> xHandler = GetDocHandler();
@@ -1598,7 +1618,7 @@ void ScXMLExport::CopySourceStream( sal_Int32 nStartOffset, sal_Int32 nEndOffset
rNewStart = (sal_Int32)xDestSeek->getPosition();
if ( nStartOffset > nSourceStreamPos )
- xSourceStream->skipBytes( nStartOffset - nSourceStreamPos );
+ lcl_SkipBytesInBlocks( xSourceStream, nStartOffset - nSourceStreamPos );
if ( !lcl_CopyStreamElement( xSourceStream, xDestStream, nEndOffset - nStartOffset ) )
{