diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-10-01 18:45:23 +0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-10-23 13:24:26 +0200 |
commit | eb8e7a76328408bc12ff4abb761d7f44c27bf402 (patch) | |
tree | c8722533ef44230f3f26f5fa7cbb1d1132f17d6a /sax/source/tools/fastserializer.cxx | |
parent | 865fc150ea61b49dc28a56f287096efae0621163 (diff) |
FastSerializer: Simplify a bit
Change-Id: I7dee908f5441ad34128d688e1008fd6ffad2ab3f
Diffstat (limited to 'sax/source/tools/fastserializer.cxx')
-rw-r--r-- | sax/source/tools/fastserializer.cxx | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx index 8ea04d285b1e..7afdc4d53cda 100644 --- a/sax/source/tools/fastserializer.cxx +++ b/sax/source/tools/fastserializer.cxx @@ -19,7 +19,9 @@ #include "fastserializer.hxx" +#include <com/sun/star/xml/sax/FastTokenHandler.hpp> #include <rtl/ustrbuf.hxx> +#include <comphelper/processfactory.hxx> #include <comphelper/sequenceasvector.hxx> #include <string.h> @@ -52,11 +54,14 @@ static const char sSpace[] = " "; static const char sXmlHeader[] = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"; namespace sax_fastparser { - FastSaxSerializer::FastSaxSerializer( ) + FastSaxSerializer::FastSaxSerializer( const css::uno::Reference< css::io::XOutputStream >& xOutputStream ) : maCachedOutputStream() - , mxFastTokenHandler() , maMarkStack() { + mxFastTokenHandler = css::xml::sax::FastTokenHandler::create( + ::comphelper::getProcessComponentContext()); + assert(xOutputStream.is()); // cannot do anything without that + maCachedOutputStream.setOutputStream( xOutputStream ); } FastSaxSerializer::~FastSaxSerializer() {} @@ -189,21 +194,11 @@ namespace sax_fastparser { writeBytes(sSlashAndClosingBracket, N_CHARS(sSlashAndClosingBracket)); } - void FastSaxSerializer::setOutputStream( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutputStream ) - { - maCachedOutputStream.setOutputStream( xOutputStream ); - } - ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > FastSaxSerializer::getOutputStream() { return maCachedOutputStream.getOutputStream(); } - void FastSaxSerializer::setFastTokenHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastTokenHandler >& xFastTokenHandler ) - { - mxFastTokenHandler = xFastTokenHandler; - } - void FastSaxSerializer::writeTokenValueList() { #ifdef DBG_UTIL |