diff options
author | Noel <noelgrandin@gmail.com> | 2020-11-30 14:19:29 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-12-01 09:28:52 +0100 |
commit | d6d80c4e1783b4459bd4a8fbcbdfeebe416c1cb5 (patch) | |
tree | 995c41a30f4224233267a8cfb05da41ae8c10275 /sc | |
parent | 102fdc08b86599b9e538d2f38df865d56b3ec63d (diff) |
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/dpobject.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/data/globalx.cxx | 7 | ||||
-rw-r--r-- | sc/source/core/tool/charthelper.cxx | 3 | ||||
-rw-r--r-- | sc/source/core/tool/chartlock.cxx | 7 | ||||
-rw-r--r-- | sc/source/filter/oox/pivottablebuffer.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/dataprovider/sqldataprovider.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/dbgui/dapidata.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/docshell/dbdocimp.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh4.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh8.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/sharedocdlg.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/unoobj/celllistsource.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/unoobj/cellsuno.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/unoobj/cellvaluebinding.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/unoobj/shapeuno.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwshb.cxx | 3 |
17 files changed, 43 insertions, 28 deletions
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index ba1a8f4d398e..f9951cb8da04 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -772,7 +772,7 @@ void ScDPObject::CreateObjects() } catch(uno::Exception&) { - OSL_FAIL("exception in refresh"); + TOOLS_WARN_EXCEPTION( "sc", "exception in refresh"); } } @@ -3266,7 +3266,7 @@ uno::Reference<sdbc::XRowSet> ScDPCollection::DBCaches::createRowSet( } catch ( uno::Exception& ) { - OSL_FAIL("Unexpected exception in database"); + TOOLS_WARN_EXCEPTION( "sc", "Unexpected exception in database"); } xRowSet.set(nullptr); diff --git a/sc/source/core/data/globalx.cxx b/sc/source/core/data/globalx.cxx index 04f587d4df5e..554d59d7adab 100644 --- a/sc/source/core/data/globalx.cxx +++ b/sc/source/core/data/globalx.cxx @@ -22,6 +22,7 @@ #include <osl/diagnose.h> #include <osl/file.hxx> #include <tools/urlobj.hxx> +#include <tools/diagnose_ex.h> #include <ucbhelper/content.hxx> #include <unotools/pathoptions.hxx> @@ -100,13 +101,13 @@ void ScGlobal::InitAddIns() } catch ( Exception& ) { - OSL_FAIL( "ResultSetException caught!" ); + TOOLS_WARN_EXCEPTION( "sc", "" ); } } } catch ( Exception& ) { - OSL_FAIL( "Exception caught!" ); + TOOLS_WARN_EXCEPTION( "sc", "" ); } catch ( ... ) { @@ -133,7 +134,7 @@ OUString ScGlobal::GetOrdinalSuffix( sal_Int32 nNumber) } catch ( Exception& ) { - OSL_FAIL( "GetOrdinalSuffix: exception caught during init" ); + TOOLS_WARN_EXCEPTION( "sc", "GetOrdinalSuffix: exception caught during init" ); } return OUString(); } diff --git a/sc/source/core/tool/charthelper.cxx b/sc/source/core/tool/charthelper.cxx index 54ace0282c44..aeb3c53bdc80 100644 --- a/sc/source/core/tool/charthelper.cxx +++ b/sc/source/core/tool/charthelper.cxx @@ -28,6 +28,7 @@ #include <svx/svdoole2.hxx> #include <svx/svdpage.hxx> #include <svtools/embedhlp.hxx> +#include <tools/diagnose_ex.h> #include <com/sun/star/chart2/XChartDocument.hpp> #include <com/sun/star/chart2/data/XDataReceiver.hpp> @@ -271,7 +272,7 @@ void ScChartHelper::SetChartRanges( const uno::Reference< chart2::XChartDocument } catch (const uno::Exception&) { - OSL_FAIL("Exception in ScChartHelper::SetChartRanges - invalid range string?"); + TOOLS_WARN_EXCEPTION( "sc", "Exception in ScChartHelper::SetChartRanges - invalid range string?"); } xChartDoc->unlockControllers(); diff --git a/sc/source/core/tool/chartlock.cxx b/sc/source/core/tool/chartlock.cxx index 2ac1a3759ad7..9b0338b95628 100644 --- a/sc/source/core/tool/chartlock.cxx +++ b/sc/source/core/tool/chartlock.cxx @@ -20,6 +20,7 @@ #include <svx/svditer.hxx> #include <svx/svdoole2.hxx> #include <svx/svdpage.hxx> +#include <tools/diagnose_ex.h> #include <chartlock.hxx> #include <document.hxx> @@ -92,7 +93,7 @@ ScChartLockGuard::ScChartLockGuard( ScDocument* pDoc ) : } catch ( uno::Exception& ) { - OSL_FAIL("Unexpected exception in ScChartLockGuard"); + TOOLS_WARN_EXCEPTION( "sc", "Unexpected exception in ScChartLockGuard"); } } } @@ -109,7 +110,7 @@ ScChartLockGuard::~ScChartLockGuard() } catch ( uno::Exception& ) { - OSL_FAIL("Unexpected exception in ScChartLockGuard"); + TOOLS_WARN_EXCEPTION( "sc", "Unexpected exception in ScChartLockGuard"); } } } @@ -133,7 +134,7 @@ void ScChartLockGuard::AlsoLockThisChart( const Reference< frame::XModel >& xMod } catch ( uno::Exception& ) { - OSL_FAIL("Unexpected exception in ScChartLockGuard"); + TOOLS_WARN_EXCEPTION( "sc", "Unexpected exception in ScChartLockGuard"); } } } diff --git a/sc/source/filter/oox/pivottablebuffer.cxx b/sc/source/filter/oox/pivottablebuffer.cxx index 6469f8da70be..46d8075197db 100644 --- a/sc/source/filter/oox/pivottablebuffer.cxx +++ b/sc/source/filter/oox/pivottablebuffer.cxx @@ -39,6 +39,7 @@ #include <com/sun/star/sheet/XSheetOperation.hpp> #include <com/sun/star/xml/sax/XFastAttributeList.hpp> #include <osl/diagnose.h> +#include <tools/diagnose_ex.h> #include <sal/log.hxx> #include <oox/helper/binaryinputstream.hxx> #include <oox/helper/attributelist.hxx> @@ -1313,7 +1314,7 @@ void PivotTable::finalizeImport() } catch( Exception& ) { - OSL_FAIL( "PivotTable::finalizeImport - exception while creating the DataPilot table" ); + TOOLS_WARN_EXCEPTION( "sc", "PivotTable::finalizeImport - exception while creating the DataPilot table" ); } } diff --git a/sc/source/ui/dataprovider/sqldataprovider.cxx b/sc/source/ui/dataprovider/sqldataprovider.cxx index 05472865fbb7..313f64a76c5d 100644 --- a/sc/source/ui/dataprovider/sqldataprovider.cxx +++ b/sc/source/ui/dataprovider/sqldataprovider.cxx @@ -21,6 +21,7 @@ #include <vcl/svapp.hxx> #include <comphelper/processfactory.hxx> #include <osl/diagnose.h> +#include <tools/diagnose_ex.h> using namespace css; using namespace ::com::sun::star::beans; @@ -109,7 +110,7 @@ void SQLFetchThread::execute() } catch (uno::Exception&) { - OSL_FAIL("exception in database"); + TOOLS_WARN_EXCEPTION("sc", "exception in database"); } for (auto& itr : maDataTransformations) diff --git a/sc/source/ui/dbgui/dapidata.cxx b/sc/source/ui/dbgui/dapidata.cxx index 8e97a1d93465..43b8f296e072 100644 --- a/sc/source/ui/dbgui/dapidata.cxx +++ b/sc/source/ui/dbgui/dapidata.cxx @@ -21,6 +21,7 @@ #include <comphelper/processfactory.hxx> #include <osl/diagnose.h> +#include <tools/diagnose_ex.h> #include <com/sun/star/sheet/DataImportMode.hpp> #include <com/sun/star/sdbcx/XTablesSupplier.hpp> @@ -61,7 +62,7 @@ ScDataPilotDatabaseDlg::ScDataPilotDatabaseDlg(weld::Window* pParent) } catch(uno::Exception&) { - OSL_FAIL("exception in database"); + TOOLS_WARN_EXCEPTION( "sc", "exception in database"); } m_xLbDatabase->set_active(0); @@ -162,7 +163,7 @@ void ScDataPilotDatabaseDlg::FillObjects() catch(uno::Exception&) { // this may happen if an invalid database is selected -> no DBG_ERROR - OSL_FAIL("exception in database"); + TOOLS_WARN_EXCEPTION( "sc", "exception in database"); } } diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx index edc242b8ccc5..2baf0d901ee3 100644 --- a/sc/source/ui/docshell/dbdocimp.cxx +++ b/sc/source/ui/docshell/dbdocimp.cxx @@ -26,6 +26,7 @@ #include <sfx2/viewfrm.hxx> #include <sal/log.hxx> #include <osl/diagnose.h> +#include <tools/diagnose_ex.h> #include <com/sun/star/sdb/CommandType.hpp> #include <com/sun/star/sdb/XCompletedExecution.hpp> @@ -366,7 +367,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, } catch ( uno::Exception& ) { - OSL_FAIL("Unexpected exception in database"); + TOOLS_WARN_EXCEPTION( "sc", "Unexpected exception in database"); } // test for cell protection diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 0d7345e29fcc..1e74a5c01a9e 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -65,6 +65,7 @@ #include <com/sun/star/util/VetoException.hpp> #include <com/sun/star/lang/XSingleComponentFactory.hpp> #include <ooo/vba/excel/XWorkbook.hpp> +#include <tools/diagnose_ex.h> #include <config_folders.h> @@ -956,7 +957,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) } catch ( uno::Exception& ) { - OSL_FAIL( "SfxEventHintId::SaveDoc: caught exception" ); + TOOLS_WARN_EXCEPTION( "sc", "SfxEventHintId::SaveDoc" ); SC_MOD()->SetInSharedDocSaving( false ); try diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 7c1c3d430686..9800f873b8ae 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -56,6 +56,7 @@ using namespace ::com::sun::star; #include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <sal/log.hxx> #include <unotools/charclass.hxx> +#include <tools/diagnose_ex.h> #include <comphelper/lok.hxx> #include <comphelper/processfactory.hxx> @@ -1121,7 +1122,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) } catch ( uno::Exception& ) { - OSL_FAIL( "SID_SHARE_DOC: caught exception" ); + TOOLS_WARN_EXCEPTION( "sc", "SID_SHARE_DOC" ); SC_MOD()->SetInSharedDocSaving( false ); try diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index f6f0fe459c7b..09dd62e67045 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -213,7 +213,7 @@ bool ScDocShell::IsDocument( const INetURLObject& rURL ) catch( uno::Exception& ) { // ucb may throw different exceptions on failure now - warning only - OSL_FAIL( "Any other exception" ); + TOOLS_WARN_EXCEPTION( "sc", "Any other exception" ); } return bRet; @@ -427,7 +427,7 @@ ErrCode ScDocShell::DBaseImport( const OUString& rFullFileName, rtl_TextEncoding } catch ( uno::Exception& ) { - OSL_FAIL("Unexpected exception in database"); + TOOLS_WARN_EXCEPTION( "sc", "Unexpected exception in database"); nErr = ERRCODE_IO_GENERAL; } @@ -1071,7 +1071,7 @@ ErrCode ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncoding } catch ( uno::Exception& ) { - OSL_FAIL("Unexpected exception in database"); + TOOLS_WARN_EXCEPTION( "sc", "Unexpected exception in database"); nErr = ERRCODE_IO_GENERAL; } diff --git a/sc/source/ui/miscdlgs/sharedocdlg.cxx b/sc/source/ui/miscdlgs/sharedocdlg.cxx index 432bc6234488..9f1a6e16185b 100644 --- a/sc/source/ui/miscdlgs/sharedocdlg.cxx +++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx @@ -22,6 +22,7 @@ #include <sfx2/dialoghelper.hxx> #include <svl/sharecontrolfile.hxx> #include <unotools/useroptions.hxx> +#include <tools/diagnose_ex.h> #include <docsh.hxx> @@ -159,7 +160,7 @@ void ScShareDocumentDlg::UpdateView() } catch ( uno::Exception& ) { - OSL_FAIL( "ScShareDocumentDlg::UpdateView(): caught exception" ); + TOOLS_WARN_EXCEPTION( "sc", "ScShareDocumentDlg::UpdateView()" ); m_xLbUsers->clear(); m_xLbUsers->append_text(m_aStrNoUserData); } diff --git a/sc/source/ui/unoobj/celllistsource.cxx b/sc/source/ui/unoobj/celllistsource.cxx index e8591c1732b2..39e17f79ca55 100644 --- a/sc/source/ui/unoobj/celllistsource.cxx +++ b/sc/source/ui/unoobj/celllistsource.cxx @@ -31,6 +31,7 @@ #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/beans/NamedValue.hpp> #include <cppuhelper/supportsservice.hxx> +#include <tools/diagnose_ex.h> namespace calc { @@ -327,7 +328,7 @@ namespace calc } catch( const Exception& ) { - OSL_FAIL( "OCellListSource::notifyModified: caught a (non-runtime) exception!" ); + TOOLS_WARN_EXCEPTION( "sc", "OCellListSource::notifyModified: caught a (non-runtime) exception!" ); } } @@ -399,7 +400,7 @@ namespace calc } catch( const Exception& ) { - OSL_FAIL( "OCellListSource::initialize: caught an exception while retrieving the cell object!" ); + TOOLS_WARN_EXCEPTION( "sc", "OCellListSource::initialize: caught an exception while retrieving the cell object!" ); } if ( !m_xRange.is() ) diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 8c00ecc12402..91f9666f1f6c 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -43,6 +43,7 @@ #include <svl/zformat.hxx> #include <cppuhelper/supportsservice.hxx> #include <float.h> +#include <tools/diagnose_ex.h> #include <com/sun/star/awt/XBitmap.hpp> #include <com/sun/star/util/CellProtection.hpp> @@ -2599,7 +2600,7 @@ void SAL_CALL ScCellRangesBase::setPropertyValues( const uno::Sequence< OUString } catch ( lang::IllegalArgumentException& ) { - OSL_FAIL("exception when setting cell style"); // not supposed to happen + TOOLS_WARN_EXCEPTION( "sc", "exception when setting cell style"); // not supposed to happen } } } @@ -2734,7 +2735,7 @@ uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL ScCellRangesBase::set } catch ( lang::IllegalArgumentException& ) { - OSL_FAIL("exception when setting cell style"); // not supposed to happen + TOOLS_WARN_EXCEPTION( "sc", "exception when setting cell style"); // not supposed to happen } } } diff --git a/sc/source/ui/unoobj/cellvaluebinding.cxx b/sc/source/ui/unoobj/cellvaluebinding.cxx index 242ba364137c..ba72cf8e6c51 100644 --- a/sc/source/ui/unoobj/cellvaluebinding.cxx +++ b/sc/source/ui/unoobj/cellvaluebinding.cxx @@ -35,6 +35,7 @@ #include <com/sun/star/util/NumberFormat.hpp> #include <cppuhelper/supportsservice.hxx> #include <comphelper/types.hxx> +#include <tools/diagnose_ex.h> namespace calc { @@ -465,7 +466,7 @@ namespace calc } catch( const Exception& ) { - OSL_FAIL( "OCellValueBinding::notifyModified: caught a (non-runtime) exception!" ); + TOOLS_WARN_EXCEPTION( "sc", "OCellValueBinding::notifyModified: caught a (non-runtime) exception!" ); } } } @@ -540,7 +541,7 @@ namespace calc } catch( const Exception& ) { - OSL_FAIL( "OCellValueBinding::initialize: caught an exception while retrieving the cell object!" ); + TOOLS_WARN_EXCEPTION( "sc", "OCellValueBinding::initialize: caught an exception while retrieving the cell object!" ); } if ( !m_xCell.is() ) diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx index 63ab40f753a7..fa5bb8359334 100644 --- a/sc/source/ui/unoobj/shapeuno.cxx +++ b/sc/source/ui/unoobj/shapeuno.cxx @@ -31,6 +31,7 @@ #include <toolkit/helper/convert.hxx> #include <cppuhelper/implbase.hxx> #include <cppuhelper/supportsservice.hxx> +#include <tools/diagnose_ex.h> #include <com/sun/star/drawing/XShape.hpp> #include <com/sun/star/lang/NoSupportException.hpp> @@ -1077,7 +1078,7 @@ static void lcl_CopyOneProperty( beans::XPropertySet& rDest, beans::XPropertySet } catch (uno::Exception&) { - OSL_FAIL("Exception in text field"); + TOOLS_WARN_EXCEPTION( "sc", "Exception in text field"); } } diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index cfeedaf81bfc..d0006564d53e 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -47,6 +47,7 @@ #include <svl/whiter.hxx> #include <unotools/moduleoptions.hxx> #include <sot/exchange.hxx> +#include <tools/diagnose_ex.h> #include <tabvwsh.hxx> #include <scmod.hxx> @@ -240,7 +241,7 @@ void ScTabViewShell::ActivateObject( SdrOle2Obj* pObj, tools::Long nVerb ) } catch( const uno::Exception & ) { - OSL_FAIL( "Exception caught while querying chart" ); + TOOLS_WARN_EXCEPTION( "sc", "Exception caught while querying chart" ); } } } |