summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-06-26 13:31:16 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-06-26 13:34:04 +0100
commit037ddf9c77b5cd50ab41d656222f4d43597b22cc (patch)
tree4d7b50ab7f9148145cc50ad0e7ee95b9d7deb493
parentd9a00ace2ce3423c1ac08eee0bd1fd36dace8d3e (diff)
Resolves: fdo#50967 Address DataSource dialog fails on throws
e.g. kde3 address book support is built in, but loaded on system without kde3 libs Change-Id: I0be27eeab3fce8f26fca203d61c67693b880fb3b
-rw-r--r--extensions/source/abpilot/typeselectionpage.cxx49
1 files changed, 32 insertions, 17 deletions
diff --git a/extensions/source/abpilot/typeselectionpage.cxx b/extensions/source/abpilot/typeselectionpage.cxx
index aee521988d20..065c11bc88e5 100644
--- a/extensions/source/abpilot/typeselectionpage.cxx
+++ b/extensions/source/abpilot/typeselectionpage.cxx
@@ -67,34 +67,49 @@ namespace abp
aItemSize.Width() = GetOutputSizePixel().Width() - 30;
bool bWithMozilla = true, bUnx = true;
- bool bHaveEvolution = true, bHaveKab = true;
- bool bHaveMacab = true;
+ bool bHaveEvolution = false, bHaveKab = false;
+ bool bHaveMacab = false;
#if !defined WITH_MOZILLA || defined MACOSX
bWithMozilla = false;
#endif
#ifndef UNX
bUnx = false;
- bHaveEvolution = false;
- bHaveKab = false;
- bHaveMacab = false;
#else
Reference< XDriverAccess> xManager(_pParent->getORB()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdbc.DriverManager"))), UNO_QUERY);
- // check whether Evolution is available
- Reference< XDriver > xDriver( xManager->getDriverByURL(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:evolution:local"))) );
- if ( !xDriver.is() )
- bHaveEvolution = false;
+ try
+ {
+ // check whether Evolution is available
+ Reference< XDriver > xDriver( xManager->getDriverByURL(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:evolution:local"))) );
+ if ( xDriver.is() )
+ bHaveEvolution = true;
+ }
+ catch (...)
+ {
+ }
// check whether KDE address book is available
- xDriver = xManager->getDriverByURL(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:kab")));
- if ( !xDriver.is() )
- bHaveKab = false;
-
- // check whether Mac OS X address book is available
- xDriver = xManager->getDriverByURL(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:macab")));
- if ( !xDriver.is() )
- bHaveMacab = false;
+ try
+ {
+ Reference< XDriver > xDriver( xManager->getDriverByURL(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:kab"))) );
+ if ( xDriver.is() )
+ bHaveKab = true;
+ }
+ catch (...)
+ {
+ }
+
+ try
+ {
+ // check whether Mac OS X address book is available
+ Reference< XDriver > xDriver( xManager->getDriverByURL(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:macab"))) );
+ if ( xDriver.is() )
+ bHaveMacab = true;
+ }
+ catch(...)
+ {
+ }
#endif
// Items are displayed in list order