diff options
author | Noel Grandin <noel@peralex.com> | 2015-07-13 16:17:00 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-08-03 06:37:16 +0000 |
commit | 2660d24a07866e083c5135ea263030f3e3a2e729 (patch) | |
tree | 0089d6018d4fc33a7fde955e585e77191cdd258b /sdext | |
parent | tdf#93068 - UI: Crash when Character dialogue opened (diff) | |
download | core-2660d24a07866e083c5135ea263030f3e3a2e729.tar.gz core-2660d24a07866e083c5135ea263030f3e3a2e729.zip |
new loplugin: refcounting
This was a feature requested by mmeeks, as a result of
tdf#92611.
It validates that things that extend XInterface are not
directly heap/stack-allocated, but have their lifecycle managed
via css::uno::Reference or rtl::Reference.
Change-Id: I28e3b8b236f6a4a56d0a6d6f26ad54e44b36e692
Reviewed-on: https://gerrit.libreoffice.org/16924
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sdext')
-rw-r--r-- | sdext/source/pdfimport/test/pdf2xml.cxx | 6 | ||||
-rw-r--r-- | sdext/source/pdfimport/test/tests.cxx | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/sdext/source/pdfimport/test/pdf2xml.cxx b/sdext/source/pdfimport/test/pdf2xml.cxx index 518b0ef2c938..750fb5102816 100644 --- a/sdext/source/pdfimport/test/pdf2xml.cxx +++ b/sdext/source/pdfimport/test/pdf2xml.cxx @@ -72,9 +72,9 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) test::BootstrapFixtureBase aEnv; aEnv.setUp(); - pdfi::PDFIRawAdaptor aAdaptor( OUString(), aEnv.getComponentContext() ); - aAdaptor.setTreeVisitorFactory(pTreeFactory); - aAdaptor.odfConvert( aSrcURL, new OutputWrap(aDstURL), NULL ); + uno::Reference<pdfi::PDFIRawAdaptor> xAdaptor( new pdfi::PDFIRawAdaptor(OUString(), aEnv.getComponentContext()) ); + xAdaptor->setTreeVisitorFactory(pTreeFactory); + xAdaptor->odfConvert( aSrcURL, new OutputWrap(aDstURL), NULL ); } catch (const uno::Exception& e) { diff --git a/sdext/source/pdfimport/test/tests.cxx b/sdext/source/pdfimport/test/tests.cxx index 90425f912c36..e8150dd5a6f6 100644 --- a/sdext/source/pdfimport/test/tests.cxx +++ b/sdext/source/pdfimport/test/tests.cxx @@ -468,14 +468,14 @@ namespace void testOdfDrawExport() { - pdfi::PDFIRawAdaptor aAdaptor( OUString(), getComponentContext() ); - aAdaptor.setTreeVisitorFactory( createDrawTreeVisitorFactory() ); + uno::Reference<pdfi::PDFIRawAdaptor> xAdaptor( new pdfi::PDFIRawAdaptor(OUString(), getComponentContext()) ); + xAdaptor->setTreeVisitorFactory( createDrawTreeVisitorFactory() ); OUString tempFileURL; CPPUNIT_ASSERT( osl::File::createTempFile( NULL, NULL, &tempFileURL ) == osl::File::E_None ); osl::File::remove( tempFileURL ); // FIXME the below apparently fails silently if the file already exists CPPUNIT_ASSERT_MESSAGE("Exporting to ODF", - aAdaptor.odfConvert( getURLFromSrc("/sdext/source/pdfimport/test/testinput.pdf"), + xAdaptor->odfConvert( getURLFromSrc("/sdext/source/pdfimport/test/testinput.pdf"), new OutputWrap(tempFileURL), NULL )); osl::File::remove( tempFileURL ); @@ -483,14 +483,14 @@ namespace void testOdfWriterExport() { - pdfi::PDFIRawAdaptor aAdaptor( OUString(), getComponentContext() ); - aAdaptor.setTreeVisitorFactory( createWriterTreeVisitorFactory() ); + uno::Reference<pdfi::PDFIRawAdaptor> xAdaptor( new pdfi::PDFIRawAdaptor(OUString(), getComponentContext()) ); + xAdaptor->setTreeVisitorFactory( createWriterTreeVisitorFactory() ); OUString tempFileURL; CPPUNIT_ASSERT( osl::File::createTempFile( NULL, NULL, &tempFileURL ) == osl::File::E_None ); osl::File::remove( tempFileURL ); // FIXME the below apparently fails silently if the file already exists CPPUNIT_ASSERT_MESSAGE("Exporting to ODF", - aAdaptor.odfConvert( getURLFromSrc("/sdext/source/pdfimport/test/testinput.pdf"), + xAdaptor->odfConvert( getURLFromSrc("/sdext/source/pdfimport/test/testinput.pdf"), new OutputWrap(tempFileURL), NULL )); osl::File::remove( tempFileURL ); |