[Libreoffice-commits] .: extensions/source
Bjoern Michaelsen
bmichaelsen at kemper.freedesktop.org
Tue Mar 6 09:18:07 PST 2012
extensions/source/bibliography/bibload.cxx | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
New commits:
commit 1889c1af41650576a29c587a0b2cdeaf0d297587
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date: Tue Mar 6 18:16:35 2012 +0100
lp#527938, debian#602953, fdo#33266, i#105408: do not crash on clicking bibliography when base isnt installed
diff --git a/extensions/source/bibliography/bibload.cxx b/extensions/source/bibliography/bibload.cxx
index 882b9a2..d20d34c 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 );
More information about the Libreoffice-commits
mailing list