summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-03-19 15:46:25 +0200
committerNoel Grandin <noel@peralex.com>2013-03-20 07:32:52 +0200
commitc09c64ede6a395ad4cc5a263e88d5e180b890127 (patch)
tree2ddcf5b0e6a7ad8e53579237b2fa5d52b5cf16a7
parent23a16f5d3856d6eb61d599af9e47add4c456bfb2 (diff)
fdo#46808, convert drawing::GraphicExportFilter to new style
Change-Id: Icd456209406ee8f4dc4ea1f966058f71dce08d58
-rw-r--r--chart2/source/view/main/ChartView.cxx23
-rw-r--r--filter/Library_placeware.mk1
-rw-r--r--filter/source/flash/swfexporter.cxx12
-rw-r--r--filter/source/flash/swfexporter.hxx11
-rw-r--r--filter/source/flash/swffilter.cxx16
-rw-r--r--filter/source/placeware/exporter.cxx11
-rw-r--r--filter/source/placeware/exporter.hxx12
-rw-r--r--filter/source/placeware/filter.cxx13
-rw-r--r--filter/source/svg/svgexport.cxx39
-rw-r--r--offapi/UnoApi_offapi.mk3
-rw-r--r--offapi/com/sun/star/drawing/GraphicExportFilter.idl51
-rw-r--r--offapi/com/sun/star/drawing/XGraphicExportFilter.idl85
-rw-r--r--offapi/type_reference/types.rdbbin7439872 -> 7439872 bytes
-rw-r--r--sd/source/filter/grf/sdgrffilter.cxx179
-rw-r--r--sd/source/filter/html/htmlex.cxx15
-rw-r--r--sd/source/ui/remotecontrol/ImagePreparer.cxx16
-rw-r--r--slideshow/source/engine/shapes/gdimtftools.cxx23
-rw-r--r--svtools/source/filter/SvFilterOptionsDialog.cxx9
-rw-r--r--svtools/source/filter/SvFilterOptionsDialog.hxx11
-rw-r--r--svtools/source/filter/exportdialog.cxx23
-rw-r--r--svtools/source/filter/exportdialog.hxx6
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx6
22 files changed, 274 insertions, 291 deletions
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 76993ada2140..859f1fde8d45 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -70,6 +70,8 @@
#include <time.h>
+#include <com/sun/star/awt/Size.hpp>
+#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/chart/ChartAxisPosition.hpp>
#include <com/sun/star/chart/DataLabelPlacement.hpp>
#include <com/sun/star/chart/MissingValueTreatment.hpp>
@@ -82,20 +84,18 @@
#include <com/sun/star/chart2/RelativePosition.hpp>
#include <com/sun/star/chart2/RelativeSize.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/drawing/GraphicExportFilter.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/drawing/XShapeGroup.hpp>
+#include <com/sun/star/drawing/XShapeDescriptor.hpp>
#include <com/sun/star/document/XExporter.hpp>
#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/io/XSeekable.hpp>
#include <com/sun/star/util/XModifiable.hpp>
#include <com/sun/star/util/XRefreshable.hpp>
#include <com/sun/star/util/NumberFormat.hpp>
-#include <com/sun/star/awt/Size.hpp>
-#include <com/sun/star/awt/Point.hpp>
-#include <com/sun/star/drawing/XShapeDescriptor.hpp>
-#include <com/sun/star/text/XText.hpp>
-
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
+#include <com/sun/star/text/XText.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
#include <com/sun/star/text/WritingMode2.hpp>
#include <com/sun/star/text/XTextEmbeddedObjectsSupplier.hpp>
@@ -242,17 +242,8 @@ void ChartView::getMetaFile( const uno::Reference< io::XOutputStream >& xOutStre
if( !m_xDrawPage.is() )
return;
- uno::Reference< lang::XMultiServiceFactory > xFactory( m_xCC->getServiceManager(), uno::UNO_QUERY );
- if( !xFactory.is() )
- return;
-
// creating the graphic exporter
- uno::Reference< document::XExporter > xExporter( xFactory->createInstance(
- "com.sun.star.drawing.GraphicExportFilter"), uno::UNO_QUERY);
- uno::Reference< document::XFilter > xFilter( xExporter, uno::UNO_QUERY );
-
- if( !xExporter.is() || !xFilter.is() )
- return;
+ uno::Reference< drawing::XGraphicExportFilter > xExporter = drawing::GraphicExportFilter::create( m_xCC );
uno::Sequence< beans::PropertyValue > aProps(3);
aProps[0].Name = "FilterName";
@@ -291,7 +282,7 @@ void ChartView::getMetaFile( const uno::Reference< io::XOutputStream >& xOutStre
aProps[2].Value <<= aFilterData;
xExporter->setSourceDocument( uno::Reference< lang::XComponent >( m_xDrawPage, uno::UNO_QUERY) );
- if( xFilter->filter( aProps ) )
+ if( xExporter->filter( aProps ) )
{
xOutStream->flush();
xOutStream->closeOutput();
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;
}
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 0860f7d682d7..45e2766dd321 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -114,6 +114,7 @@ $(eval $(call gb_ZipUnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/documen
XMLOasisBasicImporter \
))
$(eval $(call gb_ZipUnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/drawing,\
+ GraphicExportFilter \
ModuleDispatcher \
ShapeCollection \
SlideRenderer \
@@ -731,7 +732,6 @@ $(eval $(call gb_ZipUnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/draw
GenericDrawPage \
GenericDrawingDocument \
GradientTable \
- GraphicExportFilter \
GraphicObjectShape \
GroupShape \
HatchTable \
@@ -2285,6 +2285,7 @@ $(eval $(call gb_ZipUnoApi_add_idlfiles,offapi,offapi/com/sun/star/drawing,\
XDrawView \
XEnhancedCustomShapeDefaulter \
XGluePointsSupplier \
+ XGraphicExportFilter \
XLayer \
XLayerManager \
XLayerSupplier \
diff --git a/offapi/com/sun/star/drawing/GraphicExportFilter.idl b/offapi/com/sun/star/drawing/GraphicExportFilter.idl
index 04d8270bae2b..33899e791287 100644
--- a/offapi/com/sun/star/drawing/GraphicExportFilter.idl
+++ b/offapi/com/sun/star/drawing/GraphicExportFilter.idl
@@ -19,9 +19,7 @@
#ifndef __com_sun_star_drawing_GraphicExportFilter_idl__
#define __com_sun_star_drawing_GraphicExportFilter_idl__
-#include <com/sun/star/document/XFilter.idl>
-#include <com/sun/star/document/XExporter.idl>
-#include <com/sun/star/document/XMimeTypeInfo.idl>
+#include <com/sun/star/drawing/XGraphicExportFilter.idl>
module com { module sun { module star { module drawing {
@@ -31,52 +29,7 @@
groups of shapes from a DrawingDocument to a file in one of the file formats
supported by the component.
*/
-published service GraphicExportFilter
-{
- /** calling <method scope=scope="com::sun::star::document">XFilter::filter
- </method> starts the export of the graphic file. The following properties
- from the <type scope="com::sun::star::document">MediaDescriptor
- </type> are supported:<p>
-
- <member scope="com::sun::star::document">MediaDescriptor::MediaType
- </member><b>
-
- Depending on the export filters supported by this component this is
- the mime type of the target graphic file. Possible values are<b>
- image/x-MS-bmp<b>
- application/dxf<b>
- application/postscript<b>
- image/gif<b>
- image/jpeg<b>
- image/png<b>
- image/x-pict<b>
- image/x-pcx<b>
- image/x-portable-bitmap<b>
- image/x-portable-graymap<b>
- image/x-portable-pixmap<b>
- image/x-cmu-raster<b>
- image/targa<b>
- image/tiff<b>
- image/x-xbitmap<b>
- image/x-xpixmap<b>
- image/svg+xml<p>
- Ask the interface <type scope="com::sun::star::document">XMimeTypeInfo
- </type> for all values supported by the component.
-
- <member scope="com::sun::star::document">MediaDescriptor::URL</member><b>
- This is the target url of the file that will be created during export.
- */
- interface ::com::sun::star::document::XFilter;
-
- /** sets the source component for this export filter.
- This could either be a <type>DrawPage</type>, a <type>Shape</type>
- or a <type>Shapes</type>.
- */
- interface ::com::sun::star::document::XExporter;
-
- /** lets you query the supported mime types by this component */
- interface ::com::sun::star::document::XMimeTypeInfo;
-};
+published service GraphicExportFilter : XGraphicExportFilter;
}; }; }; };
diff --git a/offapi/com/sun/star/drawing/XGraphicExportFilter.idl b/offapi/com/sun/star/drawing/XGraphicExportFilter.idl
new file mode 100644
index 000000000000..6582def8063f
--- /dev/null
+++ b/offapi/com/sun/star/drawing/XGraphicExportFilter.idl
@@ -0,0 +1,85 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef __com_sun_star_drawing_XGraphicExportFilter_idl__
+#define __com_sun_star_drawing_XGraphicExportFilter_idl__
+
+#include <com/sun/star/document/XFilter.idl>
+#include <com/sun/star/document/XExporter.idl>
+#include <com/sun/star/document/XMimeTypeInfo.idl>
+
+
+ module com { module sun { module star { module drawing {
+
+
+/**
+ @since LibreOffcei 4.1
+*/
+published interface XGraphicExportFilter
+{
+ /** calling <method scope=scope="com::sun::star::document">XFilter::filter
+ </method> starts the export of the graphic file. The following properties
+ from the <type scope="com::sun::star::document">MediaDescriptor
+ </type> are supported:<p>
+
+ <member scope="com::sun::star::document">MediaDescriptor::MediaType
+ </member><b>
+
+ Depending on the export filters supported by this component this is
+ the mime type of the target graphic file. Possible values are<b>
+ image/x-MS-bmp<b>
+ application/dxf<b>
+ application/postscript<b>
+ image/gif<b>
+ image/jpeg<b>
+ image/png<b>
+ image/x-pict<b>
+ image/x-pcx<b>
+ image/x-portable-bitmap<b>
+ image/x-portable-graymap<b>
+ image/x-portable-pixmap<b>
+ image/x-cmu-raster<b>
+ image/targa<b>
+ image/tiff<b>
+ image/x-xbitmap<b>
+ image/x-xpixmap<b>
+ image/svg+xml<p>
+ Ask the interface <type scope="com::sun::star::document">XMimeTypeInfo
+ </type> for all values supported by the component.
+
+ <member scope="com::sun::star::document">MediaDescriptor::URL</member><b>
+ This is the target url of the file that will be created during export.
+ */
+ interface ::com::sun::star::document::XFilter;
+
+ /** sets the source component for this export filter.
+ This could either be a <type>DrawPage</type>, a <type>Shape</type>
+ or a <type>Shapes</type>.
+ */
+ interface ::com::sun::star::document::XExporter;
+
+ /** lets you query the supported mime types by this component */
+ interface ::com::sun::star::document::XMimeTypeInfo;
+};
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/type_reference/types.rdb b/offapi/type_reference/types.rdb
index fd52d36ff322..f3483965dc05 100644
--- a/offapi/type_reference/types.rdb
+++ b/offapi/type_reference/types.rdb
Binary files differ
diff --git a/sd/source/filter/grf/sdgrffilter.cxx b/sd/source/filter/grf/sdgrffilter.cxx
index 8a4ac2f07197..e8df14893f61 100644
--- a/sd/source/filter/grf/sdgrffilter.cxx
+++ b/sd/source/filter/grf/sdgrffilter.cxx
@@ -21,6 +21,7 @@
#ifdef _MSC_VER
#pragma warning (disable:4190)
#endif
+#include <com/sun/star/drawing/GraphicExportFilter.hpp>
#include <com/sun/star/graphic/GraphicProvider.hpp>
#include <com/sun/star/graphic/XGraphicProvider.hpp>
#include <com/sun/star/graphic/GraphicType.hpp>
@@ -255,112 +256,100 @@ sal_Bool SdGRFFilter::Export()
sal_Bool bRet = sal_False;
- uno::Reference< lang::XMultiServiceFactory >
- xSMgr( ::comphelper::getProcessServiceFactory() );
- uno::Reference< uno::XInterface > xComponent
- ( xSMgr->createInstance( "com.sun.star.drawing.GraphicExportFilter" ),
- uno::UNO_QUERY );
- if ( xComponent.is() )
- {
- uno::Reference< document::XExporter > xExporter
- ( xComponent, uno::UNO_QUERY );
- uno::Reference< document::XFilter > xFilter
- ( xComponent, uno::UNO_QUERY );
- if ( xExporter.is() && xFilter.is() )
- {
- SdPage* pPage = NULL;
- sd::DrawViewShell* pDrawViewShell = static_cast< ::sd::DrawViewShell* >
- ( ( ( mrDocShell.GetViewShell() && mrDocShell.GetViewShell()->ISA(::sd::DrawViewShell ) ) ? mrDocShell.GetViewShell() : NULL ) );
+ uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+ uno::Reference< drawing::XGraphicExportFilter > xExporter = drawing::GraphicExportFilter::create( xContext );
- PageKind ePageKind = PK_STANDARD;
- if( pDrawViewShell )
- {
- ePageKind = pDrawViewShell->GetPageKind();
- if( PK_HANDOUT == ePageKind )
- pPage = mrDocument.GetSdPage( 0, PK_HANDOUT );
- else
- pPage = pDrawViewShell->GetActualPage();
- }
- else
- pPage = mrDocument.GetSdPage( 0, PK_STANDARD );
+ SdPage* pPage = NULL;
+ sd::DrawViewShell* pDrawViewShell = static_cast< ::sd::DrawViewShell* >
+ ( ( ( mrDocShell.GetViewShell() && mrDocShell.GetViewShell()->ISA(::sd::DrawViewShell ) ) ? mrDocShell.GetViewShell() : NULL ) );
+
+ PageKind ePageKind = PK_STANDARD;
+ if( pDrawViewShell )
+ {
+ ePageKind = pDrawViewShell->GetPageKind();
+ if( PK_HANDOUT == ePageKind )
+ pPage = mrDocument.GetSdPage( 0, PK_HANDOUT );
+ else
+ pPage = pDrawViewShell->GetActualPage();
+ }
+ else
+ pPage = mrDocument.GetSdPage( 0, PK_STANDARD );
- if ( pPage )
+ if ( pPage )
+ {
+ // taking the 'correct' page number, seems that there might exist a better method to archive this
+ pPage = mrDocument.GetSdPage( pPage->GetPageNum() ? ( pPage->GetPageNum() - 1 ) >> 1 : 0, ePageKind );
+ if ( pPage )
+ {
+ uno::Reference< lang::XComponent > xSource( pPage->getUnoPage(), uno::UNO_QUERY );
+ SfxItemSet* pSet = mrMedium.GetItemSet();
+ if ( pSet && xSource.is() )
{
- // taking the 'correct' page number, seems that there might exist a better method to archive this
- pPage = mrDocument.GetSdPage( pPage->GetPageNum() ? ( pPage->GetPageNum() - 1 ) >> 1 : 0, ePageKind );
- if ( pPage )
+ const String aTypeName( mrMedium.GetFilter()->GetTypeName() );
+ GraphicFilter &rGraphicFilter = GraphicFilter::GetGraphicFilter();
+ const sal_uInt16 nFilter = rGraphicFilter.GetExportFormatNumberForTypeName( aTypeName );
+ if ( nFilter != GRFILTER_FORMAT_NOTFOUND )
{
- uno::Reference< lang::XComponent > xSource( pPage->getUnoPage(), uno::UNO_QUERY );
- SfxItemSet* pSet = mrMedium.GetItemSet();
- if ( pSet && xSource.is() )
- {
- const String aTypeName( mrMedium.GetFilter()->GetTypeName() );
- GraphicFilter &rGraphicFilter = GraphicFilter::GetGraphicFilter();
- const sal_uInt16 nFilter = rGraphicFilter.GetExportFormatNumberForTypeName( aTypeName );
- if ( nFilter != GRFILTER_FORMAT_NOTFOUND )
- {
- uno::Reference< task::XInteractionHandler > mXInteractionHandler;
+ uno::Reference< task::XInteractionHandler > mXInteractionHandler;
- beans::PropertyValues aArgs;
- TransformItems( SID_SAVEASDOC, *pSet, aArgs );
+ beans::PropertyValues aArgs;
+ TransformItems( SID_SAVEASDOC, *pSet, aArgs );
- rtl::OUString sInteractionHandler( "InteractionHandler" );
- rtl::OUString sFilterName( "FilterName" );
- rtl::OUString sShortName( rGraphicFilter.GetExportFormatShortName( nFilter ) );
+ rtl::OUString sInteractionHandler( "InteractionHandler" );
+ rtl::OUString sFilterName( "FilterName" );
+ rtl::OUString sShortName( rGraphicFilter.GetExportFormatShortName( nFilter ) );
- sal_Bool bFilterNameFound = sal_False;
- sal_Int32 i, nCount;
- for ( i = 0, nCount = aArgs.getLength(); i < nCount; i++ )
- {
- rtl::OUString& rStr = aArgs[ i ].Name;
- if ( rStr == sFilterName )
- {
- bFilterNameFound = sal_True;
- aArgs[ i ].Name = sFilterName;
- aArgs[ i ].Value <<= sShortName;
- }
- else if ( rStr == sInteractionHandler )
- {
- uno::Reference< task::XInteractionHandler > xHdl;
- if ( aArgs[ i ].Value >>= xHdl )
- {
- mXInteractionHandler = new SdGRFFilter_ImplInteractionHdl( xHdl );
- aArgs[ i ].Value <<= mXInteractionHandler;
- }
- }
- }
- if ( !bFilterNameFound )
- {
- aArgs.realloc( ++nCount );
- aArgs[ i ].Name = sFilterName;
- aArgs[ i ].Value <<= sShortName;
- }
-
- // take selection if needed
- if( ( SFX_ITEM_SET == pSet->GetItemState( SID_SELECTION ) )
- && static_cast< const SfxBoolItem& >( pSet->Get( SID_SELECTION ) ).GetValue()
- && pDrawViewShell )
+ sal_Bool bFilterNameFound = sal_False;
+ sal_Int32 i, nCount;
+ for ( i = 0, nCount = aArgs.getLength(); i < nCount; i++ )
+ {
+ rtl::OUString& rStr = aArgs[ i ].Name;
+ if ( rStr == sFilterName )
+ {
+ bFilterNameFound = sal_True;
+ aArgs[ i ].Name = sFilterName;
+ aArgs[ i ].Value <<= sShortName;
+ }
+ else if ( rStr == sInteractionHandler )
+ {
+ uno::Reference< task::XInteractionHandler > xHdl;
+ if ( aArgs[ i ].Value >>= xHdl )
{
- uno::Reference< view::XSelectionSupplier > xSelectionSupplier(
- pDrawViewShell->GetViewShellBase().GetController(), uno::UNO_QUERY );
- if ( xSelectionSupplier.is() )
- {
- uno::Any aSelection( xSelectionSupplier->getSelection() );
- uno::Reference< lang::XComponent > xSelection;
- if ( aSelection >>= xSelection )
- xSource = xSelection;
- }
+ mXInteractionHandler = new SdGRFFilter_ImplInteractionHdl( xHdl );
+ aArgs[ i ].Value <<= mXInteractionHandler;
}
- xExporter->setSourceDocument( xSource );
- bRet = xFilter->filter( aArgs );
- if ( !bRet && mXInteractionHandler.is() )
- SdGRFFilter::HandleGraphicFilterError(
- static_cast< SdGRFFilter_ImplInteractionHdl* >( mXInteractionHandler.get() )->GetErrorCode(),
- rGraphicFilter.GetLastError().nStreamError );
}
- }
+ }
+ if ( !bFilterNameFound )
+ {
+ aArgs.realloc( ++nCount );
+ aArgs[ i ].Name = sFilterName;
+ aArgs[ i ].Value <<= sShortName;
+ }
+
+ // take selection if needed
+ if( ( SFX_ITEM_SET == pSet->GetItemState( SID_SELECTION ) )
+ && static_cast< const SfxBoolItem& >( pSet->Get( SID_SELECTION ) ).GetValue()
+ && pDrawViewShell )
+ {
+ uno::Reference< view::XSelectionSupplier > xSelectionSupplier(
+ pDrawViewShell->GetViewShellBase().GetController(), uno::UNO_QUERY );
+ if ( xSelectionSupplier.is() )
+ {
+ uno::Any aSelection( xSelectionSupplier->getSelection() );
+ uno::Reference< lang::XComponent > xSelection;
+ if ( aSelection >>= xSelection )
+ xSource = xSelection;
+ }
+ }
+ xExporter->setSourceDocument( xSource );
+ bRet = xExporter->filter( aArgs );
+ if ( !bRet && mXInteractionHandler.is() )
+ SdGRFFilter::HandleGraphicFilterError(
+ static_cast< SdGRFFilter_ImplInteractionHdl* >( mXInteractionHandler.get() )->GetErrorCode(),
+ rGraphicFilter.GetLastError().nStreamError );
}
- }
+ }
}
}
return bRet;
diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx
index 92690d0ccb57..c05ed5d2d79c 100644
--- a/sd/source/filter/html/htmlex.cxx
+++ b/sd/source/filter/html/htmlex.cxx
@@ -20,8 +20,8 @@
#include "htmlex.hxx"
#include <com/sun/star/document/XExporter.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/drawing/GraphicExportFilter.hpp>
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
#include <rtl/uri.hxx>
@@ -966,16 +966,9 @@ bool HtmlExport::CreateImagesForPresPages( bool bThumbnail)
{
try
{
- Reference < XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory() );
- if( !xMSF.is() )
- return false;
-
- Reference< XExporter > xGraphicExporter( xMSF->createInstance( "com.sun.star.drawing.GraphicExportFilter" ), UNO_QUERY );
- Reference< XFilter > xFilter( xGraphicExporter, UNO_QUERY );
+ Reference < XComponentContext > xContext = ::comphelper::getProcessComponentContext();
- DBG_ASSERT( xFilter.is(), "no com.sun.star.drawing.GraphicExportFilter?" );
- if( !xFilter.is() )
- return false;
+ Reference< drawing::XGraphicExportFilter > xGraphicExporter = drawing::GraphicExportFilter::create( xContext );
Sequence< PropertyValue > aFilterData(((meFormat==FORMAT_JPG)&&(mnCompression != -1))? 3 : 2);
aFilterData[0].Name = "PixelWidth";
@@ -1018,7 +1011,7 @@ bool HtmlExport::CreateImagesForPresPages( bool bThumbnail)
Reference< XComponent > xPage( pPage->getUnoPage(), UNO_QUERY );
xGraphicExporter->setSourceDocument( xPage );
- xFilter->filter( aDescriptor );
+ xGraphicExporter->filter( aDescriptor );
if (mpProgress)
mpProgress->SetState(++mnPagesWritten);
diff --git a/sd/source/ui/remotecontrol/ImagePreparer.cxx b/sd/source/ui/remotecontrol/ImagePreparer.cxx
index 2c6ca5bce558..e9f9c22d9099 100644
--- a/sd/source/ui/remotecontrol/ImagePreparer.cxx
+++ b/sd/source/ui/remotecontrol/ImagePreparer.cxx
@@ -34,6 +34,7 @@
#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/document/XImporter.hpp>
#include <com/sun/star/document/XExporter.hpp>
+#include <com/sun/star/drawing/GraphicExportFilter.hpp>
#include <com/sun/star/lang/XServiceName.hpp>
#include <com/sun/star/presentation/XPresentationPage.hpp>
#include <com/sun/star/text/XTextRange.hpp>
@@ -113,17 +114,8 @@ uno::Sequence<sal_Int8> ImagePreparer::preparePreview(
OUString aFileURL;
FileBase::createTempFile( 0, 0, &aFileURL );
- uno::Reference< lang::XMultiServiceFactory > xServiceManager(
- ::comphelper::getProcessServiceFactory(),
- uno::UNO_QUERY_THROW );
-
- uno::Reference< document::XFilter > xFilter(
- xServiceManager->createInstance(
- "com.sun.star.drawing.GraphicExportFilter" ) ,
- uno::UNO_QUERY_THROW );
-
- uno::Reference< document::XExporter > xExporter( xFilter,
- uno::UNO_QUERY_THROW );
+ uno::Reference< drawing::XGraphicExportFilter > xFilter =
+ drawing::GraphicExportFilter::create( ::comphelper::getProcessComponentContext() );
if ( !xController->isRunning() )
return uno::Sequence<sal_Int8>();
@@ -132,7 +124,7 @@ uno::Sequence<sal_Int8> ImagePreparer::preparePreview(
xController->getSlideByIndex( aSlideNumber ),
uno::UNO_QUERY_THROW );
- xExporter->setSourceDocument( xSourceDoc );
+ xFilter->setSourceDocument( xSourceDoc );
uno::Sequence< beans::PropertyValue > aFilterData(3);
diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx b/slideshow/source/engine/shapes/gdimtftools.cxx
index fe63c0bcfead..83eff701e6eb 100644
--- a/slideshow/source/engine/shapes/gdimtftools.cxx
+++ b/slideshow/source/engine/shapes/gdimtftools.cxx
@@ -28,6 +28,7 @@
#include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/graphic/XGraphicRenderer.hpp>
#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/drawing/GraphicExportFilter.hpp>
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/compbase1.hxx>
@@ -187,25 +188,9 @@ bool getMetaFile( const uno::Reference< lang::XComponent >& xSource,
DummyRenderer* pRenderer( new DummyRenderer() );
uno::Reference< graphic::XGraphicRenderer > xRenderer( pRenderer );
- // -> stuff that into UnoGraphicExporter.
- uno::Reference<lang::XMultiComponentFactory> xFactory(
- rxContext->getServiceManager() );
-
- OSL_ENSURE( xFactory.is(), "### no UNO?!" );
- if( !xFactory.is() )
- return false;
-
// creating the graphic exporter
- uno::Reference< document::XExporter > xExporter(
- xFactory->createInstanceWithContext(
- "com.sun.star.drawing.GraphicExportFilter",
- rxContext),
- uno::UNO_QUERY );
- uno::Reference< document::XFilter > xFilter( xExporter, uno::UNO_QUERY );
-
- OSL_ENSURE( xExporter.is() && xFilter.is(), "### no graphic exporter?!" );
- if( !xExporter.is() || !xFilter.is() )
- return false;
+ uno::Reference< drawing::XGraphicExportFilter > xExporter =
+ drawing::GraphicExportFilter::create(rxContext);
uno::Sequence< beans::PropertyValue > aProps(3);
aProps[0].Name = "FilterName";
@@ -232,7 +217,7 @@ bool getMetaFile( const uno::Reference< lang::XComponent >& xSource,
aProps[2].Value <<= aFilterData;
xExporter->setSourceDocument( xSource );
- if( !xFilter->filter( aProps ) )
+ if( !xExporter->filter( aProps ) )
return false;
rMtf = pRenderer->getMtf( (mtfLoadFlags & MTF_LOAD_FOREIGN_SOURCE) != 0 );
diff --git a/svtools/source/filter/SvFilterOptionsDialog.cxx b/svtools/source/filter/SvFilterOptionsDialog.cxx
index e17dfb8bdf1d..4f81901dd511 100644
--- a/svtools/source/filter/SvFilterOptionsDialog.cxx
+++ b/svtools/source/filter/SvFilterOptionsDialog.cxx
@@ -34,6 +34,7 @@
#include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/uno/Any.h>
#include <unotools/syslocale.hxx>
+#include <comphelper/processfactory.hxx>
#include "vcl/svapp.hxx"
using namespace ::rtl;
@@ -47,7 +48,7 @@ uno::Reference< uno::XInterface >
SAL_CALL SvFilterOptionsDialog_CreateInstance(
const uno::Reference< lang::XMultiServiceFactory > & _rxFactory )
{
- return static_cast< ::cppu::OWeakObject* > ( new SvFilterOptionsDialog( _rxFactory ) );
+ return static_cast< ::cppu::OWeakObject* > ( new SvFilterOptionsDialog( comphelper::getComponentContext(_rxFactory) ) );
}
OUString SvFilterOptionsDialog_getImplementationName()
@@ -74,8 +75,8 @@ uno::Sequence< OUString > SAL_CALL SvFilterOptionsDialog_getSupportedServiceName
// -----------------------------------------------------------------------------
-SvFilterOptionsDialog::SvFilterOptionsDialog( const uno::Reference< lang::XMultiServiceFactory > xMgr ) :
- mxMgr ( xMgr ),
+SvFilterOptionsDialog::SvFilterOptionsDialog( const uno::Reference< uno::XComponentContext >& rxContext ) :
+ mxContext ( rxContext ),
meFieldUnit ( FUNIT_CM ),
mbExportSelection ( sal_False )
{
@@ -214,7 +215,7 @@ sal_Int16 SvFilterOptionsDialog::execute()
aFltCallDlgPara.aFilterExt = aGraphicFilter.GetExportFormatShortName( nFormat );
sal_Bool bIsPixelFormat( aGraphicFilter.IsExportPixelFormat( nFormat ) );
- if ( ExportDialog( aFltCallDlgPara, mxMgr, mxSourceDocument, mbExportSelection, bIsPixelFormat ).Execute() == RET_OK )
+ if ( ExportDialog( aFltCallDlgPara, mxContext, mxSourceDocument, mbExportSelection, bIsPixelFormat ).Execute() == RET_OK )
nRet = ui::dialogs::ExecutableDialogResults::OK;
delete pResMgr;
diff --git a/svtools/source/filter/SvFilterOptionsDialog.hxx b/svtools/source/filter/SvFilterOptionsDialog.hxx
index 918d0a94597c..3bbc3cff35b0 100644
--- a/svtools/source/filter/SvFilterOptionsDialog.hxx
+++ b/svtools/source/filter/SvFilterOptionsDialog.hxx
@@ -22,12 +22,13 @@
#include <tools/fldunit.hxx>
#include <cppuhelper/implbase5.hxx>
+#include <com/sun/star/beans/XPropertyAccess.hpp>
+#include <com/sun/star/document/XExporter.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/beans/XPropertyAccess.hpp>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-#include <com/sun/star/document/XExporter.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
class SvFilterOptionsDialog : public cppu::WeakImplHelper5
<
@@ -38,8 +39,8 @@ class SvFilterOptionsDialog : public cppu::WeakImplHelper5
com::sun::star::lang::XServiceInfo
>
{
- const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
- mxMgr;
+ const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ mxContext;
com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
maMediaDescriptor;
com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
@@ -53,7 +54,7 @@ class SvFilterOptionsDialog : public cppu::WeakImplHelper5
public:
- SvFilterOptionsDialog( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > _rxORB );
+ SvFilterOptionsDialog( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB );
~SvFilterOptionsDialog();
// XInterface
diff --git a/svtools/source/filter/exportdialog.cxx b/svtools/source/filter/exportdialog.cxx
index 384057d10e7b..b7c30adcc100 100644
--- a/svtools/source/filter/exportdialog.cxx
+++ b/svtools/source/filter/exportdialog.cxx
@@ -27,17 +27,15 @@
#include <vcl/FilterConfigItem.hxx>
#include <svtools/svtools.hrc>
#include <svtools/svtresid.hxx>
-#include <com/sun/star/io/XStream.hpp>
#include <com/sun/star/awt/Size.hpp>
-#include <com/sun/star/view/XSelectionSupplier.hpp>
+#include <com/sun/star/drawing/GraphicExportFilter.hpp>
+#include <com/sun/star/drawing/XDrawView.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/frame/XController.hpp>
-#include <com/sun/star/drawing/XDrawView.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/graphic/PrimitiveFactory2D.hpp>
#include <com/sun/star/geometry/AffineMatrix2D.hpp>
-#include <com/sun/star/document/XExporter.hpp>
-#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/io/XStream.hpp>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <unotools/streamwrap.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx>
@@ -358,7 +356,7 @@ awt::Size ExportDialog::GetOriginalSize()
}
else
{
- uno::Reference< graphic::XPrimitiveFactory2D > xPrimitiveFactory = graphic::PrimitiveFactory2D::create( comphelper::getComponentContext(mxMgr) );
+ uno::Reference< graphic::XPrimitiveFactory2D > xPrimitiveFactory = graphic::PrimitiveFactory2D::create( mxContext );
basegfx::B2DHomMatrix aViewTransformation( Application::GetDefaultDevice()->GetViewTransformation() );
com::sun::star::geometry::AffineMatrix2D aTransformation;
@@ -457,9 +455,8 @@ sal_Bool ExportDialog::GetGraphicStream()
uno::Reference < io::XStream > xStream( new utl::OStreamWrapper( *mpTempStream ) );
uno::Reference < io::XOutputStream > xOutputStream( xStream->getOutputStream() );
- uno::Reference< document::XExporter > xGraphicExporter(
- mxMgr->createInstance(OUString("com.sun.star.drawing.GraphicExportFilter")), uno::UNO_QUERY_THROW);
- uno::Reference< document::XFilter > xFilter( xGraphicExporter, uno::UNO_QUERY_THROW );
+ uno::Reference< drawing::XGraphicExportFilter > xGraphicExporter =
+ drawing::GraphicExportFilter::create( mxContext );
sal_Int32 nProperties = 2;
uno::Sequence< beans::PropertyValue > aFilterData( nProperties );
@@ -484,7 +481,7 @@ sal_Bool ExportDialog::GetGraphicStream()
if ( xSourceDoc.is() )
{
xGraphicExporter->setSourceDocument( xSourceDoc );
- xFilter->filter( aDescriptor );
+ xGraphicExporter->filter( aDescriptor );
bRet = sal_True;
if ( mnFormat == FORMAT_JPG )
@@ -561,12 +558,12 @@ sal_Bool ExportDialog::IsTempExportAvailable() const
}
ExportDialog::ExportDialog(FltCallDialogParameter& rPara,
- const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > rxMgr,
+ const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
const com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& rxSourceDocument,
sal_Bool bExportSelection, sal_Bool bIsPixelFormat)
: ModalDialog(rPara.pWindow, "GraphicExportDialog", "svt/ui/graphicexport.ui")
, mrFltCallPara(rPara)
- , mxMgr(rxMgr)
+ , mxContext(rxContext)
, mxSourceDocument(rxSourceDocument)
, mpSbCompression(NULL)
, mpNfCompression(NULL)
diff --git a/svtools/source/filter/exportdialog.hxx b/svtools/source/filter/exportdialog.hxx
index fd33a9dfaa77..389a72542ade 100644
--- a/svtools/source/filter/exportdialog.hxx
+++ b/svtools/source/filter/exportdialog.hxx
@@ -48,8 +48,8 @@ private:
FltCallDialogParameter& mrFltCallPara;
- const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
- mxMgr;
+ const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
+ mxContext;
const com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >&
mxSourceDocument;
@@ -175,7 +175,7 @@ private:
public:
ExportDialog( FltCallDialogParameter& rPara,
- const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > rxMgr,
+ const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
const com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& rxSourceDocument,
sal_Bool bExportSelection, sal_Bool bIsExportVectorFormat );
~ExportDialog();
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index c7ad4f6bc0f5..6062a357db5e 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -22,13 +22,11 @@
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/frame/XModel.hpp>
-#include <com/sun/star/document/XFilter.hpp>
-#include <com/sun/star/document/XExporter.hpp>
-#include <com/sun/star/document/XMimeTypeInfo.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <com/sun/star/drawing/XGraphicExportFilter.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/graphic/XGraphicRenderer.hpp>
#include <com/sun/star/task/XStatusIndicator.hpp>
@@ -141,7 +139,7 @@ namespace svx
@implements com.sun.star.drawing.GraphicExportFilter
*/
- class GraphicExporter : public WeakImplHelper4< XFilter, XExporter, XServiceInfo, XMimeTypeInfo >
+ class GraphicExporter : public WeakImplHelper2< XGraphicExportFilter, XServiceInfo >
{
public:
GraphicExporter();