basctl/source/basicide/macrodlg.cxx                    |    2 +-
 chart2/source/controller/sidebar/ChartColorWrapper.cxx |    1 +
 extensions/source/bibliography/general.cxx             |    1 +
 include/comphelper/scopeguard.hxx                      |    4 +++-
 include/o3tl/deleter.hxx                               |   11 +----------
 include/xmloff/xmlictxt.hxx                            |    1 +
 sc/source/core/data/table2.cxx                         |    1 +
 sc/source/core/tool/autoform.cxx                       |    1 +
 sc/source/filter/excel/xepivotxml.cxx                  |    1 +
 sc/source/filter/html/htmlpars.cxx                     |    1 +
 sc/source/ui/view/gridwin.cxx                          |    1 +
 sd/qa/unit/tiledrendering/tiledrendering.cxx           |    1 +
 sd/source/ui/dlg/sdtreelb.cxx                          |    1 +
 sfx2/source/appl/workwin.cxx                           |    2 +-
 14 files changed, 16 insertions(+), 13 deletions(-)

New commits:
commit 0a710c5c4475b593428c6d90e791ef2ccc880062
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Mon Dec 6 09:55:45 2021 +0100
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Mon Dec 6 14:25:41 2021 +0100

    cid#1494595,1494597: Silence UNCAUGHT_EXCEPT
    
    ...after aa5ee0085c7d8b8713f4dbed0009b38b9fabb281 "Stop swallowing 
exceptions in
    ~ScopeGuard" had dropped the catch blocks from ~ScopeGuard to make it 
usable in
    Library_salhelper in 0c1c300ed7ce168755ae945822eb7a1c610cfa25 "Rather use
    ScopeGuard to prevent catch and rethrow".  But using the original
    suppress_fun_call_w_exception, which used css::uno::Exception, would have 
caused
    the same circular-dependency issue again that
    aa5ee0085c7d8b8713f4dbed0009b38b9fabb281 had solved, so drop the use of
    css::uno::Exception (and SAL_WARN, which triggered a number of missing 
#include
    <sal/log.hxx>) also from suppress_fun_call_w_exception.  After all, that was
    __COVERITY__-only code that wasn't meant to be actually run, so it shouldn't
    matter if we just catch everything and silently terminate.
    
    Change-Id: If28a214709e4636e1c23a49f2d95d87c91492f14
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126404
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/basctl/source/basicide/macrodlg.cxx 
b/basctl/source/basicide/macrodlg.cxx
index 511abf83591e..dbeaf396f3f3 100644
--- a/basctl/source/basicide/macrodlg.cxx
+++ b/basctl/source/basicide/macrodlg.cxx
@@ -31,7 +31,7 @@
 #include <basic/sbmeth.hxx>
 #include <basic/sbmod.hxx>
 #include <com/sun/star/script/XLibraryContainer2.hpp>
-
+#include <sal/log.hxx>
 #include <sfx2/app.hxx>
 #include <sfx2/dispatch.hxx>
 #include <sfx2/frame.hxx>
diff --git a/chart2/source/controller/sidebar/ChartColorWrapper.cxx 
b/chart2/source/controller/sidebar/ChartColorWrapper.cxx
index 613407a827e7..9340ed1c2028 100644
--- a/chart2/source/controller/sidebar/ChartColorWrapper.cxx
+++ b/chart2/source/controller/sidebar/ChartColorWrapper.cxx
@@ -27,6 +27,7 @@
 #include <svx/unomid.hxx>
 
 #include <comphelper/lok.hxx>
+#include <sal/log.hxx>
 #include <sfx2/viewsh.hxx>
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
 
diff --git a/extensions/source/bibliography/general.cxx 
b/extensions/source/bibliography/general.cxx
index 5fd46955c54a..4307d9f206d2 100644
--- a/extensions/source/bibliography/general.cxx
+++ b/extensions/source/bibliography/general.cxx
@@ -29,6 +29,7 @@
 #include <com/sun/star/uri/UriReferenceFactory.hpp>
 
 #include <o3tl/safeint.hxx>
+#include <sal/log.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
 #include <cppuhelper/implbase.hxx>
 #include <vcl/event.hxx>
diff --git a/include/comphelper/scopeguard.hxx 
b/include/comphelper/scopeguard.hxx
index 72ae4a699d16..95832c505bf2 100644
--- a/include/comphelper/scopeguard.hxx
+++ b/include/comphelper/scopeguard.hxx
@@ -24,6 +24,8 @@
 
 #include <utility>
 
+#include <o3tl/deleter.hxx>
+
 // For some reason, Android buildbot issues -Werror like this:
 //   In file included from
 //   
