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 /comphelper | |
parent | bd6b41bce491ac5a5f562652b7e32045cc22c35c (diff) |
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 'comphelper')
-rw-r--r-- | comphelper/inc/comphelper/ofopxmlhelper.hxx | 6 | ||||
-rw-r--r-- | comphelper/source/xml/ofopxmlhelper.cxx | 16 |
2 files changed, 11 insertions, 11 deletions
diff --git a/comphelper/inc/comphelper/ofopxmlhelper.hxx b/comphelper/inc/comphelper/ofopxmlhelper.hxx index 789abccd8e9f..e18d08f727ef 100644 --- a/comphelper/inc/comphelper/ofopxmlhelper.hxx +++ b/comphelper/inc/comphelper/ofopxmlhelper.hxx @@ -58,7 +58,7 @@ class COMPHELPER_DLLPUBLIC OFOPXMLHelper : public cppu::WeakImplHelper1 < com::s OFOPXMLHelper( sal_uInt16 nFormat ); // must not be created directly ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > GetParsingResult(); - static COMPHELPER_DLLPRIVATE ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > SAL_CALL ReadSequence_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream, const ::rtl::OUString& aStringID, sal_uInt16 nFormat, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory ) + static COMPHELPER_DLLPRIVATE ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > SAL_CALL ReadSequence_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream, const ::rtl::OUString& aStringID, sal_uInt16 nFormat, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext ) throw( ::com::sun::star::uno::Exception ); public: @@ -73,7 +73,7 @@ public: ReadRelationsInfoSequence( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream, const ::rtl::OUString aStreamName, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory ) + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext ) throw( ::com::sun::star::uno::Exception ); // returns sequence containing two entries of type sequence<StringPair> @@ -86,7 +86,7 @@ public: SAL_CALL ReadContentTypeSequence( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xInStream, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory ) + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xContext ) throw( ::com::sun::star::uno::Exception ); // writes sequence of elements, where each element is described by sequence of tags, diff --git a/comphelper/source/xml/ofopxmlhelper.cxx b/comphelper/source/xml/ofopxmlhelper.cxx index 8eb783d85732..739b27d1512d 100644 --- a/comphelper/source/xml/ofopxmlhelper.cxx +++ b/comphelper/source/xml/ofopxmlhelper.cxx @@ -21,7 +21,7 @@ #include <com/sun/star/beans/StringPair.hpp> #include <com/sun/star/lang/XMultiServiceFactory.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 <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> @@ -37,20 +37,20 @@ using namespace ::com::sun::star; namespace comphelper { // ----------------------------------- -uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OFOPXMLHelper::ReadRelationsInfoSequence( const uno::Reference< io::XInputStream >& xInStream, const ::rtl::OUString aStreamName, const uno::Reference< lang::XMultiServiceFactory > xFactory ) +uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OFOPXMLHelper::ReadRelationsInfoSequence( const uno::Reference< io::XInputStream >& xInStream, const ::rtl::OUString aStreamName, const uno::Reference< uno::XComponentContext > xContext ) throw( uno::Exception ) { ::rtl::OUString aStringID = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels/" ) ); aStringID += aStreamName; - return ReadSequence_Impl( xInStream, aStringID, RELATIONINFO_FORMAT, xFactory ); + return ReadSequence_Impl( xInStream, aStringID, RELATIONINFO_FORMAT, xContext ); } // ----------------------------------- -uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OFOPXMLHelper::ReadContentTypeSequence( const uno::Reference< io::XInputStream >& xInStream, const uno::Reference< lang::XMultiServiceFactory > xFactory ) +uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OFOPXMLHelper::ReadContentTypeSequence( const uno::Reference< io::XInputStream >& xInStream, const uno::Reference< uno::XComponentContext > xContext ) throw( uno::Exception ) { ::rtl::OUString aStringID = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "[Content_Types].xml" ) ); - return ReadSequence_Impl( xInStream, aStringID, CONTENTTYPE_FORMAT, xFactory ); + return ReadSequence_Impl( xInStream, aStringID, CONTENTTYPE_FORMAT, xContext ); } // ----------------------------------- @@ -186,15 +186,15 @@ void SAL_CALL OFOPXMLHelper::WriteContentSequence( const uno::Reference< io::XOu // ================================================================================== // ----------------------------------- -uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OFOPXMLHelper::ReadSequence_Impl( const uno::Reference< io::XInputStream >& xInStream, const ::rtl::OUString& aStringID, sal_uInt16 nFormat, const uno::Reference< lang::XMultiServiceFactory > xFactory ) +uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OFOPXMLHelper::ReadSequence_Impl( const uno::Reference< io::XInputStream >& xInStream, const ::rtl::OUString& aStringID, sal_uInt16 nFormat, const uno::Reference< uno::XComponentContext > xContext ) throw( uno::Exception ) { - if ( !xFactory.is() || !xInStream.is() || nFormat > FORMAT_MAX_ID ) + if ( !xContext.is() || !xInStream.is() || nFormat > FORMAT_MAX_ID ) throw uno::RuntimeException(); uno::Sequence< uno::Sequence< beans::StringPair > > aResult; - uno::Reference< xml::sax::XParser > xParser( xFactory->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.Parser" ) ) ), uno::UNO_QUERY_THROW ); + uno::Reference< xml::sax::XParser > xParser = xml::sax::Parser::create( xContext ); OFOPXMLHelper* pHelper = new OFOPXMLHelper( nFormat ); uno::Reference< xml::sax::XDocumentHandler > xHelper( static_cast< xml::sax::XDocumentHandler* >( pHelper ) ); |