diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2012-03-06 18:16:35 +0100 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2012-03-06 18:16:35 +0100 |
commit | 1889c1af41650576a29c587a0b2cdeaf0d297587 (patch) | |
tree | 74dc42be7e4c0e410ba50418aa9ed185b96cda03 /extensions | |
parent | use a consistent naming scheme (diff) | |
download | core-1889c1af41650576a29c587a0b2cdeaf0d297587.tar.gz core-1889c1af41650576a29c587a0b2cdeaf0d297587.zip |
lp#527938, debian#602953, fdo#33266, i#105408: do not crash on clicking bibliography when base isnt installed
Diffstat (limited to 'extensions')
-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 882b9a29fa0f..d20d34c09617 100644 --- a/extensions/source/bibliography/bibload.cxx +++ b/extensions/source/bibliography/bibload.cxx @@ -53,6 +53,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> @@ -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 ); |