/home/android/lo/master-android-arm/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx:50:
@@ -60,7 +62,7 @@ public:
     {
         if (m_bDismissed)
             return;
-        m_func();
+        suppress_fun_call_w_exception(m_func());
     }
 
     /** Dismisses the scope guard, i.e. the function won't
diff --git a/include/o3tl/deleter.hxx b/include/o3tl/deleter.hxx
index ed8b1a583094..96f9b4b49274 100644
--- a/include/o3tl/deleter.hxx
+++ b/include/o3tl/deleter.hxx
@@ -14,9 +14,6 @@
 
 #include <cstdlib>
 
-#include <com/sun/star/uno/Exception.hpp>
-#include <sal/log.hxx>
-
 #if defined(__COVERITY__)
 #define suppress_fun_call_w_exception(expr)                                    
                    \
     do                                                                         
                    \
@@ -25,14 +22,8 @@
         {                                                                      
                    \
             expr;                                                              
                    \
         }                                                                      
                    \
-        catch (const css::uno::Exception& ex)                                  
                    \
-        {                                                                      
                    \
-            SAL_WARN("vcl.app", "Fatal exception: " << exceptionToString(ex)); 
                    \
-            std::terminate();                                                  
                    \
-        }                                                                      
                    \
-        catch (const std::exception& e)                                        
                    \
+        catch (...)                                                            
                    \
         {                                                                      
                    \
-            SAL_WARN("vcl.app", "Fatal exception: " << e.what());              
                    \
             std::terminate();                                                  
                    \
         }                                                                      
                    \
     } while (false)
diff --git a/include/xmloff/xmlictxt.hxx b/include/xmloff/xmlictxt.hxx
index 0b25efe97e5f..7ff91aa84d7e 100644
--- a/include/xmloff/xmlictxt.hxx
+++ b/include/xmloff/xmlictxt.hxx
@@ -22,6 +22,7 @@
 
 #include <sal/config.h>
 #include <xmloff/dllapi.h>
+#include <sal/log.hxx>
 #include <sal/types.h>
 #include <com/sun/star/xml/sax/XFastContextHandler.hpp>
 #include <com/sun/star/lang/XTypeProvider.hpp>
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 8e1cbf009032..a72414c0e40b 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -60,6 +60,7 @@
 #include <o3tl/safeint.hxx>
 #include <o3tl/unit_conversion.hxx>
 #include <osl/diagnose.h>
+#include <sal/log.hxx>
 #include <svl/poolcach.hxx>
 #include <unotools/charclass.hxx>
 #include <math.h>
diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx
index e55b2028001c..a6b1094fb3ca 100644
--- a/sc/source/core/tool/autoform.cxx
+++ b/sc/source/core/tool/autoform.cxx
@@ -20,6 +20,7 @@
 #include <memory>
 #include <autoform.hxx>
 
+#include <sal/log.hxx>
 #include <sfx2/docfile.hxx>
 #include <unotools/pathoptions.hxx>
 #include <svl/intitem.hxx>
diff --git a/sc/source/filter/excel/xepivotxml.cxx 
b/sc/source/filter/excel/xepivotxml.cxx
index 5fe7bd257e31..4bd34041328a 100644
--- a/sc/source/filter/excel/xepivotxml.cxx
+++ b/sc/source/filter/excel/xepivotxml.cxx
@@ -24,6 +24,7 @@
 #include <o3tl/safeint.hxx>
 #include <oox/export/utils.hxx>
 #include <oox/token/namespaces.hxx>
+#include <sal/log.hxx>
 #include <sax/tools/converter.hxx>
 #include <sax/fastattribs.hxx>
 #include <svl/numformat.hxx>
diff --git a/sc/source/filter/html/htmlpars.cxx 
b/sc/source/filter/html/htmlpars.cxx
index 2dabd09d10b4..e64fa6fbb921 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -36,6 +36,7 @@
 #include <editeng/borderline.hxx>
 #include <editeng/boxitem.hxx>
 #include <editeng/justifyitem.hxx>
+#include <sal/log.hxx>
 #include <sfx2/objsh.hxx>
 #include <svl/numformat.hxx>
 #include <svl/intitem.hxx>
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 235bcb37db75..ad779997bde7 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -22,6 +22,7 @@
 #include <cstdlib>
 #include <memory>
 #include <editeng/adjustitem.hxx>
+#include <sal/log.hxx>
 #include <sot/storage.hxx>
 #include <editeng/eeitem.hxx>
 #include <editeng/editobj.hxx>
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx 
b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 571eafb0b08c..166859cb87d5 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -17,6 +17,7 @@
 #include <test/xmltesttools.hxx>
 #include <boost/property_tree/json_parser.hpp>
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
+#include <sal/log.hxx>
 #include <sfx2/lokhelper.hxx>
 #include <com/sun/star/frame/Desktop.hpp>
 #include <comphelper/dispatchcommand.hxx>
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index e181c58accdb..d8848780bd20 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <sal/log.hxx>
 #include <sal/types.h>
 #include <sot/formats.hxx>
 #include <vcl/weld.hxx>
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index 4e44acf04908..ef9f546c20fa 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -22,7 +22,7 @@
 #include <comphelper/lok.hxx>
 #include <comphelper/processfactory.hxx>
 #include <osl/diagnose.h>
-
+#include <sal/log.hxx>
 #include <sfx2/docfile.hxx>
 #include <sfx2/objface.hxx>
 #include <sfx2/objsh.hxx>

Reply via email to