From 43cef38dfeea51d2058dcc5e18cfab8c05329c9d Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Sat, 31 Oct 2009 00:29:04 +0100 Subject: #i106421#: move msfilter to filter --- sd/source/filter/eppt/eppt.cxx | 40 +++++++++++++++++++++++++++++-- sd/source/filter/eppt/eppt.hxx | 2 +- sd/source/filter/eppt/escherex.hxx | 2 +- sd/source/filter/eppt/pptexanimations.hxx | 2 +- sd/source/filter/ppt/pptatom.hxx | 1 + sd/source/filter/ppt/pptin.cxx | 2 +- sd/source/filter/ppt/pptin.hxx | 4 ++-- sd/source/filter/ppt/pptinanimations.hxx | 4 +--- sd/source/filter/sdpptwrp.cxx | 38 ++++++++--------------------- sd/source/ui/docshell/docshel4.cxx | 2 +- sd/util/makefile.mk | 2 +- sd/util/sdfilt.map | 2 +- 12 files changed, 59 insertions(+), 42 deletions(-) diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx index cb31e99aec63..197a977c78a8 100644 --- a/sd/source/filter/eppt/eppt.cxx +++ b/sd/source/filter/eppt/eppt.cxx @@ -58,10 +58,11 @@ #include #include #include -#include +#include #include #include -#include +#include +#include #include #include @@ -2580,3 +2581,38 @@ extern "C" SAL_DLLPUBLIC_EXPORT BOOL __LOADONCALLAPI ExportPPT( SvStorageRef& rS return bStatus; } +extern "C" SAL_DLLPUBLIC_EXPORT BOOL __LOADONCALLAPI SaveVBA( SfxObjectShell& rDocShell, SvMemoryStream*& pBas ) +{ + SvStorageRef xDest( new SvStorage( new SvMemoryStream(), TRUE ) ); + SvxImportMSVBasic aMSVBas( rDocShell, *xDest, FALSE, FALSE ); + aMSVBas.SaveOrDelMSVBAStorage( TRUE, String( RTL_CONSTASCII_USTRINGPARAM("_MS_VBA_Overhead") ) ); + + SvStorageRef xOverhead = xDest->OpenSotStorage( String( RTL_CONSTASCII_USTRINGPARAM("_MS_VBA_Overhead") ) ); + if ( xOverhead.Is() && ( xOverhead->GetError() == SVSTREAM_OK ) ) + { + SvStorageRef xOverhead2 = xOverhead->OpenSotStorage( String( RTL_CONSTASCII_USTRINGPARAM("_MS_VBA_Overhead") ) ); + if ( xOverhead2.Is() && ( xOverhead2->GetError() == SVSTREAM_OK ) ) + { + SvStorageStreamRef xTemp = xOverhead2->OpenSotStream( String( RTL_CONSTASCII_USTRINGPARAM("_MS_VBA_Overhead2") ) ); + if ( xTemp.Is() && ( xTemp->GetError() == SVSTREAM_OK ) ) + { + UINT32 nLen = xTemp->GetSize(); + if ( nLen ) + { + char* pTemp = new char[ nLen ]; + if ( pTemp ) + { + xTemp->Seek( STREAM_SEEK_TO_BEGIN ); + xTemp->Read( pTemp, nLen ); + pBas = new SvMemoryStream( pTemp, nLen, STREAM_READ ); + pBas->ObjectOwnsMemory( TRUE ); + return TRUE; + } + } + } + } + } + + return FALSE; +} + diff --git a/sd/source/filter/eppt/eppt.hxx b/sd/source/filter/eppt/eppt.hxx index c4a55b5c4369..b4d6fdf79559 100644 --- a/sd/source/filter/eppt/eppt.hxx +++ b/sd/source/filter/eppt/eppt.hxx @@ -85,7 +85,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sd/source/filter/eppt/escherex.hxx b/sd/source/filter/eppt/escherex.hxx index 1ebebe8a5504..577531d9f534 100644 --- a/sd/source/filter/eppt/escherex.hxx +++ b/sd/source/filter/eppt/escherex.hxx @@ -30,7 +30,7 @@ #ifndef _PptEscherEX_HXX #define _PptEscherEX_HXX -#include +#include // --------------------------------------------------------------------------------------------- // Werte fuer den ULONG im PPT_PST_TextHeaderAtom diff --git a/sd/source/filter/eppt/pptexanimations.hxx b/sd/source/filter/eppt/pptexanimations.hxx index 78dbb731ef0b..effbe3381cea 100644 --- a/sd/source/filter/eppt/pptexanimations.hxx +++ b/sd/source/filter/eppt/pptexanimations.hxx @@ -38,7 +38,7 @@ #include "../ppt/pptanimations.hxx" #endif #include -#include +#include #ifdef DBG_ANIM_LOG #include diff --git a/sd/source/filter/ppt/pptatom.hxx b/sd/source/filter/ppt/pptatom.hxx index 9ccd845d14e6..14a7f81b4e98 100644 --- a/sd/source/filter/ppt/pptatom.hxx +++ b/sd/source/filter/ppt/pptatom.hxx @@ -32,6 +32,7 @@ #define _PPTATOM_HXX_ #include +#include class SvStream; diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index ae347eeaba12..37277a17c97b 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sd/source/filter/ppt/pptin.hxx b/sd/source/filter/ppt/pptin.hxx index 59d59eece151..0549f8fa85c0 100644 --- a/sd/source/filter/ppt/pptin.hxx +++ b/sd/source/filter/ppt/pptin.hxx @@ -31,11 +31,11 @@ #ifndef _SD_PPTIN_HXX #define _SD_PPTIN_HXX -#include +#include #include #include #include -#include +#include #include #include diff --git a/sd/source/filter/ppt/pptinanimations.hxx b/sd/source/filter/ppt/pptinanimations.hxx index 114f471a3cef..e53a2c406f36 100644 --- a/sd/source/filter/ppt/pptinanimations.hxx +++ b/sd/source/filter/ppt/pptinanimations.hxx @@ -34,15 +34,13 @@ #include #include -#ifndef _SD_PPTANIMATIONS_HXX #include "pptanimations.hxx" -#endif #include #ifdef DBG_ANIM_LOG #include #endif -#include +#include #include diff --git a/sd/source/filter/sdpptwrp.cxx b/sd/source/filter/sdpptwrp.cxx index bc4a63012caa..8dea30f1659a 100644 --- a/sd/source/filter/sdpptwrp.cxx +++ b/sd/source/filter/sdpptwrp.cxx @@ -34,8 +34,8 @@ #include #include #include -#include -#include +#include +#include #include #include @@ -43,7 +43,7 @@ #include "ppt/pptin.hxx" #include "drawdoc.hxx" #include -#include +#include // -------------- // - Namespaces - @@ -54,7 +54,6 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::task; using namespace ::com::sun::star::frame; - typedef BOOL ( __LOADONCALLAPI *ExportPPT )( SvStorageRef&, Reference< XModel > &, Reference< XStatusIndicator > &, @@ -63,6 +62,8 @@ typedef BOOL ( __LOADONCALLAPI *ExportPPT )( SvStorageRef&, typedef sal_Bool ( SAL_CALL *ImportPPT )( const ::rtl::OUString&, Sequence< PropertyValue >*, SdDrawDocument*, SvStream&, SvStorage&, SfxMedium& ); +typedef BOOL ( __LOADONCALLAPI *SaveVBA )( SfxObjectShell&, SvMemoryStream*& ); + // --------------- // - SdPPTFilter - // --------------- @@ -188,32 +189,13 @@ void SdPPTFilter::PreSaveBasic() SvtFilterOptions* pFilterOptions = SvtFilterOptions::Get(); if( pFilterOptions && pFilterOptions->IsLoadPPointBasicStorage() ) { - SvStorageRef xDest( new SvStorage( new SvMemoryStream(), TRUE ) ); - SvxImportMSVBasic aMSVBas( (SfxObjectShell&) mrDocShell, *xDest, FALSE, FALSE ); - aMSVBas.SaveOrDelMSVBAStorage( TRUE, String( RTL_CONSTASCII_USTRINGPARAM("_MS_VBA_Overhead") ) ); - - SvStorageRef xOverhead = xDest->OpenSotStorage( String( RTL_CONSTASCII_USTRINGPARAM("_MS_VBA_Overhead") ) ); - if ( xOverhead.Is() && ( xOverhead->GetError() == SVSTREAM_OK ) ) + ::osl::Module* pLibrary = OpenLibrary( mrMedium.GetFilter()->GetUserData() ); + if( pLibrary ) { - SvStorageRef xOverhead2 = xOverhead->OpenSotStorage( String( RTL_CONSTASCII_USTRINGPARAM("_MS_VBA_Overhead") ) ); - if ( xOverhead2.Is() && ( xOverhead2->GetError() == SVSTREAM_OK ) ) + SaveVBA pSaveVBA= reinterpret_cast(pLibrary->getFunctionSymbol( ::rtl::OUString::createFromAscii("SaveVBA") )); + if( pSaveVBA ) { - SvStorageStreamRef xTemp = xOverhead2->OpenSotStream( String( RTL_CONSTASCII_USTRINGPARAM("_MS_VBA_Overhead2") ) ); - if ( xTemp.Is() && ( xTemp->GetError() == SVSTREAM_OK ) ) - { - UINT32 nLen = xTemp->GetSize(); - if ( nLen ) - { - char* pTemp = new char[ nLen ]; - if ( pTemp ) - { - xTemp->Seek( STREAM_SEEK_TO_BEGIN ); - xTemp->Read( pTemp, nLen ); - pBas = new SvMemoryStream( pTemp, nLen, STREAM_READ ); - pBas->ObjectOwnsMemory( TRUE ); - } - } - } + pSaveVBA( (SfxObjectShell&) mrDocShell, pBas ); } } } diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx index 3d2ea5ace652..ce2c38f20afd 100644 --- a/sd/source/ui/docshell/docshel4.cxx +++ b/sd/source/ui/docshell/docshel4.cxx @@ -66,7 +66,7 @@ #include #include #include -#include +//#include #include #include #include diff --git a/sd/util/makefile.mk b/sd/util/makefile.mk index e530511ee565..6b1e6ebf1676 100644 --- a/sd/util/makefile.mk +++ b/sd/util/makefile.mk @@ -250,7 +250,7 @@ DEF5NAME=$(SHL5TARGET) SHL5STDLIBS = $(ISDLIB) \ $(SVXCORELIB) \ - $(SVXMSFILTERLIB) \ + $(MSFILTERLIB) \ $(SFX2LIB) \ $(SVTOOLLIB) \ $(SOTLIB) \ diff --git a/sd/util/sdfilt.map b/sd/util/sdfilt.map index ac6b782f3145..62213393408d 100644 --- a/sd/util/sdfilt.map +++ b/sd/util/sdfilt.map @@ -2,7 +2,7 @@ PPTEXPORTER_1_0 { global: ExportPPT; ImportPPT; - + SaveVBA; local: *; }; -- cgit v1.2.3