From 71eb27376a92f61c91567f2bfc2a74dba7192aab Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 19 Dec 2013 13:35:28 +0100 Subject: css.xml.sax service ctor clean-up Change-Id: I556904861e93a145cfe65f61218926851e4e8eb0 --- oox/source/core/fastparser.cxx | 6 ++++-- oox/source/crypto/DocumentDecryption.cxx | 9 +++------ 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'oox') diff --git a/oox/source/core/fastparser.cxx b/oox/source/core/fastparser.cxx index 70e12a896098..af79760e0bfe 100644 --- a/oox/source/core/fastparser.cxx +++ b/oox/source/core/fastparser.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include + +#include #include "oox/core/fastparser.hxx" #include "oox/core/fasttokenhandler.hxx" @@ -72,8 +75,7 @@ FastParser::FastParser( const Reference< XComponentContext >& rxContext ) throw( mpParser(NULL) { // create a fast parser instance - Reference< XMultiComponentFactory > xFactory( rxContext->getServiceManager(), UNO_SET_THROW ); - mxParser.set( xFactory->createInstanceWithContext( "com.sun.star.xml.sax.FastParser", rxContext ), UNO_QUERY_THROW ); + mxParser = css::xml::sax::FastParser::create(rxContext); mpParser = dynamic_cast(mxParser.get()); // create the fast tokenhandler diff --git a/oox/source/crypto/DocumentDecryption.cxx b/oox/source/crypto/DocumentDecryption.cxx index 0e9013997d6e..6dee4de0adf2 100644 --- a/oox/source/crypto/DocumentDecryption.cxx +++ b/oox/source/crypto/DocumentDecryption.cxx @@ -18,6 +18,7 @@ #include #include #include +#include #include namespace oox { @@ -221,15 +222,11 @@ bool DocumentDecryption::readAgileEncryptionInfo(Reference< XInputStream >& xInp mEngine.reset(engine); AgileEncryptionInfo& info = engine->getInfo(); - Reference xFactory( mxContext->getServiceManager(), UNO_SET_THROW ); Reference xFastDocumentHandler( new AgileDocumentHandler(info) ); Reference xFastTokenHandler ( new AgileTokenHandler ); - Reference xParser; - xParser.set( xFactory->createInstanceWithContext( "com.sun.star.xml.sax.FastParser", mxContext ), UNO_QUERY_THROW ); - - if (!xParser.is()) - return false; + Reference xParser( + css::xml::sax::FastParser::create(mxContext)); xParser->setFastDocumentHandler( xFastDocumentHandler ); xParser->setTokenHandler( xFastTokenHandler ); -- cgit