diff options
author | Noel Grandin <noel@peralex.com> | 2012-05-29 17:17:28 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-06-06 10:01:22 +0200 |
commit | d08578912f2c9ef42d4349079422e25b951e544e (patch) | |
tree | d029b5a9110bcdc255e72ef9c98887f3f8521ea6 /odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.cxx | |
parent | Make setsdkenv_unix executable instead of configure.pl (diff) | |
download | core-d08578912f2c9ef42d4349079422e25b951e544e.tar.gz core-d08578912f2c9ef42d4349079422e25b951e544e.zip |
fdo#46808, Adapt UNO services to new style, Part 7, updating ::create
Update calls to factories to use new SimpleFileAccess::create method
Change-Id: Ie5b0696fe2228a9033b19969245a53c21a61aa14
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>, added some tweaks.
Diffstat (limited to 'odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.cxx')
-rw-r--r-- | odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.cxx b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.cxx index e26d7f6f5869..63c32c041aa0 100644 --- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.cxx +++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/filterdetect.cxx @@ -35,7 +35,6 @@ #include "filterdetect.hxx" #include <osl/diagnose.h> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/io/XActiveDataSource.hpp> #include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/io/XInputStream.hpp> @@ -54,7 +53,9 @@ #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/document/XExtendedFilterDetection.hpp> #include <com/sun/star/beans/PropertyState.hpp> -#include <com/sun/star/ucb/XSimpleFileAccess.hpp> +#include <com/sun/star/ucb/SimpleFileAccess.hpp> +#include <com/sun/star/ucb/XSimpleFileAccess2.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -97,9 +98,8 @@ OUString SAL_CALL FilterDetect::detect(Sequence< PropertyValue >& aArguments ) if (!xInStream.is()) { // open the stream if it was not suplied by the framework - Reference< XSimpleFileAccess > xSFI(mxMSF->createInstance( - OUString("com.sun.star.ucb.SimpleFileAccess")), UNO_QUERY); - if (sURL.getLength() > 0 && xSFI.is()) + Reference< XSimpleFileAccess2 > xSFI(SimpleFileAccess::create(mxContext)); + if (sURL.getLength() > 0) { try { @@ -231,10 +231,10 @@ Sequence< OUString > SAL_CALL FilterDetect_getSupportedServiceNames( ) #undef SERVICE_NAME1 #undef SERVICE_NAME2 -Reference< XInterface > SAL_CALL FilterDetect_createInstance( const Reference< XMultiServiceFactory > & rSMgr) +Reference< XInterface > SAL_CALL FilterDetect_createInstance( const Reference< XComponentContext > & rContext) throw( Exception ) { - return (cppu::OWeakObject*) new FilterDetect( rSMgr ); + return (cppu::OWeakObject*) new FilterDetect( rContext ); } // XServiceInfo |