From d6d80c4e1783b4459bd4a8fbcbdfeebe416c1cb5 Mon Sep 17 00:00:00 2001 From: Noel Date: Mon, 30 Nov 2020 14:19:29 +0200 Subject: OSL_FAIL.*exception -> TOOLS_WARN_EXCEPTION Change-Id: I6800e23ead2767d245d5da71d2d40e0f8a6d7e1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106859 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/source/core/swg/SwXMLTextBlocks.cxx | 3 ++- sw/source/core/txtnode/fmtatr2.cxx | 3 ++- sw/source/core/unocore/swunohelper.cxx | 11 ++++++----- sw/source/core/unocore/unoparagraph.cxx | 5 +++-- sw/source/core/unocore/unoport.cxx | 5 +++-- sw/source/filter/xml/xmlimp.cxx | 5 +++-- sw/source/ui/dbui/addresslistdialog.cxx | 5 +++-- sw/source/ui/dbui/mmgreetingspage.cxx | 3 ++- sw/source/ui/index/cntex.cxx | 5 +++-- sw/source/uibase/dbui/mailmergehelper.cxx | 5 +++-- sw/source/uibase/fldui/xfldui.cxx | 3 ++- sw/source/uibase/uno/dlelstnr.cxx | 3 ++- sw/source/uibase/uno/unomailmerge.cxx | 3 ++- 13 files changed, 36 insertions(+), 23 deletions(-) (limited to 'sw/source') diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx index 943cb8c415d2..cb0b337acf06 100644 --- a/sw/source/core/swg/SwXMLTextBlocks.cxx +++ b/sw/source/core/swg/SwXMLTextBlocks.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -91,7 +92,7 @@ SwXMLTextBlocks::SwXMLTextBlocks( const OUString& rFile ) } catch(const uno::Exception&) { - OSL_FAIL("exception while creating AutoText storage"); + TOOLS_WARN_EXCEPTION( "sw", "exception while creating AutoText storage"); } } InitBlockMode ( refStg ); diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx index 16fb03cfb941..d3725ea03bb5 100644 --- a/sw/source/core/txtnode/fmtatr2.cxx +++ b/sw/source/core/txtnode/fmtatr2.cxx @@ -40,6 +40,7 @@ #include #include +#include #include #include @@ -743,7 +744,7 @@ void MetaField::GetPrefixAndSuffix( } catch (const uno::Exception&) { - OSL_FAIL("exception?"); + TOOLS_WARN_EXCEPTION( "sw", ""); } } diff --git a/sw/source/core/unocore/swunohelper.cxx b/sw/source/core/unocore/swunohelper.cxx index 9bfa185afb63..6e1e3631dbde 100644 --- a/sw/source/core/unocore/swunohelper.cxx +++ b/sw/source/core/unocore/swunohelper.cxx @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -69,7 +70,7 @@ bool UCB_DeleteFile( const OUString& rURL ) catch( css::uno::Exception& ) { bRemoved = false; - OSL_FAIL( "Exception from executeCommand( delete )" ); + TOOLS_WARN_EXCEPTION( "sw", "Exception from executeCommand( delete )" ); } return bRemoved; } @@ -97,7 +98,7 @@ bool UCB_MoveFile( const OUString& rURL, const OUString& rNewURL ) } catch( css::uno::Exception& ) { - OSL_FAIL( "Exception from executeCommand( transfer )" ); + TOOLS_WARN_EXCEPTION( "sw", "Exception from executeCommand( transfer )" ); bCopyCompleted = false; } return bCopyCompleted; @@ -126,7 +127,7 @@ bool UCB_IsCaseSensitiveFileName( const OUString& rURL ) catch( css::uno::Exception& ) { bCaseSensitive = false; - OSL_FAIL( "Exception from compareContentIds()" ); + TOOLS_WARN_EXCEPTION( "sw", "compareContentIds()" ); } return bCaseSensitive; } @@ -245,13 +246,13 @@ bool UCB_GetFileListOfFolder( const OUString& rURL, } catch( css::uno::Exception& ) { - OSL_FAIL( "Exception caught!" ); + TOOLS_WARN_EXCEPTION( "sw", "" ); } } } catch( css::uno::Exception& ) { - OSL_FAIL( "Exception caught!" ); + TOOLS_WARN_EXCEPTION( "sw", "" ); bOk = false; } return bOk; diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index 4077e90ab831..9b4b0ea77c36 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -677,7 +678,7 @@ SwXParagraph::setPropertyValuesTolerant( catch (beans::UnknownPropertyException &) { // should not occur because property was searched for before - OSL_FAIL( "unexpected exception caught" ); + TOOLS_WARN_EXCEPTION( "sw", "unexpected exception caught" ); pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY; } @@ -816,7 +817,7 @@ SwXParagraph::Impl::GetPropertyValuesTolerant_Impl( catch (beans::UnknownPropertyException &) { // should not occur because property was searched for before - OSL_FAIL( "unexpected exception caught" ); + TOOLS_WARN_EXCEPTION( "sw", "unexpected exception caught" ); rResult.Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY; } catch (lang::IllegalArgumentException &) diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx index ea0bca136e13..84cf32fbf0b0 100644 --- a/sw/source/core/unocore/unoport.cxx +++ b/sw/source/core/unocore/unoport.cxx @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -523,7 +524,7 @@ uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL SwXTextPortion::setPr catch (beans::UnknownPropertyException &) { // should not occur because property was searched for before - OSL_FAIL( "unexpected exception caught" ); + TOOLS_WARN_EXCEPTION( "sw", "" ); pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY; } catch (lang::IllegalArgumentException &) @@ -633,7 +634,7 @@ uno::Sequence< beans::GetDirectPropertyTolerantResult > SwXTextPortion::GetPrope catch (const beans::UnknownPropertyException &) { // should not occur because property was searched for before - OSL_FAIL( "unexpected exception caught" ); + TOOLS_WARN_EXCEPTION( "sw", "unexpected exception caught" ); aResult.Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY; } catch (const lang::IllegalArgumentException &) diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index bb39dc917cc6..0a5c68b18719 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -65,6 +65,7 @@ #include #include #include +#include #include #include @@ -1417,7 +1418,7 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC } catch( Exception& ) { - OSL_FAIL( "SwXMLImport::SetConfigurationSettings: Exception!" ); + TOOLS_WARN_EXCEPTION( "sw", "SwXMLImport::SetConfigurationSettings" ); } } } @@ -1434,7 +1435,7 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC xProps->setPropertyValue(embeddedDatabaseName->Name, embeddedDatabaseName->Value); } catch( Exception& ) { - OSL_FAIL( "SwXMLImport::SetConfigurationSettings: Exception!" ); + TOOLS_WARN_EXCEPTION( "sw", "SwXMLImport::SetConfigurationSettings" ); } // finally, treat the non-default cases diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx index 11c95bc0b478..f30a39a26080 100644 --- a/sw/source/ui/dbui/addresslistdialog.cxx +++ b/sw/source/ui/dbui/addresslistdialog.cxx @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -270,7 +271,7 @@ IMPL_LINK_NOARG(SwAddressListDialog, FilterHdl_Impl, weld::Button&, void) } catch (const Exception&) { - OSL_FAIL("exception caught in SwAddressListDialog::FilterHdl_Impl"); + TOOLS_WARN_EXCEPTION( "sw", "exception caught in SwAddressListDialog::FilterHdl_Impl"); } } @@ -556,7 +557,7 @@ void SwAddressListDialog::DetectTablesAndQueries( } catch (const Exception&) { - OSL_FAIL("exception caught in SwAddressListDialog::DetectTablesAndQueries"); + TOOLS_WARN_EXCEPTION( "sw", "exception caught in SwAddressListDialog::DetectTablesAndQueries"); m_xOK->set_sensitive(false); } } diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx b/sw/source/ui/dbui/mmgreetingspage.cxx index d45f24093fd5..8287e064ec43 100644 --- a/sw/source/ui/dbui/mmgreetingspage.cxx +++ b/sw/source/ui/dbui/mmgreetingspage.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -163,7 +164,7 @@ void SwMailMergeGreetingsPage::UpdatePreview() } catch (const sdbc::SQLException&) { - OSL_FAIL("SQLException caught"); + TOOLS_WARN_EXCEPTION( "sw", ""); } } } diff --git a/sw/source/ui/index/cntex.cxx b/sw/source/ui/index/cntex.cxx index 05d9ee2e0e84..3faac515beab 100644 --- a/sw/source/ui/index/cntex.cxx +++ b/sw/source/ui/index/cntex.cxx @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -118,7 +119,7 @@ IMPL_LINK_NOARG(SwMultiTOXTabDialog, CreateExample_Hdl, SwOneExampleFrame&, void } catch (const Exception&) { - OSL_FAIL("::CreateExample() - exception caught"); + TOOLS_WARN_EXCEPTION( "sw", "::CreateExample()"); } } @@ -385,7 +386,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample( } catch (const Exception&) { - OSL_FAIL("::CreateExample() - exception caught"); + TOOLS_WARN_EXCEPTION( "sw", "::CreateExample()"); } m_xExampleFrame->Invalidate(); } diff --git a/sw/source/uibase/dbui/mailmergehelper.cxx b/sw/source/uibase/dbui/mailmergehelper.cxx index 19318862a4cd..0d086e9c8b29 100644 --- a/sw/source/uibase/dbui/mailmergehelper.cxx +++ b/sw/source/uibase/dbui/mailmergehelper.cxx @@ -36,6 +36,7 @@ #include #include #include +#include #include @@ -154,7 +155,7 @@ uno::Reference< mail::XSmtpService > ConnectToSmtpServer( } catch (const uno::Exception&) { - OSL_FAIL("exception caught"); + TOOLS_WARN_EXCEPTION( "sw", ""); } return xSmtpServer; } @@ -258,7 +259,7 @@ OUString SwAddressPreview::FillData( } catch (const sdbc::SQLException&) { - OSL_FAIL("SQLException caught"); + TOOLS_WARN_EXCEPTION( "sw", ""); } } } diff --git a/sw/source/uibase/fldui/xfldui.cxx b/sw/source/uibase/fldui/xfldui.cxx index 96321fab72e0..ca5d62a54ec4 100644 --- a/sw/source/uibase/fldui/xfldui.cxx +++ b/sw/source/uibase/fldui/xfldui.cxx @@ -18,6 +18,7 @@ */ #include +#include #include #include #include @@ -108,7 +109,7 @@ bool SwFieldMgr::IsDBNumeric( const OUString& rDBName, const OUString& rTableQry } catch (const Exception&) { - OSL_FAIL("Exception in getColumns()"); + TOOLS_WARN_EXCEPTION( "sw", "getColumns()"); } if(xCols.is() && xCols->hasByName(rFieldName)) { diff --git a/sw/source/uibase/uno/dlelstnr.cxx b/sw/source/uibase/uno/dlelstnr.cxx index 76a66603928b..19a0aa34efb2 100644 --- a/sw/source/uibase/uno/dlelstnr.cxx +++ b/sw/source/uibase/uno/dlelstnr.cxx @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -62,7 +63,7 @@ SwLinguServiceEventListener::SwLinguServiceEventListener() } catch (const uno::Exception&) { - OSL_FAIL("exception caught in SwLinguServiceEventListener c-tor" ); + TOOLS_WARN_EXCEPTION( "sw", "SwLinguServiceEventListener c-tor" ); } } diff --git a/sw/source/uibase/uno/unomailmerge.cxx b/sw/source/uibase/uno/unomailmerge.cxx index 2e47a54e1256..65a4aabf5bf9 100644 --- a/sw/source/uibase/uno/unomailmerge.cxx +++ b/sw/source/uibase/uno/unomailmerge.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -259,7 +260,7 @@ namespace } catch (const Exception&) { - OSL_FAIL("DelayedFileDeletion::OnTryDeleteFile: caught a strange exception!" ); + TOOLS_WARN_EXCEPTION( "sw", "DelayedFileDeletion::OnTryDeleteFile: caught a strange exception!" ); bSuccess = true; // can't do anything here ... } -- cgit