Kaydet (Commit) f5ef612a authored tarafından Matúš Kukan's avatar Matúš Kukan

Use FastSaxParser directly

Change-Id: I2f21438a0ccc6bc096f3257c48e088c4114d9f45
üst beed6cb8
...@@ -17,6 +17,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sax_parser, \ ...@@ -17,6 +17,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sax_parser, \
comphelper \ comphelper \
cppu \ cppu \
cppuhelper \ cppuhelper \
expwrap \
sal \ sal \
test \ test \
$(gb_UWINAPI) \ $(gb_UWINAPI) \
...@@ -35,7 +36,6 @@ $(eval $(call gb_CppunitTest_use_components,sax_parser,\ ...@@ -35,7 +36,6 @@ $(eval $(call gb_CppunitTest_use_components,sax_parser,\
configmgr/source/configmgr \ configmgr/source/configmgr \
framework/util/fwk \ framework/util/fwk \
i18npool/util/i18npool \ i18npool/util/i18npool \
sax/source/expatwrap/expwrap \
sfx2/util/sfx \ sfx2/util/sfx \
ucb/source/core/ucb1 \ ucb/source/core/ucb1 \
ucb/source/ucp/file/ucpfile1 \ ucb/source/ucp/file/ucpfile1 \
......
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
#include <sal/config.h> #include <sal/config.h>
#include <com/sun/star/io/Pipe.hpp> #include <com/sun/star/io/Pipe.hpp>
#include <com/sun/star/xml/sax/FastParser.hpp>
#include <com/sun/star/xml/sax/FastToken.hpp> #include <com/sun/star/xml/sax/FastToken.hpp>
#include <com/sun/star/xml/sax/SAXParseException.hpp> #include <com/sun/star/xml/sax/SAXParseException.hpp>
#include <com/sun/star/xml/sax/XFastParser.hpp> #include <com/sun/star/xml/sax/XFastTokenHandler.hpp>
#include <cppuhelper/implbase1.hxx> #include <cppuhelper/implbase1.hxx>
#include <sax/fastparser.hxx>
#include <test/bootstrapfixture.hxx> #include <test/bootstrapfixture.hxx>
using namespace css; using namespace css;
...@@ -57,7 +57,7 @@ public: ...@@ -57,7 +57,7 @@ public:
class ParserTest: public test::BootstrapFixture class ParserTest: public test::BootstrapFixture
{ {
InputSource maInput; InputSource maInput;
uno::Reference< XFastParser > mxParser; sax_fastparser::FastSaxParser maParser;
uno::Reference< XFastDocumentHandler > mxDocumentHandler; uno::Reference< XFastDocumentHandler > mxDocumentHandler;
uno::Reference< DummyTokenHandler > mxTokenHandler; uno::Reference< DummyTokenHandler > mxTokenHandler;
...@@ -78,9 +78,8 @@ private: ...@@ -78,9 +78,8 @@ private:
void ParserTest::setUp() void ParserTest::setUp()
{ {
test::BootstrapFixture::setUp(); test::BootstrapFixture::setUp();
mxParser = css::xml::sax::FastParser::create(m_xContext);
mxTokenHandler.set( new DummyTokenHandler() ); mxTokenHandler.set( new DummyTokenHandler() );
mxParser->setTokenHandler( mxTokenHandler ); maParser.setTokenHandler( mxTokenHandler );
} }
void ParserTest::tearDown() void ParserTest::tearDown()
...@@ -102,13 +101,13 @@ uno::Reference< io::XInputStream > ParserTest::createStream(const OString& sInpu ...@@ -102,13 +101,13 @@ uno::Reference< io::XInputStream > ParserTest::createStream(const OString& sInpu
void ParserTest::parse() void ParserTest::parse()
{ {
maInput.aInputStream = createStream("<a>...<b />..</a>"); maInput.aInputStream = createStream("<a>...<b />..</a>");
mxParser->parseStream( maInput ); maParser.parseStream( maInput );
maInput.aInputStream = createStream("<b></a>"); maInput.aInputStream = createStream("<b></a>");
bool bException = false; bool bException = false;
try try
{ {
mxParser->parseStream( maInput ); maParser.parseStream( maInput );
} }
catch (const SAXParseException &) catch (const SAXParseException &)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment