Merged xlsx-shared-xlsx-export-no-more-svstream-sotstorage.diff from ooo-build

This commit is contained in:
Katarina Machalkova 2010-10-13 17:58:15 +02:00
parent 6fd98badf2
commit ab08a3cc4d

View file

@ -1096,9 +1096,10 @@ bool XclExpXmlStream::exportDocument() throw()
{ {
ScDocShell* pShell = getDocShell(); ScDocShell* pShell = getDocShell();
ScDocument* pDoc = pShell->GetDocument(); ScDocument* pDoc = pShell->GetDocument();
SfxMedium* pMedium = pShell->GetMedium(); // NOTE: Don't use SotStorage or SvStream any more, and never call
SvStream* pMediumStream = pMedium->GetOutStream(); // SfxMedium::GetOutStream() anywhere in the xlsx export filter code!
SotStorageRef rStorage = new SotStorage( pMediumStream, false ); // Instead, write via XOutputStream instance.
SotStorageRef rStorage = static_cast<SotStorage*>(NULL);
XclExpRootData aData( EXC_BIFF8, *pShell->GetMedium (), rStorage, *pDoc, RTL_TEXTENCODING_DONTKNOW ); XclExpRootData aData( EXC_BIFF8, *pShell->GetMedium (), rStorage, *pDoc, RTL_TEXTENCODING_DONTKNOW );
aData.meOutput = EXC_OUTPUT_XML_2007; aData.meOutput = EXC_OUTPUT_XML_2007;
@ -1107,7 +1108,7 @@ bool XclExpXmlStream::exportDocument() throw()
mpRoot = &aRoot; mpRoot = &aRoot;
aRoot.GetOldRoot().pER = &aRoot; aRoot.GetOldRoot().pER = &aRoot;
aRoot.GetOldRoot().eDateiTyp = Biff8; aRoot.GetOldRoot().eDateiTyp = Biff8;
#if 0 // FIXME: Re-write this block without using SotStorage.
if ( SvtFilterOptions* pOptions = SvtFilterOptions::Get() ) if ( SvtFilterOptions* pOptions = SvtFilterOptions::Get() )
if ( pShell && pOptions->IsLoadExcelBasicStorage() ) if ( pShell && pOptions->IsLoadExcelBasicStorage() )
if ( sal_uInt32 nError if ( sal_uInt32 nError
@ -1118,7 +1119,7 @@ bool XclExpXmlStream::exportDocument() throw()
{ {
pShell->SetError( nError, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); pShell->SetError( nError, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
} }
#endif
OUString const workbook = CREATE_OUSTRING( "xl/workbook.xml" ); OUString const workbook = CREATE_OUSTRING( "xl/workbook.xml" );
PushStream( CreateOutputStream( workbook, workbook, PushStream( CreateOutputStream( workbook, workbook,
Reference <XOutputStream>(), Reference <XOutputStream>(),