diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2012-03-06 18:16:35 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-03-06 18:05:02 +0000 |
commit | 33ef1ffbd15994ec71be99d38c0d5171c63344a2 (patch) | |
tree | b45c879c14258835cfe396b3ca3f5f2849b80d63 | |
parent | 0dfd481888abcb14b601ca039692e9d83c1be19a (diff) |
lp#527938, debian#602953, fdo#33266, i#105408: do not crash on clicking bibliography when base isnt installed
Signed-off-by: Michael Meeks <michael.meeks@suse.com>
-rw-r--r-- | extensions/source/bibliography/bibload.cxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx index c80c81e51aaa..9159124d3a6c 100644 --- a/extensions/source/bibliography/bibload.cxx +++ b/extensions/source/bibliography/bibload.cxx @@ -54,6 +54,7 @@ #include <com/sun/star/text/BibliographyDataField.hpp> #include <com/sun/star/form/XLoadListener.hpp> #include <com/sun/star/frame/XLayoutManager.hpp> +#include <com/sun/star/uno/XAggregation.hpp> #include <toolkit/awt/vclxwindow.hxx> #include <vcl/window.hxx> #include <vcl/edit.hxx> @@ -243,13 +244,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 ); |