From 1889c1af41650576a29c587a0b2cdeaf0d297587 Mon Sep 17 00:00:00 2001 From: Bjoern Michaelsen Date: Tue, 6 Mar 2012 18:16:35 +0100 Subject: lp#527938, debian#602953, fdo#33266, i#105408: do not crash on clicking bibliography when base isnt installed --- extensions/source/bibliography/bibload.cxx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx index 882b9a29fa0f..d20d34c09617 100644 --- a/extensions/source/bibliography/bibload.cxx +++ b/extensions/source/bibliography/bibload.cxx @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -242,13 +243,27 @@ void BibliographyLoader::cancel(void) throw (::com::sun::star::uno::RuntimeExcep } // ----------------------------------------------------------------------- +namespace +{ + // lp#527938, debian#602953, fdo#33266, i#105408 + static bool lcl_isBaseAvailable() + { + Reference< XMultiServiceFactory > xMgr = comphelper::getProcessServiceFactory(); + Reference< XAggregation > xAggregate = Reference< XAggregation >( xMgr->createInstance(C2U("com.sun.star.sbd.RowSet")), UNO_QUERY); + return xAggregate.is(); + } +} void BibliographyLoader::load(const Reference< XFrame > & rFrame, const rtl::OUString& rURL, const Sequence< PropertyValue >& rArgs, const Reference< XLoadEventListener > & rListener) throw (::com::sun::star::uno::RuntimeException) { - //! + // lp#527938, debian#602953, fdo#33266, i#105408 + // make sure we actually can instanciate services from base first + if(!lcl_isBaseAvailable()) + return; SolarMutexGuard aGuard; + m_pBibMod = OpenBibModul(); String aURLStr( rURL ); -- cgit v1.2.3