diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-04-09 16:27:42 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-04-09 21:25:18 +0200 |
commit | 0b0bc5eb77ac735573482dddd6814c9763f8c6e1 (patch) | |
tree | 0c3b5c8fdb61b43454ac2cedc271127e4c14826e /uui | |
parent | 0a4c1fb68c3619e61099a7c548f550b0d3fd7a53 (diff) |
Remove std::bad_alloc -> css::uno::RuntimeException mappings
...that are no longer needed now that the dynamic exception specifications are
gone from C++ UNO, so won't cause std::unexpected any more.
Change-Id: Ie3418658f5a84e6cec1ac48e3413f523f87497fe
Reviewed-on: https://gerrit.libreoffice.org/52641
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'uui')
-rw-r--r-- | uui/source/iahndl-authentication.cxx | 174 | ||||
-rw-r--r-- | uui/source/iahndl-filter.cxx | 21 | ||||
-rw-r--r-- | uui/source/iahndl-locking.cxx | 183 | ||||
-rw-r--r-- | uui/source/iahndl-ssl.cxx | 124 | ||||
-rw-r--r-- | uui/source/iahndl.cxx | 4 |
5 files changed, 220 insertions, 286 deletions
diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index 1852e67b6a6d..a9f0d8d3cca4 100644 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -62,67 +62,60 @@ executeLoginDialog( LoginErrorInfo & rInfo, OUString const & rRealm) { - try - { - SolarMutexGuard aGuard; - - bool bAccount = (rInfo.GetFlags() & LOGINERROR_FLAG_MODIFY_ACCOUNT) != 0; - bool bSavePassword = rInfo.GetCanRememberPassword(); - bool bCanUseSysCreds = rInfo.GetCanUseSystemCredentials(); - - LoginFlags nFlags = LoginFlags::NONE; - if (rInfo.GetErrorText().isEmpty()) - nFlags |= LoginFlags::NoErrorText; - if (!bAccount) - nFlags |= LoginFlags::NoAccount; - if (!(rInfo.GetFlags() & LOGINERROR_FLAG_MODIFY_USER_NAME)) - nFlags |= LoginFlags::UsernameReadonly; - - if (!bSavePassword) - nFlags |= LoginFlags::NoSavePassword; - - if (!bCanUseSysCreds) - nFlags |= LoginFlags::NoUseSysCreds; - - ScopedVclPtrInstance< LoginDialog > xDialog(pParent, nFlags, rInfo.GetServer(), rRealm); - if (!rInfo.GetErrorText().isEmpty()) - xDialog->SetErrorText(rInfo.GetErrorText()); - xDialog->SetName(rInfo.GetUserName()); - if (bAccount) - xDialog->ClearAccount(); - else - xDialog->ClearPassword(); - xDialog->SetPassword(rInfo.GetPassword()); + SolarMutexGuard aGuard; + + bool bAccount = (rInfo.GetFlags() & LOGINERROR_FLAG_MODIFY_ACCOUNT) != 0; + bool bSavePassword = rInfo.GetCanRememberPassword(); + bool bCanUseSysCreds = rInfo.GetCanUseSystemCredentials(); + + LoginFlags nFlags = LoginFlags::NONE; + if (rInfo.GetErrorText().isEmpty()) + nFlags |= LoginFlags::NoErrorText; + if (!bAccount) + nFlags |= LoginFlags::NoAccount; + if (!(rInfo.GetFlags() & LOGINERROR_FLAG_MODIFY_USER_NAME)) + nFlags |= LoginFlags::UsernameReadonly; + + if (!bSavePassword) + nFlags |= LoginFlags::NoSavePassword; + + if (!bCanUseSysCreds) + nFlags |= LoginFlags::NoUseSysCreds; + + ScopedVclPtrInstance< LoginDialog > xDialog(pParent, nFlags, rInfo.GetServer(), rRealm); + if (!rInfo.GetErrorText().isEmpty()) + xDialog->SetErrorText(rInfo.GetErrorText()); + xDialog->SetName(rInfo.GetUserName()); + if (bAccount) + xDialog->ClearAccount(); + else + xDialog->ClearPassword(); + xDialog->SetPassword(rInfo.GetPassword()); - if (bSavePassword) - { - std::locale aLocale(Translate::Create("uui")); - xDialog->SetSavePasswordText( - Translate::get(rInfo.GetIsRememberPersistent() - ? RID_SAVE_PASSWORD - : RID_KEEP_PASSWORD, - aLocale)); - - xDialog->SetSavePassword(rInfo.GetIsRememberPassword()); - } + if (bSavePassword) + { + std::locale aLocale(Translate::Create("uui")); + xDialog->SetSavePasswordText( + Translate::get(rInfo.GetIsRememberPersistent() + ? RID_SAVE_PASSWORD + : RID_KEEP_PASSWORD, + aLocale)); + + xDialog->SetSavePassword(rInfo.GetIsRememberPassword()); + } - if ( bCanUseSysCreds ) - xDialog->SetUseSystemCredentials( rInfo.GetIsUseSystemCredentials() ); + if ( bCanUseSysCreds ) + xDialog->SetUseSystemCredentials( rInfo.GetIsUseSystemCredentials() ); - rInfo.SetResult(xDialog->Execute() == RET_OK ? DialogMask::ButtonsOk : - DialogMask::ButtonsCancel); - rInfo.SetUserName(xDialog->GetName()); - rInfo.SetPassword(xDialog->GetPassword()); - rInfo.SetAccount(xDialog->GetAccount()); - rInfo.SetIsRememberPassword(xDialog->IsSavePassword()); + rInfo.SetResult(xDialog->Execute() == RET_OK ? DialogMask::ButtonsOk : + DialogMask::ButtonsCancel); + rInfo.SetUserName(xDialog->GetName()); + rInfo.SetPassword(xDialog->GetPassword()); + rInfo.SetAccount(xDialog->GetAccount()); + rInfo.SetIsRememberPassword(xDialog->IsSavePassword()); - if ( bCanUseSysCreds ) - rInfo.SetIsUseSystemCredentials( xDialog->IsUseSystemCredentials() ); - } - catch (std::bad_alloc const &) - { - throw uno::RuntimeException("out of memory"); - } + if ( bCanUseSysCreds ) + rInfo.SetIsUseSystemCredentials( xDialog->IsUseSystemCredentials() ); } void getRememberModes( @@ -405,7 +398,6 @@ executeMasterPasswordDialog( task::PasswordRequestMode nMode) { OString aMaster; - try { SolarMutexGuard aGuard; @@ -429,10 +421,6 @@ executeMasterPasswordDialog( xDialog->GetMasterPassword(), RTL_TEXTENCODING_UTF8); } } - catch (std::bad_alloc const &) - { - throw uno::RuntimeException("out of memory"); - } sal_uInt8 aKey[RTL_DIGEST_LENGTH_MD5]; // FIXME this is subject to the SHA1-bug tdf#114939 - but this @@ -506,51 +494,43 @@ executePasswordDialog( bool bIsPasswordToModify, bool bIsSimplePasswordRequest ) { - try - { - SolarMutexGuard aGuard; + SolarMutexGuard aGuard; - std::locale aResLocale(Translate::Create("uui")); - if( nMode == task::PasswordRequestMode_PASSWORD_CREATE ) - { - if (bIsSimplePasswordRequest) - { - std::unique_ptr<PasswordDialog> xDialog(new PasswordDialog(pParent, nMode, - aResLocale, aDocName, bIsPasswordToModify, bIsSimplePasswordRequest)); - xDialog->SetMinLen(0); - - rInfo.SetResult(xDialog->run() == RET_OK ? DialogMask::ButtonsOk : DialogMask::ButtonsCancel); - rInfo.SetPassword(xDialog->GetPassword()); - } - else - { - const sal_uInt16 nMaxPasswdLen = bMSCryptoMode ? 15 : 0; // 0 -> allow any length - - VclAbstractDialogFactory * pFact = VclAbstractDialogFactory::Create(); - ScopedVclPtr<AbstractPasswordToOpenModifyDialog> const pDialog( - pFact->CreatePasswordToOpenModifyDialog(pParent, nMaxPasswdLen, bIsPasswordToModify)); - - rInfo.SetResult( pDialog->Execute() == RET_OK ? DialogMask::ButtonsOk : DialogMask::ButtonsCancel ); - rInfo.SetPassword( pDialog->GetPasswordToOpen() ); - rInfo.SetPasswordToModify( pDialog->GetPasswordToModify() ); - rInfo.SetRecommendToOpenReadonly( pDialog->IsRecommendToOpenReadonly() ); - } - } - else // enter password or reenter password + std::locale aResLocale(Translate::Create("uui")); + if( nMode == task::PasswordRequestMode_PASSWORD_CREATE ) + { + if (bIsSimplePasswordRequest) { std::unique_ptr<PasswordDialog> xDialog(new PasswordDialog(pParent, nMode, aResLocale, aDocName, bIsPasswordToModify, bIsSimplePasswordRequest)); xDialog->SetMinLen(0); rInfo.SetResult(xDialog->run() == RET_OK ? DialogMask::ButtonsOk : DialogMask::ButtonsCancel); - rInfo.SetPassword(bIsPasswordToModify ? OUString() : xDialog->GetPassword()); - rInfo.SetPasswordToModify(bIsPasswordToModify ? xDialog->GetPassword() : OUString()); + rInfo.SetPassword(xDialog->GetPassword()); + } + else + { + const sal_uInt16 nMaxPasswdLen = bMSCryptoMode ? 15 : 0; // 0 -> allow any length + + VclAbstractDialogFactory * pFact = VclAbstractDialogFactory::Create(); + ScopedVclPtr<AbstractPasswordToOpenModifyDialog> const pDialog( + pFact->CreatePasswordToOpenModifyDialog(pParent, nMaxPasswdLen, bIsPasswordToModify)); + + rInfo.SetResult( pDialog->Execute() == RET_OK ? DialogMask::ButtonsOk : DialogMask::ButtonsCancel ); + rInfo.SetPassword( pDialog->GetPasswordToOpen() ); + rInfo.SetPasswordToModify( pDialog->GetPasswordToModify() ); + rInfo.SetRecommendToOpenReadonly( pDialog->IsRecommendToOpenReadonly() ); } } - catch (std::bad_alloc const &) + else // enter password or reenter password { - throw uno::RuntimeException("out of memory", - uno::Reference< uno::XInterface>()); + std::unique_ptr<PasswordDialog> xDialog(new PasswordDialog(pParent, nMode, + aResLocale, aDocName, bIsPasswordToModify, bIsSimplePasswordRequest)); + xDialog->SetMinLen(0); + + rInfo.SetResult(xDialog->run() == RET_OK ? DialogMask::ButtonsOk : DialogMask::ButtonsCancel); + rInfo.SetPassword(bIsPasswordToModify ? OUString() : xDialog->GetPassword()); + rInfo.SetPasswordToModify(bIsPasswordToModify ? xDialog->GetPassword() : OUString()); } } diff --git a/uui/source/iahndl-filter.cxx b/uui/source/iahndl-filter.cxx index 630197ee64bb..421ce727592e 100644 --- a/uui/source/iahndl-filter.cxx +++ b/uui/source/iahndl-filter.cxx @@ -49,24 +49,17 @@ executeFilterDialog( uui::FilterNameList const & rFilters, OUString & rFilter ) { - try - { - SolarMutexGuard aGuard; + SolarMutexGuard aGuard; - ScopedVclPtrInstance< uui::FilterDialog > xDialog(pParent); + ScopedVclPtrInstance< uui::FilterDialog > xDialog(pParent); - xDialog->SetURL(rURL); - xDialog->ChangeFilters(&rFilters); + xDialog->SetURL(rURL); + xDialog->ChangeFilters(&rFilters); - uui::FilterNameListPtr pSelected = rFilters.end(); - if( xDialog->AskForFilter( pSelected ) ) - { - rFilter = pSelected->sInternal; - } - } - catch (std::bad_alloc const &) + uui::FilterNameListPtr pSelected = rFilters.end(); + if( xDialog->AskForFilter( pSelected ) ) { - throw uno::RuntimeException("out of memory"); + rFilter = pSelected->sInternal; } } diff --git a/uui/source/iahndl-locking.cxx b/uui/source/iahndl-locking.cxx index 0facddd6debb..b1fa4989d66d 100644 --- a/uui/source/iahndl-locking.cxx +++ b/uui/source/iahndl-locking.cxx @@ -73,73 +73,66 @@ handleLockedDocumentRequest_( if ( !xApprove.is() || !xDisapprove.is() || !xAbort.is() ) return; - try + SolarMutexGuard aGuard; + std::locale aResLocale = Translate::Create("uui"); + + OUString aMessage; + std::vector< OUString > aArguments; + aArguments.push_back( aDocumentURL ); + + sal_Int32 nResult = RET_CANCEL; + if ( nMode == UUI_DOC_LOAD_LOCK ) + { + aArguments.push_back( !aInfo.isEmpty() + ? aInfo + : Translate::get( STR_UNKNOWNUSER, aResLocale) ); + aArguments.push_back( xRetry.is() + ? Translate::get( STR_OPENLOCKED_ALLOWIGNORE_MSG, aResLocale ) + : "" ); + aMessage = Translate::get(STR_OPENLOCKED_MSG, aResLocale); + aMessage = UUIInteractionHelper::replaceMessageWithArguments( + aMessage, aArguments ); + + OpenLockedQueryBox aDialog(pParent, aResLocale, aMessage, xRetry.is()); + nResult = aDialog.run(); + } + else if ( nMode == UUI_DOC_SAVE_LOCK ) { - SolarMutexGuard aGuard; - std::locale aResLocale = Translate::Create("uui"); - - OUString aMessage; - std::vector< OUString > aArguments; - aArguments.push_back( aDocumentURL ); - - sal_Int32 nResult = RET_CANCEL; - if ( nMode == UUI_DOC_LOAD_LOCK ) - { - aArguments.push_back( !aInfo.isEmpty() - ? aInfo - : Translate::get( STR_UNKNOWNUSER, aResLocale) ); - aArguments.push_back( xRetry.is() - ? Translate::get( STR_OPENLOCKED_ALLOWIGNORE_MSG, aResLocale ) - : "" ); - aMessage = Translate::get(STR_OPENLOCKED_MSG, aResLocale); - aMessage = UUIInteractionHelper::replaceMessageWithArguments( - aMessage, aArguments ); - - OpenLockedQueryBox aDialog(pParent, aResLocale, aMessage, xRetry.is()); - nResult = aDialog.run(); - } - else if ( nMode == UUI_DOC_SAVE_LOCK ) - { - aArguments.push_back( !aInfo.isEmpty() - ? aInfo - : Translate::get( STR_UNKNOWNUSER, - aResLocale ) ); - aMessage = Translate::get(xRetry.is() ? STR_OVERWRITE_IGNORELOCK_MSG : STR_TRYLATER_MSG, - aResLocale); - aMessage = UUIInteractionHelper::replaceMessageWithArguments( - aMessage, aArguments ); - - TryLaterQueryBox aDialog(pParent, aResLocale, aMessage, xRetry.is()); - nResult = aDialog.run(); - } - else if ( nMode == UUI_DOC_OWN_LOAD_LOCK || - nMode == UUI_DOC_OWN_SAVE_LOCK ) - { - aArguments.push_back( aInfo ); - aMessage = Translate::get(nMode == UUI_DOC_OWN_SAVE_LOCK - ? STR_ALREADYOPEN_SAVE_MSG - : STR_ALREADYOPEN_MSG, - aResLocale ); - aMessage = UUIInteractionHelper::replaceMessageWithArguments( - aMessage, aArguments ); - - AlreadyOpenQueryBox aDialog(pParent, aResLocale, aMessage, nMode == UUI_DOC_OWN_SAVE_LOCK); - nResult = aDialog.run(); - } - - if ( nResult == RET_YES ) - xApprove->select(); - else if ( nResult == RET_NO ) - xDisapprove->select(); - else if ( nResult == RET_IGNORE && xRetry.is() ) - xRetry->select(); - else - xAbort->select(); + aArguments.push_back( !aInfo.isEmpty() + ? aInfo + : Translate::get( STR_UNKNOWNUSER, + aResLocale ) ); + aMessage = Translate::get(xRetry.is() ? STR_OVERWRITE_IGNORELOCK_MSG : STR_TRYLATER_MSG, + aResLocale); + aMessage = UUIInteractionHelper::replaceMessageWithArguments( + aMessage, aArguments ); + + TryLaterQueryBox aDialog(pParent, aResLocale, aMessage, xRetry.is()); + nResult = aDialog.run(); } - catch (std::bad_alloc const &) + else if ( nMode == UUI_DOC_OWN_LOAD_LOCK || + nMode == UUI_DOC_OWN_SAVE_LOCK ) { - throw uno::RuntimeException("out of memory"); + aArguments.push_back( aInfo ); + aMessage = Translate::get(nMode == UUI_DOC_OWN_SAVE_LOCK + ? STR_ALREADYOPEN_SAVE_MSG + : STR_ALREADYOPEN_MSG, + aResLocale ); + aMessage = UUIInteractionHelper::replaceMessageWithArguments( + aMessage, aArguments ); + + AlreadyOpenQueryBox aDialog(pParent, aResLocale, aMessage, nMode == UUI_DOC_OWN_SAVE_LOCK); + nResult = aDialog.run(); } + + if ( nResult == RET_YES ) + xApprove->select(); + else if ( nResult == RET_NO ) + xDisapprove->select(); + else if ( nResult == RET_IGNORE && xRetry.is() ) + xRetry->select(); + else + xAbort->select(); } void @@ -155,22 +148,15 @@ handleChangedByOthersRequest_( if ( !xApprove.is() || !xAbort.is() ) return; - try - { - SolarMutexGuard aGuard; - std::locale aResLocale = Translate::Create("uui"); - FileChangedQueryBox aDialog(pParent, aResLocale); - sal_Int32 nResult = aDialog.run(); - - if ( nResult == RET_YES ) - xApprove->select(); - else - xAbort->select(); - } - catch (std::bad_alloc const &) - { - throw uno::RuntimeException("out of memory"); - } + SolarMutexGuard aGuard; + std::locale aResLocale = Translate::Create("uui"); + FileChangedQueryBox aDialog(pParent, aResLocale); + sal_Int32 nResult = aDialog.run(); + + if ( nResult == RET_YES ) + xApprove->select(); + else + xAbort->select(); } const sal_uInt16 UUI_DOC_CreateErrDlg = 0; @@ -191,33 +177,26 @@ handleLockFileProblemRequest_( if ( !xApprove.is() || !xAbort.is() ) return; - try + SolarMutexGuard aGuard; + std::locale aResLocale = Translate::Create("uui"); + + sal_Int32 nResult; + + if (nWhichDlg == UUI_DOC_CreateErrDlg) { - SolarMutexGuard aGuard; - std::locale aResLocale = Translate::Create("uui"); - - sal_Int32 nResult; - - if (nWhichDlg == UUI_DOC_CreateErrDlg) - { - LockFailedQueryBox aDialog(pParent, aResLocale); - nResult = aDialog.run(); - } - else - { - LockCorruptQueryBox aDialog(pParent, aResLocale); - nResult = aDialog.run(); - } - - if ( nResult == RET_OK ) - xApprove->select(); - else - xAbort->select(); + LockFailedQueryBox aDialog(pParent, aResLocale); + nResult = aDialog.run(); } - catch (std::bad_alloc const &) + else { - throw uno::RuntimeException("out of memory"); + LockCorruptQueryBox aDialog(pParent, aResLocale); + nResult = aDialog.run(); } + + if ( nResult == RET_OK ) + xApprove->select(); + else + xAbort->select(); } } // namespace diff --git a/uui/source/iahndl-ssl.cxx b/uui/source/iahndl-ssl.cxx index 1044b31dbbfb..799dd60b106a 100644 --- a/uui/source/iahndl-ssl.cxx +++ b/uui/source/iahndl-ssl.cxx @@ -140,32 +140,25 @@ executeUnknownAuthDialog( uno::Reference< uno::XComponentContext > const & xContext, const uno::Reference< security::XCertificate >& rXCert) { - try - { - SolarMutexGuard aGuard; + SolarMutexGuard aGuard; - UnknownAuthDialog aDialog(pParent, rXCert, xContext); + UnknownAuthDialog aDialog(pParent, rXCert, xContext); - // Get correct resource string - OUString aMessage; + // Get correct resource string + OUString aMessage; - std::vector< OUString > aArguments; - aArguments.push_back( getContentPart( rXCert->getSubjectName()) ); + std::vector< OUString > aArguments; + aArguments.push_back( getContentPart( rXCert->getSubjectName()) ); - std::locale aResLocale(Translate::Create("uui")); - ErrorResource aErrorResource(RID_UUI_ERRHDL, aResLocale); + std::locale aResLocale(Translate::Create("uui")); + ErrorResource aErrorResource(RID_UUI_ERRHDL, aResLocale); - aMessage = Translate::get(STR_UUI_UNKNOWNAUTH_UNTRUSTED, aResLocale); - aMessage = UUIInteractionHelper::replaceMessageWithArguments( - aMessage, aArguments ); - aDialog.setDescriptionText( aMessage ); + aMessage = Translate::get(STR_UUI_UNKNOWNAUTH_UNTRUSTED, aResLocale); + aMessage = UUIInteractionHelper::replaceMessageWithArguments( + aMessage, aArguments ); + aDialog.setDescriptionText( aMessage ); - return static_cast<bool>(aDialog.run()); - } - catch (std::bad_alloc const &) - { - throw uno::RuntimeException("out of memory"); - } + return static_cast<bool>(aDialog.run()); } enum class SslWarnType { @@ -180,62 +173,55 @@ executeSSLWarnDialog( SslWarnType failure, const OUString & hostName ) { - try - { - SolarMutexGuard aGuard; + SolarMutexGuard aGuard; - SSLWarnDialog aDialog(pParent, rXCert, xContext); + SSLWarnDialog aDialog(pParent, rXCert, xContext); - // Get correct resource string - std::vector< OUString > aArguments_1; - char const * pMessageKey = nullptr; - char const * pTitleKey = nullptr; + // Get correct resource string + std::vector< OUString > aArguments_1; + char const * pMessageKey = nullptr; + char const * pTitleKey = nullptr; - switch( failure ) - { - case SslWarnType::DOMAINMISMATCH: - pMessageKey = STR_UUI_SSLWARN_DOMAINMISMATCH; - pTitleKey = STR_UUI_SSLWARN_DOMAINMISMATCH_TITLE; - aArguments_1.push_back( hostName ); - aArguments_1.push_back( - getContentPart( rXCert->getSubjectName()) ); - aArguments_1.push_back( hostName ); - break; - case SslWarnType::EXPIRED: - pMessageKey = STR_UUI_SSLWARN_EXPIRED; - pTitleKey = STR_UUI_SSLWARN_EXPIRED_TITLE; - aArguments_1.push_back( - getContentPart( rXCert->getSubjectName()) ); - aArguments_1.push_back( - getLocalizedDatTimeStr( xContext, - rXCert->getNotValidAfter() ) ); - aArguments_1.push_back( - getLocalizedDatTimeStr( xContext, - rXCert->getNotValidAfter() ) ); - break; - case SslWarnType::INVALID: - pMessageKey = STR_UUI_SSLWARN_INVALID; - pTitleKey = STR_UUI_SSLWARN_INVALID_TITLE; - break; - default: assert(false); - } + switch( failure ) + { + case SslWarnType::DOMAINMISMATCH: + pMessageKey = STR_UUI_SSLWARN_DOMAINMISMATCH; + pTitleKey = STR_UUI_SSLWARN_DOMAINMISMATCH_TITLE; + aArguments_1.push_back( hostName ); + aArguments_1.push_back( + getContentPart( rXCert->getSubjectName()) ); + aArguments_1.push_back( hostName ); + break; + case SslWarnType::EXPIRED: + pMessageKey = STR_UUI_SSLWARN_EXPIRED; + pTitleKey = STR_UUI_SSLWARN_EXPIRED_TITLE; + aArguments_1.push_back( + getContentPart( rXCert->getSubjectName()) ); + aArguments_1.push_back( + getLocalizedDatTimeStr( xContext, + rXCert->getNotValidAfter() ) ); + aArguments_1.push_back( + getLocalizedDatTimeStr( xContext, + rXCert->getNotValidAfter() ) ); + break; + case SslWarnType::INVALID: + pMessageKey = STR_UUI_SSLWARN_INVALID; + pTitleKey = STR_UUI_SSLWARN_INVALID_TITLE; + break; + default: assert(false); + } - std::locale aResLocale(Translate::Create("uui")); + std::locale aResLocale(Translate::Create("uui")); - OUString aMessage_1 = Translate::get(pMessageKey, aResLocale); - aMessage_1 = UUIInteractionHelper::replaceMessageWithArguments( - aMessage_1, aArguments_1 ); - aDialog.setDescription1Text( aMessage_1 ); + OUString aMessage_1 = Translate::get(pMessageKey, aResLocale); + aMessage_1 = UUIInteractionHelper::replaceMessageWithArguments( + aMessage_1, aArguments_1 ); + aDialog.setDescription1Text( aMessage_1 ); - OUString aTitle = Translate::get(pTitleKey, aResLocale); - aDialog.set_title(aTitle); + OUString aTitle = Translate::get(pTitleKey, aResLocale); + aDialog.set_title(aTitle); - return static_cast<bool>(aDialog.run()); - } - catch (std::bad_alloc const &) - { - throw uno::RuntimeException("out of memory"); - } + return static_cast<bool>(aDialog.run()); } void diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index c9053c00a278..a7a6c8af7f93 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -861,10 +861,6 @@ UUIInteractionHelper::handleRequest_impl( // Not handled. return false; } - catch (std::bad_alloc const &) - { - throw uno::RuntimeException("out of memory"); - } catch( const uno::RuntimeException& ) { throw; // allowed to leave here |