diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-07-28 14:01:49 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-07-28 14:01:49 +0100 |
commit | e00096e8f8102c2b796337c053983bac336ff05c (patch) | |
tree | 634a4c8b0295b5adf36cd2be246ed517a4d06cf8 | |
parent | a7058d28e5d36778b9f16308632ffb4c9608479c (diff) |
Resolves: fdo#35439 survive missing libdba gracefully with errorbox
-rw-r--r-- | sw/source/ui/dbui/mmaddressblockpage.cxx | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx index c785c96b04..126b4ed3f1 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.cxx +++ b/sw/source/ui/dbui/mmaddressblockpage.cxx @@ -44,6 +44,7 @@ #include <com/sun/star/sdb/XColumn.hpp> #include <vector> +#include <boost/scoped_ptr.hpp> #include <mmaddressblockpage.hrc> #include <dbui.hrc> #include <helpid.h> @@ -174,22 +175,29 @@ sal_Bool SwMailMergeAddressBlockPage::commitPage( ::svt::WizardTypes::CommitP IMPL_LINK(SwMailMergeAddressBlockPage, AddressListHdl_Impl, PushButton*, EMPTYARG) { - SwAddressListDialog* pAddrDialog = new SwAddressListDialog(this); - if(RET_OK == pAddrDialog->Execute()) + try { - SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); - rConfigItem.SetCurrentConnection( - pAddrDialog->GetSource(), - pAddrDialog->GetConnection(), - pAddrDialog->GetColumnsSupplier(), - pAddrDialog->GetDBData()); - ::rtl::OUString sFilter = pAddrDialog->GetFilter(); - rConfigItem.SetFilter( sFilter ); - InsertDataHdl_Impl(0); - GetWizard()->UpdateRoadmap(); - GetWizard()->enableButtons(WZB_NEXT, GetWizard()->isStateEnabled(MM_GREETINGSPAGE)); + boost::scoped_ptr<SwAddressListDialog> xAddrDialog(new SwAddressListDialog(this)); + if(RET_OK == xAddrDialog->Execute()) + { + SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); + rConfigItem.SetCurrentConnection( + xAddrDialog->GetSource(), + xAddrDialog->GetConnection(), + xAddrDialog->GetColumnsSupplier(), + xAddrDialog->GetDBData()); + ::rtl::OUString sFilter = xAddrDialog->GetFilter(); + rConfigItem.SetFilter( sFilter ); + InsertDataHdl_Impl(0); + GetWizard()->UpdateRoadmap(); + GetWizard()->enableButtons(WZB_NEXT, GetWizard()->isStateEnabled(MM_GREETINGSPAGE)); + } + } + catch (const uno::Exception& e) + { + OSL_FAIL(rtl::OUStringToOString(e.Message, osl_getThreadTextEncoding())); + ErrorBox(this, WB_OK, e.Message).Execute(); } - delete pAddrDialog; return 0; } |