diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-06-26 13:31:16 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-06-26 13:42:14 +0100 |
commit | a8687f47793afbf4b6a837e769ef2de31c3f0b36 (patch) | |
tree | 2fc63a3264cbdc1eb43e8d6f087762a76f98a9ef | |
parent | 483bba422442ba8a370d3b14d378d5d385d7dda2 (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.cxx | 49 |
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 |