diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-02-16 15:47:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-02-16 20:17:39 +0100 |
commit | 9bd827270646be509060ddb92be4eae20b277b91 (patch) | |
tree | f68cb9b3296620ba15fc0efa57787176374abe80 /unoxml/qa | |
parent | 1607033e581ee1fc4aab5564cbf8fa89d7094ec7 (diff) |
loplugin:referencecasting in UnoControls..unoxml
Change-Id: I42f216b6115be693a4e57d70f6cbbf11b62ec185
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110998
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unoxml/qa')
-rw-r--r-- | unoxml/qa/unit/domtest.cxx | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/unoxml/qa/unit/domtest.cxx b/unoxml/qa/unit/domtest.cxx index 1b1daa56b1f9..c6501547183c 100644 --- a/unoxml/qa/unit/domtest.cxx +++ b/unoxml/qa/unit/domtest.cxx @@ -207,7 +207,7 @@ struct BasicTest : public test::BootstrapFixture mxValidInStream.set( new SequenceInputStream(css::uno::Sequence<sal_Int8>(reinterpret_cast<sal_Int8 const *>(validTestFile), SAL_N_ELEMENTS(validTestFile))) ); mxWarningInStream.set( new SequenceInputStream(css::uno::Sequence<sal_Int8>(reinterpret_cast<sal_Int8 const *>(warningTestFile), SAL_N_ELEMENTS(warningTestFile))) ); mxErrorInStream.set( new SequenceInputStream(css::uno::Sequence<sal_Int8>(reinterpret_cast<sal_Int8 const *>(errorTestFile), SAL_N_ELEMENTS(errorTestFile))) ); - mxDomBuilder->setErrorHandler(mxErrHandler.get()); + mxDomBuilder->setErrorHandler(mxErrHandler); } void validInputTest() @@ -215,9 +215,7 @@ struct BasicTest : public test::BootstrapFixture try { CPPUNIT_ASSERT_MESSAGE("Valid input file did not result in XDocument #1", - mxDomBuilder->parse( - uno::Reference<io::XInputStream>( - mxValidInStream.get())).is()); + mxDomBuilder->parse(mxValidInStream).is()); CPPUNIT_ASSERT_MESSAGE("Valid input file resulted in parse errors", mxErrHandler->noErrors()); } @@ -233,9 +231,7 @@ struct BasicTest : public test::BootstrapFixture { // We DON'T expect exception here, as mxWarningInStream is valid XML Doc CPPUNIT_ASSERT_MESSAGE("Valid input file did not result in XDocument #2", - mxDomBuilder->parse( - uno::Reference<io::XInputStream>( - mxWarningInStream.get())).is()); + mxDomBuilder->parse(mxWarningInStream).is()); } catch (const css::xml::sax::SAXParseException& ) { @@ -253,9 +249,7 @@ struct BasicTest : public test::BootstrapFixture { // We expect exception here, as mxErrorInStream is invalid XML Doc CPPUNIT_ASSERT_MESSAGE("Invalid input file result in XDocument #2!", - !mxDomBuilder->parse( - uno::Reference<io::XInputStream>( - mxErrorInStream.get())).is()); + !mxDomBuilder->parse(mxErrorInStream).is()); CPPUNIT_ASSERT_MESSAGE("No exception is thrown in unclean input file", false); } catch (const css::xml::sax::SAXParseException&) @@ -295,7 +289,7 @@ struct SerializerTest : public test::BootstrapFixture uno::Reference<XDocumentBuilder> xDB( getMultiServiceFactory()->createInstance("com.sun.star.xml.dom.DocumentBuilder"), uno::UNO_QUERY_THROW ); mxDomBuilder.set( xDB ); mxInStream.set( new SequenceInputStream(css::uno::Sequence<sal_Int8>(reinterpret_cast<sal_Int8 const *>(validTestFile), SAL_N_ELEMENTS(validTestFile))) ); - mxDomBuilder->setErrorHandler(mxErrHandler.get()); + mxDomBuilder->setErrorHandler(mxErrHandler); mxHandler.set( new DocumentHandler ); mxTokHandler.set( new TokenHandler ); @@ -313,9 +307,7 @@ struct SerializerTest : public test::BootstrapFixture try { uno::Reference< xml::dom::XDocument > xDoc = - mxDomBuilder->parse( - uno::Reference<io::XInputStream>( - mxInStream.get())); + mxDomBuilder->parse(mxInStream); CPPUNIT_ASSERT_MESSAGE("Valid input file did not result in XDocument", xDoc.is()); CPPUNIT_ASSERT_MESSAGE("Valid input file resulted in parse errors", @@ -331,8 +323,8 @@ struct SerializerTest : public test::BootstrapFixture CPPUNIT_ASSERT_MESSAGE("XFastSAXSerializable not supported", xSaxSerializer.is()); - xFastSaxSerializer->fastSerialize(mxHandler.get(), - mxTokHandler.get(), + xFastSaxSerializer->fastSerialize(mxHandler, + mxTokHandler, uno::Sequence< beans::StringPair >(), maRegisteredNamespaces); } |