diff options
author | Noel Grandin <noel@peralex.com> | 2012-10-03 13:30:43 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-10-04 16:29:53 +0200 |
commit | a20f9a410fdd3f776f870434bc39219d5fc64b40 (patch) | |
tree | 079278e5859c5782fbe9bfcc34302d09bd8dfadd /dbaccess | |
parent | bump to latest *binary* liberation fonts (diff) | |
download | core-a20f9a410fdd3f776f870434bc39219d5fc64b40.tar.gz core-a20f9a410fdd3f776f870434bc39219d5fc64b40.zip |
fdo#46808, Adapt xml::sax::XParser UNO service to new style
The xml.sax.Parser service already existed, it just did not have
a new-style service to create it.
Change-Id: I6f145a7504ff9e149c802f723991954a2801cbc9
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/recovery/storagexmlstream.cxx | 5 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlfilter.cxx | 23 |
2 files changed, 12 insertions, 16 deletions
diff --git a/dbaccess/source/core/recovery/storagexmlstream.cxx b/dbaccess/source/core/recovery/storagexmlstream.cxx index ad5dec9df070..14b76e7eedb1 100644 --- a/dbaccess/source/core/recovery/storagexmlstream.cxx +++ b/dbaccess/source/core/recovery/storagexmlstream.cxx @@ -22,7 +22,7 @@ #include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <com/sun/star/io/XActiveDataSource.hpp> -#include <com/sun/star/xml/sax/XParser.hpp> +#include <com/sun/star/xml/sax/Parser.hpp> #include <comphelper/componentcontext.hxx> #include <cppuhelper/implbase1.hxx> @@ -55,6 +55,7 @@ namespace dbaccess using ::com::sun::star::io::XStream; using ::com::sun::star::io::XOutputStream; using ::com::sun::star::io::XActiveDataSource; + using ::com::sun::star::xml::sax::Parser; using ::com::sun::star::xml::sax::XParser; using ::com::sun::star::xml::sax::InputSource; /** === end UNO using === **/ @@ -163,7 +164,7 @@ namespace dbaccess :StorageInputStream( i_rContext, i_rParentStorage, i_rStreamName ) ,m_pData( new StorageXMLInputStream_Data ) { - m_pData->xParser.set( i_rContext.createComponent( "com.sun.star.xml.sax.Parser" ), UNO_QUERY_THROW ); + m_pData->xParser.set( Parser::create(i_rContext.getUNOContext()) ); } //------------------------------------------------------------------------------------------------------------------ diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx index f25f7818d184..990e5ae4edaf 100644 --- a/dbaccess/source/filter/xml/xmlfilter.cxx +++ b/dbaccess/source/filter/xml/xmlfilter.cxx @@ -33,7 +33,7 @@ #include <xmloff/nmspmap.hxx> #include <rtl/logfile.hxx> #include <com/sun/star/xml/sax/InputSource.hpp> -#include <com/sun/star/xml/sax/XParser.hpp> +#include <com/sun/star/xml/sax/Parser.hpp> #include <xmloff/ProgressBarHelper.hxx> #include <sfx2/docfile.hxx> #include <com/sun/star/io/XInputStream.hpp> @@ -55,6 +55,7 @@ #include <toolkit/helper/vclunohelper.hxx> #include <tools/diagnose_ex.h> #include <osl/diagnose.h> +#include <comphelper/processfactory.hxx> #include <comphelper/namedvaluecollection.hxx> #include <comphelper/mimeconfighelper.hxx> #include <comphelper/documentconstants.hxx> @@ -213,12 +214,12 @@ namespace dbaxml sal_Int32 ReadThroughComponent( const uno::Reference<XInputStream>& xInputStream, const uno::Reference<XComponent>& xModelComponent, - const uno::Reference<XMultiServiceFactory> & rFactory, + const uno::Reference<XComponentContext> & rxContext, const uno::Reference< XDocumentHandler >& _xFilter ) { OSL_ENSURE(xInputStream.is(), "input stream missing"); OSL_ENSURE(xModelComponent.is(), "document missing"); - OSL_ENSURE(rFactory.is(), "factory missing"); + OSL_ENSURE(rxContext.is(), "factory missing"); RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "dbaxml", "oj", "ReadThroughComponent" ); @@ -227,13 +228,7 @@ sal_Int32 ReadThroughComponent( aParserInput.aInputStream = xInputStream; // get parser - uno::Reference< XParser > xParser( - rFactory->createInstance( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser"))), - UNO_QUERY ); - OSL_ENSURE( xParser.is(), "Can't create parser" ); - if( !xParser.is() ) - return 1; + uno::Reference< XParser > xParser = Parser::create(rxContext); RTL_LOGFILE_CONTEXT_TRACE( aLog, "parser created" ); // get filter @@ -294,7 +289,7 @@ sal_Int32 ReadThroughComponent( const uno::Reference<XComponent>& xModelComponent, const sal_Char* pStreamName, const sal_Char* pCompatibilityStreamName, - const uno::Reference<XMultiServiceFactory> & rFactory, + const uno::Reference<XComponentContext> & rxContext, const uno::Reference< XDocumentHandler >& _xFilter) { OSL_ENSURE( xStorage.is(), "Need storage!"); @@ -350,7 +345,7 @@ sal_Int32 ReadThroughComponent( // read from the stream return ReadThroughComponent( xInputStream ,xModelComponent - ,rFactory + ,rxContext ,_xFilter ); } @@ -462,7 +457,7 @@ sal_Bool ODBFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) ,xModel ,"settings.xml" ,"Settings.xml" - ,getServiceFactory() + ,comphelper::getComponentContext(getServiceFactory()) ,this ); @@ -471,7 +466,7 @@ sal_Bool ODBFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) ,xModel ,"content.xml" ,"Content.xml" - ,getServiceFactory() + ,comphelper::getComponentContext(getServiceFactory()) ,this ); |