diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 06253f3..f43775b 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -1241,6 +1241,8 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage( sal_Bool bCreateTempIf return pImp->xStorage; SFX_ITEMSET_ARG( GetItemSet(), pRepairItem, SfxBoolItem, SID_REPAIRPACKAGE, false); + fprintf( stderr, "here: repair ? %p %d\n", + pRepairItem, (int)(pRepairItem ? pRepairItem->GetValue() : 0) ); if ( pRepairItem && pRepairItem->GetValue() ) { // the storage should be created for repairing mode diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index cf8d0c2..c80e583 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -2219,7 +2220,13 @@ sal_Bool SfxObjectShell::ImportFrom( SfxMedium& rMedium, bool bInsert ) } return xLoader->filter( aArgs ); - }catch(...) + } + catch (const packages::zip::ZipIOException&) + { + fprintf( stderr, "zip except 0x%x 0x%x\n", (int)GetError(), (int)GetErrorCode() ); + SetError( ERRCODE_IO_BROKENPACKAGE, "Badness in the underlying package format." ); + } + catch(...) {} } diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 38a9961..0a7e14a 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -102,11 +102,14 @@ LoggedStream(dmapper_logger, "DomainMapper"), //import document properties + fprintf( stderr, "FIXME horrible hack!\n" ); + sal_Bool bRepairStorage = sal_True; + try { uno::Reference< lang::XMultiServiceFactory > xFactory(xContext->getServiceManager(), uno::UNO_QUERY_THROW); uno::Reference< embed::XStorage > xDocumentStorage = - (comphelper::OStorageHelper::GetStorageOfFormatFromInputStream(OFOPXML_STORAGE_FORMAT_STRING, xInputStream)); + (comphelper::OStorageHelper::GetStorageOfFormatFromInputStream(OFOPXML_STORAGE_FORMAT_STRING, xInputStream, xFactory, bRepairStorage )); uno::Reference< uno::XInterface > xTemp = xContext->getServiceManager()->createInstanceWithContext( "com.sun.star.document.OOXMLDocumentPropertiesImporter", diff --git a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx index 9874740..8341588 100644 --- a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx +++ b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx @@ -38,9 +38,13 @@ OOXMLStreamImpl::OOXMLStreamImpl uno::Reference xStorageStream, StreamType_t nType) : mxContext(xContext), mxStorageStream(xStorageStream), mnStreamType(nType) { + fprintf( stderr, "here - another disaster\n" ); + uno::Reference< lang::XMultiServiceFactory > xFactory(xContext->getServiceManager(), uno::UNO_QUERY_THROW); + + sal_Bool bRepairStorage = sal_True; mxStorage.set (comphelper::OStorageHelper::GetStorageOfFormatFromInputStream - (OFOPXML_STORAGE_FORMAT_STRING, mxStorageStream)); + (OFOPXML_STORAGE_FORMAT_STRING, mxStorageStream, xFactory, bRepairStorage)); mxRelationshipAccess.set(mxStorage, uno::UNO_QUERY_THROW); init();