diff options
Diffstat (limited to 'filter')
-rw-r--r-- | filter/Library_placeware.mk | 1 | ||||
-rw-r--r-- | filter/source/flash/swfexporter.cxx | 12 | ||||
-rw-r--r-- | filter/source/flash/swfexporter.hxx | 11 | ||||
-rw-r--r-- | filter/source/flash/swffilter.cxx | 16 | ||||
-rw-r--r-- | filter/source/placeware/exporter.cxx | 11 | ||||
-rw-r--r-- | filter/source/placeware/exporter.hxx | 12 | ||||
-rw-r--r-- | filter/source/placeware/filter.cxx | 13 | ||||
-rw-r--r-- | filter/source/svg/svgexport.cxx | 39 |
8 files changed, 56 insertions, 59 deletions
diff --git a/filter/Library_placeware.mk b/filter/Library_placeware.mk index 732c31f3bfa1..948ecf1060e8 100644 --- a/filter/Library_placeware.mk +++ b/filter/Library_placeware.mk @@ -24,6 +24,7 @@ $(eval $(call gb_Library_set_componentfile,placeware,filter/source/placeware/pla $(eval $(call gb_Library_use_sdk_api,placeware)) $(eval $(call gb_Library_use_libraries,placeware,\ + comphelper \ cppuhelper \ cppu \ sal \ diff --git a/filter/source/flash/swfexporter.cxx b/filter/source/flash/swfexporter.cxx index 81c7f762be08..8bc51b69b6dc 100644 --- a/filter/source/flash/swfexporter.cxx +++ b/filter/source/flash/swfexporter.cxx @@ -19,6 +19,7 @@ #include <com/sun/star/awt/Rectangle.hpp> #include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/drawing/GraphicExportFilter.hpp> #include <com/sun/star/drawing/XMasterPageTarget.hpp> #include <com/sun/star/drawing/XDrawPagesSupplier.hpp> #include <com/sun/star/container/XIndexAccess.hpp> @@ -45,7 +46,6 @@ using namespace ::com::sun::star::task; using namespace ::std; using namespace ::swf; -using com::sun::star::lang::XMultiServiceFactory; using com::sun::star::io::XOutputStream; using com::sun::star::beans::PropertyValue; using com::sun::star::container::XIndexAccess; @@ -90,8 +90,8 @@ void PageInfo::addShape( ShapeInfo* pShapeInfo ) // ----------------------------------------------------------------------------- -FlashExporter::FlashExporter(const Reference< XMultiServiceFactory > &rxMSF, sal_Int32 nJPEGCompressMode, sal_Bool bExportOLEAsJPEG) -: mxMSF( rxMSF ), +FlashExporter::FlashExporter(const Reference< XComponentContext > &rxContext, sal_Int32 nJPEGCompressMode, sal_Bool bExportOLEAsJPEG) +: mxContext( rxContext ), mpWriter( NULL ), mnJPEGcompressMode(nJPEGCompressMode), mbExportOLEAsJPEG(bExportOLEAsJPEG), @@ -638,9 +638,7 @@ void FlashExporter::exportShape( Reference< XShape >& xShape, bool bMaster ) bool FlashExporter::getMetaFile( Reference< XComponent >&xComponent, GDIMetaFile& rMtf, bool bOnlyBackground /* = false */, bool bExportAsJPEG /* = false */) { if( !mxGraphicExporter.is() ) - mxGraphicExporter = Reference< XExporter >::query( mxMSF->createInstance( "com.sun.star.drawing.GraphicExportFilter" ) ); - - Reference< XFilter > xFilter( mxGraphicExporter, UNO_QUERY ); + mxGraphicExporter = GraphicExportFilter::create( mxContext ); utl::TempFile aFile; aFile.EnableKillingFile(); @@ -675,7 +673,7 @@ bool FlashExporter::getMetaFile( Reference< XComponent >&xComponent, GDIMetaFile aDescriptor[3].Value <<= (sal_Bool)bOnlyBackground; } mxGraphicExporter->setSourceDocument( xComponent ); - xFilter->filter( aDescriptor ); + mxGraphicExporter->filter( aDescriptor ); if (bExportAsJPEG) { diff --git a/filter/source/flash/swfexporter.hxx b/filter/source/flash/swfexporter.hxx index 720c21425ff8..de8e87b4ed0e 100644 --- a/filter/source/flash/swfexporter.hxx +++ b/filter/source/flash/swfexporter.hxx @@ -21,10 +21,9 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/lang/XComponent.hpp> -#include <com/sun/star/io/XOutputStream.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/document/XExporter.hpp> #include <com/sun/star/drawing/XDrawPage.hpp> +#include <com/sun/star/drawing/XGraphicExportFilter.hpp> +#include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/presentation/AnimationEffect.hpp> #include <com/sun/star/presentation/AnimationSpeed.hpp> #include <com/sun/star/presentation/ClickAction.hpp> @@ -151,7 +150,7 @@ typedef ::std::map<sal_uInt32, PageInfo> PageInfoMap; class FlashExporter { public: - FlashExporter( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxMSF, sal_Int32 nJPEGCompressMode = -1, sal_Bool bExportOLEAsJPEG = false); + FlashExporter( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, sal_Int32 nJPEGCompressMode = -1, sal_Bool bExportOLEAsJPEG = false); ~FlashExporter(); void Flush(); @@ -171,8 +170,8 @@ public: ChecksumCache gMetafileCache; private: - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF; - ::com::sun::star::uno::Reference< ::com::sun::star::document::XExporter > mxGraphicExporter; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext; + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XGraphicExportFilter > mxGraphicExporter; PageInfoMap maPagesMap; diff --git a/filter/source/flash/swffilter.cxx b/filter/source/flash/swffilter.cxx index 210d1633d22b..d3d530677405 100644 --- a/filter/source/flash/swffilter.cxx +++ b/filter/source/flash/swffilter.cxx @@ -142,11 +142,11 @@ class FlashExportFilter : public cppu::WeakImplHelper4 > { Reference< XComponent > mxDoc; - Reference< XMultiServiceFactory > mxMSF; + Reference< XComponentContext > mxContext; Reference< XStatusIndicator> mxStatusIndicator; public: - FlashExportFilter( const Reference< XMultiServiceFactory > &rxMSF); + FlashExportFilter( const Reference< XComponentContext > &rxContext); // XFilter virtual sal_Bool SAL_CALL filter( const Sequence< PropertyValue >& aDescriptor ) throw(RuntimeException); @@ -170,8 +170,8 @@ public: // ----------------------------------------------------------------------------- -FlashExportFilter::FlashExportFilter(const Reference< XMultiServiceFactory > &rxMSF) -: mxMSF( rxMSF ) +FlashExportFilter::FlashExportFilter(const Reference< XComponentContext > &rxContext) +: mxContext( rxContext ) { } @@ -264,7 +264,7 @@ sal_Bool FlashExportFilter::ExportAsMultipleFiles(const Sequence< PropertyValue if(!xDrawPages.is()) return sal_False; - Reference< XDesktop2 > rDesktop = Desktop::create( comphelper::getComponentContext(mxMSF) ); + Reference< XDesktop2 > rDesktop = Desktop::create( mxContext ); Reference< XStorable > xStorable(rDesktop->getCurrentComponent(), UNO_QUERY); if (!xStorable.is()) @@ -324,7 +324,7 @@ sal_Bool FlashExportFilter::ExportAsMultipleFiles(const Sequence< PropertyValue // TODO: check for errors (void) err; - FlashExporter aFlashExporter( mxMSF, findPropertyValue<sal_Int32>(aFilterData, "CompressMode", 75), + FlashExporter aFlashExporter( mxContext, findPropertyValue<sal_Int32>(aFilterData, "CompressMode", 75), findPropertyValue<sal_Bool>(aFilterData, "ExportOLEAsJPEG", false)); const sal_Int32 nPageCount = xDrawPages->getCount(); @@ -416,7 +416,7 @@ sal_Bool FlashExportFilter::ExportAsSingleFile(const Sequence< PropertyValue >& return sal_False; } - FlashExporter aFlashExporter( mxMSF, findPropertyValue<sal_Int32>(aFilterData, "CompressMode", 75), + FlashExporter aFlashExporter( mxContext, findPropertyValue<sal_Int32>(aFilterData, "CompressMode", 75), findPropertyValue<sal_Bool>(aFilterData, "ExportOLEAsJPEG", false)); return aFlashExporter.exportAll( mxDoc, xOutputStream, mxStatusIndicator ); @@ -481,7 +481,7 @@ Sequence< OUString > SAL_CALL FlashExportFilter_getSupportedServiceNames( ) Reference< XInterface > SAL_CALL FlashExportFilter_createInstance( const Reference< XMultiServiceFactory > & rSMgr) throw( Exception ) { - return (cppu::OWeakObject*) new FlashExportFilter( rSMgr ); + return (cppu::OWeakObject*) new FlashExportFilter( comphelper::getComponentContext(rSMgr) ); } // ----------------------------------------------------------------------------- diff --git a/filter/source/placeware/exporter.cxx b/filter/source/placeware/exporter.cxx index ccc807093108..dcc051cc5e05 100644 --- a/filter/source/placeware/exporter.cxx +++ b/filter/source/placeware/exporter.cxx @@ -21,6 +21,7 @@ #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/drawing/XDrawPagesSupplier.hpp> +#include <com/sun/star/drawing/GraphicExportFilter.hpp> #include <com/sun/star/presentation/XPresentationPage.hpp> #include <com/sun/star/container/XIndexAccess.hpp> #include <com/sun/star/document/XFilter.hpp> @@ -57,8 +58,8 @@ using com::sun::star::task::XStatusIndicator; // ----------------------------------------------------------------------------- -PlaceWareExporter::PlaceWareExporter(const Reference< XMultiServiceFactory > &rxMSF) -: mxMSF( rxMSF ) +PlaceWareExporter::PlaceWareExporter(const Reference< XComponentContext > & rxContext) +: mxContext( rxContext ) { } @@ -290,7 +291,8 @@ sal_Bool PlaceWareExporter::doExport( Reference< XComponent > xDoc, Reference < { sal_Bool bRet = sal_False; - mxGraphicExporter = Reference< XExporter >::query( mxMSF->createInstance( OUString("com.sun.star.drawing.GraphicExportFilter") ) ); + mxGraphicExporter = GraphicExportFilter::create( mxContext ); + Reference< XDrawPagesSupplier > xDrawPagesSupplier(xDoc, UNO_QUERY); if(!xDrawPagesSupplier.is()) return sal_False; @@ -482,7 +484,6 @@ PageEntry* PlaceWareExporter::exportPage( Reference< XDrawPage >&xDrawPage ) } // create the gif - Reference< XFilter > xFilter( mxGraphicExporter, UNO_QUERY ); Sequence< PropertyValue > aFilterData( 2 ); aFilterData[0].Name = OUString("Width"); @@ -498,7 +499,7 @@ PageEntry* PlaceWareExporter::exportPage( Reference< XDrawPage >&xDrawPage ) aDescriptor[2].Name = OUString("FilterData"); aDescriptor[2].Value <<= aFilterData; mxGraphicExporter->setSourceDocument( xComp ); - xFilter->filter( aDescriptor ); + mxGraphicExporter->filter( aDescriptor ); return pEntry; } diff --git a/filter/source/placeware/exporter.hxx b/filter/source/placeware/exporter.hxx index 67cb8ca03054..d9405f6d9e6a 100644 --- a/filter/source/placeware/exporter.hxx +++ b/filter/source/placeware/exporter.hxx @@ -19,20 +19,20 @@ #ifndef _PLACEWARE_EXPORTER_HXX #define _PLACEWARE_EXPORTER_HXX +#include <com/sun/star/drawing/XDrawPage.hpp> +#include <com/sun/star/drawing/XGraphicExportFilter.hpp> #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/io/XOutputStream.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/document/XExporter.hpp> -#include <com/sun/star/drawing/XDrawPage.hpp> #include <com/sun/star/task/XInteractionHandler.hpp> #include <com/sun/star/task/XStatusIndicator.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> class PageEntry; class PlaceWareExporter { public: - PlaceWareExporter( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxMSF ); + PlaceWareExporter( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ); ~PlaceWareExporter(); sal_Bool doExport( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > xDoc, @@ -44,8 +44,8 @@ public: private: PageEntry* exportPage( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >&xDrawPage ); - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF; - ::com::sun::star::uno::Reference< ::com::sun::star::document::XExporter > mxGraphicExporter; + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext; + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XGraphicExportFilter > mxGraphicExporter; ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler > mxInteractionHandler; }; diff --git a/filter/source/placeware/filter.cxx b/filter/source/placeware/filter.cxx index 6ad7e8733d6c..7e860b481830 100644 --- a/filter/source/placeware/filter.cxx +++ b/filter/source/placeware/filter.cxx @@ -22,6 +22,7 @@ #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <cppuhelper/implbase4.hxx> +#include <comphelper/processfactory.hxx> #include "exporter.hxx" @@ -47,10 +48,10 @@ class PlaceWareExportFilter : public cppu::WeakImplHelper4 > { Reference< XComponent > mxDoc; - Reference< XMultiServiceFactory > mxMSF; + Reference< XComponentContext > mxContext; public: - PlaceWareExportFilter( const Reference< XMultiServiceFactory > &rxMSF); + PlaceWareExportFilter( const Reference< XComponentContext > &rxContext); // XFilter virtual sal_Bool SAL_CALL filter( const Sequence< PropertyValue >& aDescriptor ) throw(RuntimeException); @@ -70,8 +71,8 @@ public: // ----------------------------------------------------------------------------- -PlaceWareExportFilter::PlaceWareExportFilter(const Reference< XMultiServiceFactory > &rxMSF) -: mxMSF( rxMSF ) +PlaceWareExportFilter::PlaceWareExportFilter(const Reference< XComponentContext > &rxContext) +: mxContext( rxContext ) { } @@ -111,7 +112,7 @@ sal_Bool SAL_CALL PlaceWareExportFilter::filter( const ::com::sun::star::uno::Se return sal_False; } - PlaceWareExporter aExporter( mxMSF ); + PlaceWareExporter aExporter( mxContext ); return aExporter.doExport( mxDoc, xOutputStream, sURL, xInteractionHandler, xStatusIndicator ); } @@ -174,7 +175,7 @@ Sequence< OUString > SAL_CALL PlaceWareExportFilter_getSupportedServiceNames( ) Reference< XInterface > SAL_CALL PlaceWareExportFilter_createInstance( const Reference< XMultiServiceFactory > & rSMgr) throw( Exception ) { - return (cppu::OWeakObject*) new PlaceWareExportFilter( rSMgr ); + return (cppu::OWeakObject*) new PlaceWareExportFilter( comphelper::getComponentContext(rSMgr) ); } // ----------------------------------------------------------------------------- diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index e1fea4f4d183..fdf12a736dae 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -23,8 +23,9 @@ #include "svgscript.hxx" #include "impsvgdialog.hxx" -#include <com/sun/star/util/MeasureUnit.hpp> +#include <com/sun/star/drawing/GraphicExportFilter.hpp> #include <com/sun/star/text/textfield/Type.hpp> +#include <com/sun/star/util/MeasureUnit.hpp> #include <com/sun/star/xml/sax/Writer.hpp> #include <rtl/bootstrap.hxx> @@ -2001,33 +2002,29 @@ sal_Bool SVGFilter::implCreateObjectsFromShape( const Reference< XDrawPage > & r sal_Bool SVGFilter::implCreateObjectsFromBackground( const Reference< XDrawPage >& rxDrawPage ) { - Reference< XExporter > xExporter( mxContext->getServiceManager()->createInstanceWithContext( "com.sun.star.drawing.GraphicExportFilter", mxContext ), UNO_QUERY ); + Reference< XGraphicExportFilter > xExporter = drawing::GraphicExportFilter::create( mxContext ); sal_Bool bRet = sal_False; - if( xExporter.is() ) - { - GDIMetaFile aMtf; - Reference< XFilter > xFilter( xExporter, UNO_QUERY ); + GDIMetaFile aMtf; - utl::TempFile aFile; - aFile.EnableKillingFile(); + utl::TempFile aFile; + aFile.EnableKillingFile(); - Sequence< PropertyValue > aDescriptor( 3 ); - aDescriptor[0].Name = "FilterName"; - aDescriptor[0].Value <<= OUString( "SVM" ); - aDescriptor[1].Name = "URL"; - aDescriptor[1].Value <<= OUString( aFile.GetURL() ); - aDescriptor[2].Name = "ExportOnlyBackground"; - aDescriptor[2].Value <<= (sal_Bool) sal_True; + Sequence< PropertyValue > aDescriptor( 3 ); + aDescriptor[0].Name = "FilterName"; + aDescriptor[0].Value <<= OUString( "SVM" ); + aDescriptor[1].Name = "URL"; + aDescriptor[1].Value <<= OUString( aFile.GetURL() ); + aDescriptor[2].Name = "ExportOnlyBackground"; + aDescriptor[2].Value <<= (sal_Bool) sal_True; - xExporter->setSourceDocument( Reference< XComponent >( rxDrawPage, UNO_QUERY ) ); - xFilter->filter( aDescriptor ); - aMtf.Read( *aFile.GetStream( STREAM_READ ) ); + xExporter->setSourceDocument( Reference< XComponent >( rxDrawPage, UNO_QUERY ) ); + xExporter->filter( aDescriptor ); + aMtf.Read( *aFile.GetStream( STREAM_READ ) ); - (*mpObjects)[ rxDrawPage ] = ObjectRepresentation( rxDrawPage, aMtf ); + (*mpObjects)[ rxDrawPage ] = ObjectRepresentation( rxDrawPage, aMtf ); - bRet = sal_True; - } + bRet = sal_True; return bRet; } |