diff options
author | Noel Grandin <noel@peralex.com> | 2012-05-26 13:53:19 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-06-04 16:57:55 +0200 |
commit | b3c76dee6d44d07eae404b8d7341e6c88e6c4429 (patch) | |
tree | c747dd5bddf94c3b4312c7b1861a5087e76e71d6 /sdext | |
parent | Improve error reporting (diff) | |
download | core-b3c76dee6d44d07eae404b8d7341e6c88e6c4429.tar.gz core-b3c76dee6d44d07eae404b8d7341e6c88e6c4429.zip |
fdo#46808, Adapt UNO services to new style, Part 7, updating ::create
Update calls to factories to use new ::create methods
Change-Id: I01d4417820f52718836c92faf3c2fae0dc96b30d
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>, added some tweaks.
Diffstat (limited to 'sdext')
-rw-r--r-- | sdext/Library_minimizer.mk | 1 | ||||
-rw-r--r-- | sdext/source/minimizer/impoptimizer.cxx | 6 | ||||
-rw-r--r-- | sdext/source/minimizer/informationdialog.cxx | 5 |
3 files changed, 8 insertions, 4 deletions
diff --git a/sdext/Library_minimizer.mk b/sdext/Library_minimizer.mk index 5c918c390b51..f19b54168af5 100644 --- a/sdext/Library_minimizer.mk +++ b/sdext/Library_minimizer.mk @@ -35,6 +35,7 @@ $(eval $(call gb_Library_use_api,SunPresentationMinimizer,\ )) $(eval $(call gb_Library_use_libraries,SunPresentationMinimizer,\ + comphelper \ cppu \ cppuhelper \ sal \ diff --git a/sdext/source/minimizer/impoptimizer.cxx b/sdext/source/minimizer/impoptimizer.cxx index befea53dc819..699dc34e09f7 100644 --- a/sdext/source/minimizer/impoptimizer.cxx +++ b/sdext/source/minimizer/impoptimizer.cxx @@ -47,6 +47,7 @@ #include <com/sun/star/frame/XStorable.hpp> #include <com/sun/star/frame/FrameSearchFlag.hpp> #include <com/sun/star/frame/XDispatchProvider.hpp> +#include <com/sun/star/graphic/GraphicProvider.hpp> #include <com/sun/star/graphic/XGraphicProvider.hpp> #include <unotools/configmgr.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> @@ -68,6 +69,7 @@ #include <com/sun/star/io/XSeekable.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> #include <com/sun/star/util/URL.hpp> +#include <comphelper/componentcontext.hxx> using namespace ::std; using namespace ::rtl; @@ -349,7 +351,7 @@ Reference< XGraphic > ImpCompressGraphic( const Reference< XComponentContext >& { Reference< XStream > xTempFile( rxMSF->getServiceManager()->createInstanceWithContext( OUString("com.sun.star.io.TempFile"), rxMSF ), UNO_QUERY_THROW ); Reference< XOutputStream > xOutputStream( xTempFile->getOutputStream() ); - Reference< XGraphicProvider > xGraphicProvider( rxMSF->getServiceManager()->createInstanceWithContext( OUString("com.sun.star.graphic.GraphicProvider"), rxMSF ), UNO_QUERY_THROW ); + Reference< XGraphicProvider > xGraphicProvider( GraphicProvider::create(comphelper::ComponentContext(rxMSF).getUNOContext()) ); ImpCompressGraphic( xGraphicProvider, xGraphic, xOutputStream, aDestMimeType, aLogicalSize, rGraphicSettings.mnJPEGQuality, rGraphicSettings.mnImageResolution, bRemoveCropArea, aGraphicCropLogic ); Reference< XInputStream > xInputStream( xTempFile->getInputStream() ); @@ -369,7 +371,7 @@ Reference< XGraphic > ImpCompressGraphic( const Reference< XComponentContext >& rtl::OUString aDestMimeType( aSourceMimeType ); Reference< XStream > xTempFile( rxMSF->getServiceManager()->createInstanceWithContext( OUString("com.sun.star.io.TempFile"), rxMSF ), UNO_QUERY_THROW ); Reference< XOutputStream > xOutputStream( xTempFile->getOutputStream() ); - Reference< XGraphicProvider > xGraphicProvider( rxMSF->getServiceManager()->createInstanceWithContext( OUString("com.sun.star.graphic.GraphicProvider"), rxMSF ), UNO_QUERY_THROW ); + Reference< XGraphicProvider > xGraphicProvider( GraphicProvider::create( ::comphelper::ComponentContext(rxMSF).getUNOContext() ) ); ImpCompressGraphic( xGraphicProvider, xGraphic, xOutputStream, aDestMimeType, aLogicalSize, rGraphicSettings.mnJPEGQuality, rGraphicSettings.mnImageResolution, sal_False, aGraphicCropLogic ); Reference< XInputStream > xInputStream( xTempFile->getInputStream() ); Reference< XSeekable > xSeekable( xInputStream, UNO_QUERY_THROW ); diff --git a/sdext/source/minimizer/informationdialog.cxx b/sdext/source/minimizer/informationdialog.cxx index 29b6dbeb345e..7f510b657fd9 100644 --- a/sdext/source/minimizer/informationdialog.cxx +++ b/sdext/source/minimizer/informationdialog.cxx @@ -30,12 +30,14 @@ #include "informationdialog.hxx" #include "optimizationstats.hxx" #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp> +#include <com/sun/star/graphic/GraphicProvider.hpp> #include <com/sun/star/graphic/XGraphicProvider.hpp> #include <com/sun/star/graphic/XGraphic.hpp> #include <rtl/ustrbuf.hxx> #include <sal/macros.h> #include "com/sun/star/util/URL.hpp" #include "com/sun/star/util/XURLTransformer.hpp" +#include <comphelper/componentcontext.hxx> #define DIALOG_WIDTH 240 #define DIALOG_HEIGHT 80 @@ -218,8 +220,7 @@ OUString InformationDialog::ImpGetStandardImage( const OUString& sPrivateURL ) Reference< XOutputStream > xOutputStream( mxTempFile->getOutputStream() ); if ( xOutputStream.is() && xPropSet.is() ) { - Reference< graphic::XGraphicProvider > xGraphicProvider( mxMSF->getServiceManager()->createInstanceWithContext( - OUString("com.sun.star.graphic.GraphicProvider"), mxMSF ), UNO_QUERY_THROW ); + Reference< graphic::XGraphicProvider > xGraphicProvider( graphic::GraphicProvider::create( ::comphelper::ComponentContext(mxMSF).getUNOContext() ) ); Sequence< PropertyValue > aArgs( 1 ); aArgs[ 0 ].Name = OUString("URL"); aArgs[ 0 ].Value <<= sPrivateURL; |