[Libreoffice-commits] core.git: 2 commits - writerfilter/source xmlhelp/Library_ucpchelp1.mk xmlhelp/source xmloff/source xmlsecurity/source xmlsecurity/workben

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 18 18:05:02 UTC 2019


 writerfilter/source/dmapper/DomainMapper.cxx             |    4 -
 writerfilter/source/dmapper/DomainMapperTableHandler.cxx |   15 ++---
 writerfilter/source/dmapper/DomainMapper_Impl.cxx        |   27 ++++------
 writerfilter/source/dmapper/GraphicImport.cxx            |    9 +--
 writerfilter/source/dmapper/NumberingManager.cxx         |   13 ++--
 writerfilter/source/dmapper/OLEHandler.cxx               |    9 +--
 writerfilter/source/dmapper/PropertyMap.cxx              |    4 -
 writerfilter/source/dmapper/StyleSheetTable.cxx          |    4 -
 writerfilter/source/dmapper/TableManager.cxx             |    5 +
 writerfilter/source/filter/RtfFilter.cxx                 |    5 +
 writerfilter/source/ooxml/OOXMLDocumentImpl.cxx          |   36 ++++++-------
 writerfilter/source/rtftok/rtfdocumentimpl.cxx           |    6 +-
 xmlhelp/Library_ucpchelp1.mk                             |    1 
 xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx    |    5 +
 xmloff/source/chart/SchXMLChartContext.cxx               |    9 +--
 xmloff/source/chart/SchXMLExport.cxx                     |   40 +++++++--------
 xmloff/source/chart/SchXMLImport.cxx                     |    4 -
 xmloff/source/chart/SchXMLPlotAreaContext.cxx            |   18 +++---
 xmloff/source/chart/SchXMLSeries2Context.cxx             |   16 +++---
 xmloff/source/chart/SchXMLSeriesHelper.cxx               |    8 +--
 xmloff/source/core/DocumentSettingsContext.cxx           |    7 +-
 xmloff/source/draw/animationexport.cxx                   |    5 +
 xmloff/source/draw/shapeexport.cxx                       |    4 -
 xmloff/source/style/XMLFontAutoStylePool.cxx             |    5 +
 xmloff/source/text/XMLTextFrameContext.cxx               |   11 ++--
 xmloff/source/text/txtparai.cxx                          |    5 +
 xmlsecurity/source/helper/documentsignaturehelper.cxx    |    5 +
 xmlsecurity/source/xmlsec/nss/nssinitializer.cxx         |    5 +
 xmlsecurity/workben/pdfverify.cxx                        |   13 ++--
 29 files changed, 156 insertions(+), 142 deletions(-)

New commits:
commit 2836b78b54650d117282a9a345677d1b4d9fc043
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Jun 18 15:38:17 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jun 18 20:03:42 2019 +0200

    loplugin:logexceptionnicely in xmlhelp..xmlsecurity
    
    Change-Id: Idbf0de3f953b08f98144241346533ad30f49269e
    Reviewed-on: https://gerrit.libreoffice.org/74285
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/xmlhelp/Library_ucpchelp1.mk b/xmlhelp/Library_ucpchelp1.mk
index e12aabf96326..b76e0eb67c23 100644
--- a/xmlhelp/Library_ucpchelp1.mk
+++ b/xmlhelp/Library_ucpchelp1.mk
@@ -36,6 +36,7 @@ $(eval $(call gb_Library_use_libraries,ucpchelp1,\
 	cppuhelper \
 	helplinker \
 	sal \
+	tl \
 	ucbhelper \
 	utl \
 	i18nlangtag \
diff --git a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx
index ac464c6d02c3..d599a217446d 100644
--- a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx
+++ b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx
@@ -26,6 +26,7 @@
 #include <com/sun/star/lang/Locale.hpp>
 
 #include <helpcompiler/HelpSearch.hxx>
+#include <tools/diagnose_ex.h>
 
 #if defined(__GNUC__)
 #  pragma GCC visibility push (default)
@@ -234,9 +235,9 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentConte
 
             aIndexFolderResultVectorVector.push_back( std::move(aIndexFolderResultVector) );
         }
-        catch (const Exception &e)
+        catch (const Exception &)
         {
-            SAL_WARN("xmlhelp", e);
+            TOOLS_WARN_EXCEPTION("xmlhelp", "");
         }
 
         if( bTemporary )
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx
index 6cc3a29a7828..df143274ac32 100644
--- a/xmloff/source/chart/SchXMLChartContext.cxx
+++ b/xmloff/source/chart/SchXMLChartContext.cxx
@@ -27,6 +27,7 @@
 #include "SchXMLTools.hxx"
 #include <osl/diagnose.h>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 #include <unotools/mediadescriptor.hxx>
 #include <xmloff/xmlnmspe.hxx>
 #include <xmloff/xmlement.hxx>
@@ -165,9 +166,9 @@ void lcl_removeEmptyChartTypeGroups( const uno::Reference< chart2::XChartDocumen
             }
         }
     }
-    catch(const uno::Exception& ex)
+    catch(const uno::Exception&)
     {
-        SAL_INFO("xmloff.chart", "Exception caught while removing empty chart types: " << ex);
+        TOOLS_INFO_EXCEPTION("xmloff.chart", "Exception caught while removing empty chart types");
     }
 }
 
@@ -301,9 +302,9 @@ static void lcl_setDataProvider(uno::Reference<chart2::XChartDocument> const & x
                 xChartDoc->createInternalDataProvider(false);
         }
     }
-    catch (const uno::Exception & rEx)
+    catch (const uno::Exception &)
     {
-        SAL_INFO("xmloff.chart", "SchXMLChartContext::StartElement(): Exception caught: " << rEx);
+        TOOLS_INFO_EXCEPTION("xmloff.chart", "SchXMLChartContext::StartElement()");
     }
 }
 
diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx
index b1785d5330f4..46214498958b 100644
--- a/xmloff/source/chart/SchXMLExport.cxx
+++ b/xmloff/source/chart/SchXMLExport.cxx
@@ -853,9 +853,9 @@ lcl_TableData lcl_getDataForLocalTable(
                 rTarget[i] <<= rSource[i];
         }
     }
-    catch( const uno::Exception & rEx )
+    catch( const uno::Exception & )
     {
-        SAL_INFO("xmloff.chart", "something went wrong during table data collection: " << rEx);
+        TOOLS_INFO_EXCEPTION("xmloff.chart", "something went wrong during table data collection");
     }
 
     return aResult;
@@ -899,9 +899,9 @@ void lcl_exportNumberFormat( const OUString& rPropertyName, const Reference< bea
                 }
             }
         }
-        catch( const uno::Exception & rEx )
+        catch( const uno::Exception & )
         {
-            SAL_INFO("xmloff.chart", "chart:exporting error bar ranges: " << rEx );
+            TOOLS_INFO_EXCEPTION("xmloff.chart", "chart:exporting error bar ranges" );
         }
     }
 
@@ -1433,9 +1433,9 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >
                 Any aShapesAny = xDocPropSet->getPropertyValue("AdditionalShapes");
                 aShapesAny >>= mxAdditionalShapes;
             }
-            catch( const uno::Exception & rEx )
+            catch( const uno::Exception & )
             {
-                SAL_INFO("xmloff.chart", "AdditionalShapes not found: " << rEx );
+                TOOLS_INFO_EXCEPTION("xmloff.chart", "AdditionalShapes not found" );
             }
 
             if( mxAdditionalShapes.is())
@@ -1882,9 +1882,9 @@ void SchXMLExportHelper_Impl::exportPlotArea(
                         rShapeExport->export3DSceneAttributes( xPropSet );
                 }
             }
-            catch( const uno::Exception & rEx )
+            catch( const uno::Exception & )
             {
-                SAL_INFO("xmloff.chart", "chart:exportPlotAreaException caught: " << rEx);
+                TOOLS_INFO_EXCEPTION("xmloff.chart", "chart:exportPlotAreaException caught");
             }
         }
 
@@ -2571,9 +2571,9 @@ void SchXMLExportHelper_Impl::exportSeries(
                                 xPropSet = SchXMLSeriesHelper::createOldAPISeriesPropertySet(
                                     aSeriesSeq[nSeriesIdx], mrExport.GetModel() );
                             }
-                            catch( const uno::Exception & rEx )
+                            catch( const uno::Exception & )
                             {
-                                SAL_INFO("xmloff.chart", "Series not found or no XPropertySet: " << rEx );
+                                TOOLS_INFO_EXCEPTION("xmloff.chart", "Series not found or no XPropertySet" );
                                 continue;
                             }
                             if( xPropSet.is())
@@ -2587,9 +2587,9 @@ void SchXMLExportHelper_Impl::exportSeries(
                                     aAny = xPropSet->getPropertyValue( "MeanValue" );
                                     aAny >>= bHasMeanValueLine;
                                 }
-                                catch( const beans::UnknownPropertyException & rEx )
+                                catch( const beans::UnknownPropertyException & )
                                 {
-                                    SAL_INFO("xmloff.chart", "Required property not found in DataRowProperties: " << rEx );
+                                    TOOLS_INFO_EXCEPTION("xmloff.chart", "Required property not found in DataRowProperties" );
                                 }
 
                                 const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() );
@@ -2756,9 +2756,9 @@ void SchXMLExportHelper_Impl::exportSeries(
                             Any aPropAny( xPropSet->getPropertyValue( "DataMeanValueProperties" ));
                             aPropAny >>= xStatProp;
                         }
-                        catch( const uno::Exception & rEx )
+                        catch( const uno::Exception & )
                         {
-                            SAL_INFO("xmloff.chart", "Exception caught during Export of series - optional DataMeanValueProperties not available: " << rEx );
+                            TOOLS_INFO_EXCEPTION("xmloff.chart", "Exception caught during Export of series - optional DataMeanValueProperties not available" );
                         }
 
                         if( xStatProp.is() )
@@ -2994,9 +2994,9 @@ void SchXMLExportHelper_Impl::exportErrorBar( const Reference<beans::XPropertySe
                 aAny >>= nErrorBarStyle;
             }
         }
-        catch( const beans::UnknownPropertyException & rEx )
+        catch( const beans::UnknownPropertyException & )
         {
-            SAL_INFO("xmloff.chart", "Required property not found in DataRowProperties: " << rEx );
+            TOOLS_INFO_EXCEPTION("xmloff.chart", "Required property not found in DataRowProperties" );
         }
 
         if( nErrorBarStyle != chart::ErrorBarStyle::NONE && (bNegative || bPositive))
@@ -3213,9 +3213,9 @@ void SchXMLExportHelper_Impl::exportDataPoints(
                                 xSeries, nElement, mrExport.GetModel() );
                     bExportNumFmt = true;
                 }
-                catch( const uno::Exception & rEx )
+                catch( const uno::Exception & )
                 {
-                    SAL_INFO("xmloff.chart", "Exception caught during Export of data point: " << rEx );
+                    TOOLS_INFO_EXCEPTION("xmloff.chart", "Exception caught during Export of data point" );
                 }
             }
             else
@@ -3281,9 +3281,9 @@ void SchXMLExportHelper_Impl::exportDataPoints(
                 xPropSet = SchXMLSeriesHelper::createOldAPIDataPointPropertySet(
                                 xSeries, nCurrIndex, mrExport.GetModel() );
             }
-            catch( const uno::Exception & rEx )
+            catch( const uno::Exception & )
             {
-                SAL_INFO("xmloff.chart", "Exception caught during Export of data point: " << rEx );
+                TOOLS_INFO_EXCEPTION("xmloff.chart", "Exception caught during Export of data point" );
             }
             if( xPropSet.is())
             {
diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx
index 5d9507cf0a92..a571ecc636a1 100644
--- a/xmloff/source/chart/SchXMLImport.cxx
+++ b/xmloff/source/chart/SchXMLImport.cxx
@@ -611,9 +611,9 @@ void SAL_CALL SchXMLImport::setTargetDocument(const uno::Reference<lang::XCompon
             }
         }
     }
-    catch (const uno::Exception & rEx)
+    catch (const uno::Exception &)
     {
-        SAL_INFO("xmloff.chart", "SchXMLChartContext::StartElement(): Exception caught: " << rEx);
+        TOOLS_INFO_EXCEPTION("xmloff.chart", "SchXMLChartContext::StartElement(): Exception caught");
     }
 }
 
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
index 46fee917baf1..1cf2785030a1 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
@@ -28,6 +28,7 @@
 
 #include <comphelper/processfactory.hxx>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 #include <xmloff/xmlnmspe.hxx>
 #include <xmloff/xmlement.hxx>
 #include <xmloff/nmspmap.hxx>
@@ -116,9 +117,10 @@ void SchXML3DSceneAttributesHelper::getCameraDefaultFromDiagram( const uno::Refe
             maVUP.setZ( aCamGeo.vup.DirectionZ );
         }
     }
-    catch( const uno::Exception & rEx )
+    catch( const uno::Exception & )
     {
-        SAL_INFO("xmloff.chart", "Exception caught for property NumberOfLines: " << rEx);
+        css::uno::Any ex( cppu::getCaughtException() );
+        SAL_INFO("xmloff.chart", "Exception caught for property NumberOfLines: " << exceptionToString(ex));
     }
 }
 
@@ -382,9 +384,9 @@ void SchXMLPlotAreaContext::StartElement( const uno::Reference< xml::sax::XAttri
         xProp->getPropertyValue("NumberOfLines") >>= mnNumOfLinesProp;
         xProp->getPropertyValue("Volume") >>= mbStockHasVolume;
     }
-    catch( const uno::Exception & rEx )
+    catch( const uno::Exception & )
     {
-        SAL_INFO("xmloff.chart", "PlotAreaContext:EndElement(): Exception caught: " << rEx);
+        TOOLS_INFO_EXCEPTION("xmloff.chart", "PlotAreaContext:EndElement(): Exception caught");
     }
     } // if
 
@@ -552,9 +554,9 @@ void SchXMLPlotAreaContext::EndElement()
                 xDiaProp->setPropertyValue("NumberOfLines",
                                             uno::makeAny( mnNumOfLinesProp ));
             }
-            catch( const uno::Exception & rEx )
+            catch( const uno::Exception & )
             {
-                SAL_INFO("xmloff.chart", "Exception caught for property NumberOfLines: " << rEx);
+                TOOLS_INFO_EXCEPTION("xmloff.chart", "Exception caught for property NumberOfLines");
             }
         }
 
@@ -567,9 +569,9 @@ void SchXMLPlotAreaContext::EndElement()
                 xDiaProp->setPropertyValue("Volume",
                                             uno::makeAny( true ));
             }
-            catch( const uno::Exception & rEx )
+            catch( const uno::Exception & )
             {
-                SAL_INFO("xmloff.chart", "Exception caught for property Volume: " << rEx);
+                TOOLS_INFO_EXCEPTION("xmloff.chart", "Exception caught for property Volume");
             }
         }
     }
diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx
index c7a37c78ac00..857e47435c5c 100644
--- a/xmloff/source/chart/SchXMLSeries2Context.cxx
+++ b/xmloff/source/chart/SchXMLSeries2Context.cxx
@@ -860,9 +860,9 @@ void SchXMLSeries2Context::setStylesToSeries( SeriesDefaultsAndStyles& rSeriesDe
                     }
                 }
             }
-            catch( const uno::Exception & rEx )
+            catch( const uno::Exception & )
             {
-                SAL_INFO("xmloff.chart", "Exception caught during setting styles to series: " << rEx );
+                TOOLS_INFO_EXCEPTION("xmloff.chart", "Exception caught during setting styles to series" );
             }
         }
     }
@@ -926,9 +926,9 @@ void SchXMLSeries2Context::setStylesToRegressionCurves(
                 xRegCurveCont->addRegressionCurve( xRegCurve );
             }
         }
-        catch( const uno::Exception& rEx )
+        catch( const uno::Exception& )
         {
-            SAL_INFO("xmloff.chart", "Exception caught during setting styles to series: " << rEx );
+            TOOLS_INFO_EXCEPTION("xmloff.chart", "Exception caught during setting styles to series" );
         }
 
     }
@@ -995,9 +995,9 @@ void SchXMLSeries2Context::setStylesToStatisticsObjects( SeriesDefaultsAndStyles
                     }
                 }
             }
-            catch( const uno::Exception & rEx )
+            catch( const uno::Exception & )
             {
-                SAL_INFO("xmloff.chart", "Exception caught during setting styles to series: " << rEx );
+                TOOLS_INFO_EXCEPTION("xmloff.chart", "Exception caught during setting styles to series" );
             }
         }
     }
@@ -1090,9 +1090,9 @@ void SchXMLSeries2Context::setStylesToDataPoints( SeriesDefaultsAndStyles& rSeri
                         lcl_resetSymbolSizeForPointsIfNecessary( xPointProp, rImport, pPropStyleContext, pStylesCtxt );
                 }
             }
-            catch( const uno::Exception & rEx )
+            catch( const uno::Exception & )
             {
-                SAL_INFO("xmloff.chart", "Exception caught during setting styles to data points: " << rEx );
+                TOOLS_INFO_EXCEPTION("xmloff.chart", "Exception caught during setting styles to data points" );
             }
         }
     }   // styles iterator
diff --git a/xmloff/source/chart/SchXMLSeriesHelper.cxx b/xmloff/source/chart/SchXMLSeriesHelper.cxx
index 18d1dc93a65e..b206d10df4d8 100644
--- a/xmloff/source/chart/SchXMLSeriesHelper.cxx
+++ b/xmloff/source/chart/SchXMLSeriesHelper.cxx
@@ -180,9 +180,9 @@ uno::Reference< beans::XPropertySet > SchXMLSeriesHelper::createOldAPISeriesProp
                 }
             }
         }
-        catch( const uno::Exception & rEx )
+        catch( const uno::Exception & )
         {
-            SAL_INFO("xmloff.chart", "Exception caught SchXMLSeriesHelper::createOldAPISeriesPropertySet: " << rEx );
+            TOOLS_INFO_EXCEPTION("xmloff.chart", "Exception caught SchXMLSeriesHelper::createOldAPISeriesPropertySet" );
         }
     }
 
@@ -215,9 +215,9 @@ uno::Reference< beans::XPropertySet > SchXMLSeriesHelper::createOldAPIDataPointP
                 }
             }
         }
-        catch( const uno::Exception & rEx )
+        catch( const uno::Exception & )
         {
-            SAL_INFO("xmloff.chart", "Exception caught SchXMLSeriesHelper::createOldAPIDataPointPropertySet: " << rEx );
+            TOOLS_INFO_EXCEPTION("xmloff.chart", "Exception caught SchXMLSeriesHelper::createOldAPIDataPointPropertySet" );
         }
     }
 
diff --git a/xmloff/source/core/DocumentSettingsContext.cxx b/xmloff/source/core/DocumentSettingsContext.cxx
index ec3252251e3d..305d1d94853b 100644
--- a/xmloff/source/core/DocumentSettingsContext.cxx
+++ b/xmloff/source/core/DocumentSettingsContext.cxx
@@ -46,6 +46,7 @@
 #include <rtl/ustrbuf.hxx>
 #include <sal/log.hxx>
 #include <osl/diagnose.h>
+#include <tools/diagnose_ex.h>
 #include <unotools/configmgr.hxx>
 #include "xmlenums.hxx"
 
@@ -746,10 +747,10 @@ void XMLConfigItemMapIndexedContext::EndElement()
                             {
                                 xForbChars->setForbiddenCharacters( aLocale, aForbid );
                             }
-                            catch (uno::Exception const& e)
+                            catch (uno::Exception const&)
                             {
-                                SAL_WARN("xmloff.core",
-                                    "Exception while importing forbidden characters: " << e);
+                                TOOLS_WARN_EXCEPTION("xmloff.core",
+                                    "Exception while importing forbidden characters");
                             }
                         }
                     }
diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx
index 8055e01515fe..a55f1e991685 100644
--- a/xmloff/source/draw/animationexport.cxx
+++ b/xmloff/source/draw/animationexport.cxx
@@ -56,6 +56,7 @@
 #include <sax/tools/converter.hxx>
 #include <sal/log.hxx>
 #include <osl/diagnose.h>
+#include <tools/diagnose_ex.h>
 
 #include <xmloff/unointerfacetouniqueidentifiermapper.hxx>
 #include "sdxmlexp_impl.hxx"
@@ -537,9 +538,9 @@ static OUString lcl_StoreMediaAndGetURL(SvXMLExport & rExport, OUString const& r
 
             return urlPath;
         }
-        catch (uno::Exception const& e)
+        catch (uno::Exception const&)
         {
-            SAL_INFO("xmloff", "exception while storing embedded media: '" << e << "'");
+            TOOLS_INFO_EXCEPTION("xmloff", "exception while storing embedded media");
         }
         return OUString();
     }
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index d798a8a382a7..89a40effd932 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -3227,9 +3227,9 @@ lcl_StoreMediaAndGetURL(SvXMLExport & rExport,
 
             return urlPath;
         }
-        catch (uno::Exception const& e)
+        catch (uno::Exception const&)
         {
-            SAL_INFO("xmloff", "exception while storing embedded media: " << e);
+            TOOLS_INFO_EXCEPTION("xmloff", "exception while storing embedded media");
         }
         return OUString();
     }
diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx b/xmloff/source/style/XMLFontAutoStylePool.cxx
index 407f1ae8ecc6..d16997977f10 100644
--- a/xmloff/source/style/XMLFontAutoStylePool.cxx
+++ b/xmloff/source/style/XMLFontAutoStylePool.cxx
@@ -28,6 +28,7 @@
 #include <vcl/embeddedfontshelper.hxx>
 #include <osl/file.hxx>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/embed/ElementModes.hpp>
@@ -649,9 +650,9 @@ OUString XMLFontAutoStylePool::embedFontFile(OUString const & fileUrl, OUString
                 return sInternalName;
             }
         }
-    } catch( const Exception& e )
+    } catch( const Exception& )
     {
-        SAL_WARN( "xmloff", "Exception when embedding a font file:" << e );
+        TOOLS_WARN_EXCEPTION( "xmloff", "Exception when embedding a font file" );
     }
     return OUString();
 }
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx
index d317ee2808b5..4a7360abe482 100644
--- a/xmloff/source/text/XMLTextFrameContext.cxx
+++ b/xmloff/source/text/XMLTextFrameContext.cxx
@@ -19,6 +19,7 @@
 
 #include <osl/diagnose.h>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 #include <comphelper/base64.hxx>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/text/TextContentAnchorType.hpp>
@@ -699,9 +700,9 @@ void XMLTextFrameContext_Impl::Create()
         {
             xTextImportHelper->InsertTextContent(xTxtCntnt);
         }
-        catch (lang::IllegalArgumentException const& e)
+        catch (lang::IllegalArgumentException const&)
         {
-            SAL_WARN("xmloff.text", "Cannot import part of the text - probably an image in the text frame? " << e);
+            TOOLS_WARN_EXCEPTION("xmloff.text", "Cannot import part of the text - probably an image in the text frame?");
             return;
         }
     }
@@ -1294,10 +1295,10 @@ void XMLTextFrameContext_Impl::SetName()
             {
                 xNamed->setName(m_sOrigName);
             }
-            catch (uno::Exception const& e)
+            catch (uno::Exception const&)
             {   // fdo#71698 document contains 2 frames with same draw:name
-                SAL_INFO("xmloff.text", "SetName(): exception setting \""
-                        << m_sOrigName << "\": " << e);
+                TOOLS_INFO_EXCEPTION("xmloff.text", "SetName(): exception setting \""
+                        << m_sOrigName << "\"");
             }
         }
     }
diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx
index 03ed99fecb5c..8676390dabe6 100644
--- a/xmloff/source/text/txtparai.cxx
+++ b/xmloff/source/text/txtparai.cxx
@@ -25,6 +25,7 @@
 #include <rtl/ustring.hxx>
 #include <rtl/ustrbuf.hxx>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/text/XTextFrame.hpp>
@@ -2077,9 +2078,9 @@ void XMLParaContext::EndElement()
                         xTxtImport->GetText()->insertTextContent(
                             xAttrCursor, xContent, true );
                     }
-                    catch (uno::RuntimeException const& e)
+                    catch (uno::RuntimeException const&)
                     {
-                        SAL_INFO("xmloff.text", "could not insert index mark, presumably in editengine text " << e);
+                        TOOLS_INFO_EXCEPTION("xmloff.text", "could not insert index mark, presumably in editengine text");
                     }
                 }
                 break;
diff --git a/xmlsecurity/source/helper/documentsignaturehelper.cxx b/xmlsecurity/source/helper/documentsignaturehelper.cxx
index 66a058c1d3dd..37faa606c32f 100644
--- a/xmlsecurity/source/helper/documentsignaturehelper.cxx
+++ b/xmlsecurity/source/helper/documentsignaturehelper.cxx
@@ -39,6 +39,7 @@
 #include <rtl/uri.hxx>
 #include <sal/log.hxx>
 #include <svx/xoutbmp.hxx>
+#include <tools/diagnose_ex.h>
 #include <xmloff/attrlist.hxx>
 
 #include <xsecctl.hxx>
@@ -379,9 +380,9 @@ SignatureStreamHelper DocumentSignatureHelper::OpenSignatureStream(
             aHelper.xSignatureStorage = rxStore->openStorageElement("_xmlsignatures", nSubStorageOpenMode);
             aHelper.nStorageFormat = embed::StorageFormats::OFOPXML;
         }
-        catch (const io::IOException& rException)
+        catch (const io::IOException&)
         {
-            SAL_WARN_IF(nOpenMode != css::embed::ElementModes::READ, "xmlsecurity.helper", "DocumentSignatureHelper::OpenSignatureStream: " << rException);
+            TOOLS_WARN_EXCEPTION_IF(nOpenMode != css::embed::ElementModes::READ, "xmlsecurity.helper", "DocumentSignatureHelper::OpenSignatureStream:");
         }
     }
 
diff --git a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx
index d77e2d4a4fcb..4813d9cac10c 100644
--- a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx
+++ b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx
@@ -31,6 +31,7 @@
 #include <osl/file.hxx>
 #include <osl/thread.h>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 #include <unotools/tempfile.hxx>
 #include <salhelper/singletonref.hxx>
 
@@ -260,9 +261,9 @@ OString getMozillaCurrentProfile( const css::uno::Reference< css::uno::XComponen
             return OUStringToOString(sUserSetCertPath, osl_getThreadTextEncoding());
         }
     }
-    catch (const uno::Exception &e)
+    catch (const uno::Exception &)
     {
-        SAL_WARN("xmlsecurity.xmlsec", "getMozillaCurrentProfile: caught " << e);
+        TOOLS_WARN_EXCEPTION("xmlsecurity.xmlsec", "getMozillaCurrentProfile:");
     }
 
     // third, dig around to see if there's one available
diff --git a/xmlsecurity/workben/pdfverify.cxx b/xmlsecurity/workben/pdfverify.cxx
index efe0461b9f14..191ca8c087eb 100644
--- a/xmlsecurity/workben/pdfverify.cxx
+++ b/xmlsecurity/workben/pdfverify.cxx
@@ -18,6 +18,7 @@
 #include <osl/file.hxx>
 #include <sal/log.hxx>
 #include <sal/main.h>
+#include <tools/diagnose_ex.h>
 #include <vcl/pngwrite.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/graphicfilter.hxx>
@@ -67,10 +68,10 @@ int pdfVerify(int nArgc, char** pArgv)
     {
         xComponentContext = cppu::defaultBootstrap_InitialComponentContext();
     }
-    catch (const uno::RuntimeException& rException)
+    catch (const uno::RuntimeException&)
     {
-        SAL_WARN("xmlsecurity.pdfio",
-                 "cppu::defaultBootstrap_InitialComponentContext() failed: " << rException);
+        TOOLS_WARN_EXCEPTION("xmlsecurity.pdfio",
+                             "cppu::defaultBootstrap_InitialComponentContext() failed:");
         return 1;
     }
     uno::Reference<lang::XMultiComponentFactory> xMultiComponentFactory
@@ -92,10 +93,10 @@ int pdfVerify(int nArgc, char** pArgv)
     {
         xSEInitializer = xml::crypto::SEInitializer::create(xComponentContext);
     }
-    catch (const uno::DeploymentException& rException)
+    catch (const uno::DeploymentException&)
     {
-        SAL_WARN("xmlsecurity.pdfio",
-                 "DeploymentException while creating SEInitializer: " << rException);
+        TOOLS_WARN_EXCEPTION("xmlsecurity.pdfio",
+                             "DeploymentException while creating SEInitializer:");
         return 1;
     }
     uno::Reference<xml::crypto::XXMLSecurityContext> xSecurityContext
commit 697f8edbb0154ed72a42e4e8d7c4942cfe7dd59d
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Jun 18 15:37:40 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jun 18 20:03:33 2019 +0200

    loplugin:logexceptionnicely in writerfilter
    
    Change-Id: Ie01d0e6af6af0cfeb46cdde38f52ab068b64db6b
    Reviewed-on: https://gerrit.libreoffice.org/74284
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 195e360a671d..0eef649f96d3 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -3162,9 +3162,9 @@ void DomainMapper::lcl_text(const sal_uInt8 * data_, size_t len)
             m_pImpl->appendTextPortion( sText, pContext );
         }
     }
-    catch( const uno::RuntimeException& e )
+    catch( const uno::RuntimeException& )
     {
-        SAL_WARN("writerfilter", "failed. Message :" << e);
+        TOOLS_WARN_EXCEPTION("writerfilter", "");
     }
 }
 
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 27a710f5a0b6..f1ca99fc77bf 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -35,6 +35,7 @@
 #include "util.hxx"
 #include <osl/diagnose.h>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 #include <comphelper/sequence.hxx>
 
 #ifdef DBG_UTIL
@@ -915,9 +916,9 @@ static bool lcl_emptyRow(std::vector<RowSequence_t>& rTableRanges, sal_Int32 nRo
         if (bRangesAreNotEqual)
             return false;
     }
-    catch (const lang::IllegalArgumentException& e)
+    catch (const lang::IllegalArgumentException&)
     {
-        SAL_WARN( "writerfilter.dmapper", "compareRegionStarts() failed: " << e);
+        TOOLS_WARN_EXCEPTION( "writerfilter.dmapper", "compareRegionStarts() failed");
         return false;
     }
     return true;
@@ -1102,18 +1103,16 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel, bool bTab
                 }
             }
         }
-        catch ( const lang::IllegalArgumentException &e )
+        catch ( const lang::IllegalArgumentException & )
         {
-            SAL_INFO("writerfilter.dmapper",
-                    "Conversion to table error: " << e);
+            TOOLS_INFO_EXCEPTION("writerfilter.dmapper", "Conversion to table error");
 #ifdef DBG_UTIL
             TagLogger::getInstance().chars(std::string("failed to import table!"));
 #endif
         }
-        catch ( const uno::Exception &e )
+        catch ( const uno::Exception & )
         {
-            SAL_INFO("writerfilter.dmapper",
-                    "Exception during table creation: " << e);
+            TOOLS_INFO_EXCEPTION("writerfilter.dmapper", "Exception during table creation");
         }
 
         // If we have a table with a start and an end position, we should make it a floating one.
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index d70ebb443691..1e6a5a1e3f76 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1564,9 +1564,9 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
         {
             OSL_FAIL( "IllegalArgumentException in DomainMapper_Impl::finishParagraph" );
         }
-        catch(const uno::Exception& e)
+        catch(const uno::Exception&)
         {
-            SAL_WARN( "writerfilter.dmapper", "finishParagraph() " << e );
+            TOOLS_WARN_EXCEPTION( "writerfilter.dmapper", "finishParagraph()" );
         }
 
     }
@@ -2242,10 +2242,9 @@ void DomainMapper_Impl::PopAnnotation()
         }
         m_aAnnotationPositions.erase( m_nAnnotationId );
     }
-    catch (uno::Exception const& e)
+    catch (uno::Exception const&)
     {
-        SAL_WARN("writerfilter.dmapper",
-                "Cannot insert annotation field: " << e);
+        TOOLS_WARN_EXCEPTION("writerfilter.dmapper", "Cannot insert annotation field");
     }
 
     m_xAnnotationField.clear();
@@ -2436,9 +2435,9 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape
         m_bParaChanged = true;
         getTableManager().setIsInShape(true);
     }
-    catch ( const uno::Exception& e )
+    catch ( const uno::Exception& )
     {
-        SAL_WARN("writerfilter.dmapper", "Exception when adding shape: " << e);
+        TOOLS_WARN_EXCEPTION("writerfilter.dmapper", "Exception when adding shape");
     }
 }
 /*
@@ -4902,9 +4901,9 @@ void DomainMapper_Impl::CloseFieldCommand()
             //set the text field if there is any
             pContext->SetTextField( uno::Reference< text::XTextField >( xFieldInterface, uno::UNO_QUERY ) );
         }
-        catch( const uno::Exception& e )
+        catch( const uno::Exception& )
         {
-            SAL_WARN( "writerfilter.dmapper", "Exception in CloseFieldCommand(): " << e );
+            TOOLS_WARN_EXCEPTION( "writerfilter.dmapper", "Exception in CloseFieldCommand()" );
         }
         pContext->SetCommandCompleted();
     }
@@ -5073,10 +5072,9 @@ void DomainMapper_Impl::SetFieldResult(OUString const& rResult)
                 }
             }
         }
-        catch (const uno::Exception& e)
+        catch (const uno::Exception&)
         {
-            SAL_WARN("writerfilter.dmapper",
-                "DomainMapper_Impl::SetFieldResult: " << e);
+            TOOLS_WARN_EXCEPTION("writerfilter.dmapper", "DomainMapper_Impl::SetFieldResult");
         }
     }
 }
@@ -5911,10 +5909,9 @@ uno::Reference<container::XIndexAccess> DomainMapper_Impl::GetCurrentNumberingRu
         uno::Reference<beans::XPropertySet> xStyle(xNumberingStyles->getByName(aListName), uno::UNO_QUERY);
         xRet.set(xStyle->getPropertyValue("NumberingRules"), uno::UNO_QUERY);
     }
-    catch (const uno::Exception& e)
+    catch (const uno::Exception&)
     {
-        SAL_WARN("writerfilter.dmapper",
-                "GetCurrentNumberingRules: exception caught: " << e);
+        TOOLS_WARN_EXCEPTION("writerfilter.dmapper", "GetCurrentNumberingRules: exception caught");
     }
     return xRet;
 }
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index d5d09a90dcbb..bf80052e33dd 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -49,6 +49,7 @@
 #include <rtl/ustrbuf.hxx>
 #include <sal/log.hxx>
 #include <rtl/math.hxx>
+#include <tools/diagnose_ex.h>
 #include <comphelper/string.hxx>
 #include <comphelper/sequenceashashmap.hxx>
 #include <comphelper/sequence.hxx>
@@ -377,9 +378,9 @@ public:
             xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_TITLE ),
                 uno::makeAny( title ));
         }
-        catch( const uno::Exception& e )
+        catch( const uno::Exception& )
         {
-            SAL_WARN("writerfilter", "failed. Message :" << e);
+            TOOLS_WARN_EXCEPTION("writerfilter", "failed");
         }
     }
 
@@ -1387,9 +1388,9 @@ uno::Reference<text::XTextContent> GraphicImport::createGraphicObject(uno::Refer
             }
         }
     }
-    catch( const uno::Exception& e )
+    catch( const uno::Exception& )
     {
-        SAL_WARN("writerfilter", "failed. Message :" << e);
+        TOOLS_WARN_EXCEPTION("writerfilter", "");
     }
     return xGraphicObject;
 }
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx
index 666ee674cddc..e5bf229d174e 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -39,6 +39,7 @@
 #include <osl/diagnose.h>
 #include <rtl/ustring.hxx>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 #include <comphelper/sequence.hxx>
 #include <comphelper/propertyvalue.hxx>
 
@@ -624,19 +625,19 @@ void ListDef::CreateNumberingRules( DomainMapper& rDMapper,
             OUString sNumRulesName = getPropertyName( PROP_NUMBERING_RULES );
             xStyle->setPropertyValue( sNumRulesName, uno::makeAny( m_xNumRules ) );
         }
-        catch( const lang::IllegalArgumentException& e )
+        catch( const lang::IllegalArgumentException& )
         {
-            SAL_WARN( "writerfilter", e );
+            TOOLS_WARN_EXCEPTION( "writerfilter", "" );
             assert( !"Incorrect argument to UNO call" );
         }
-        catch( const uno::RuntimeException& e )
+        catch( const uno::RuntimeException& )
         {
-            SAL_WARN( "writerfilter", e );
+            TOOLS_WARN_EXCEPTION( "writerfilter", "" );
             assert( !"Incorrect argument to UNO call" );
         }
-        catch( const uno::Exception& e )
+        catch( const uno::Exception& )
         {
-            SAL_WARN( "writerfilter", e );
+            TOOLS_WARN_EXCEPTION( "writerfilter", "" );
         }
     }
 
diff --git a/writerfilter/source/dmapper/OLEHandler.cxx b/writerfilter/source/dmapper/OLEHandler.cxx
index 8eb6fddeb303..c59e041b28a4 100644
--- a/writerfilter/source/dmapper/OLEHandler.cxx
+++ b/writerfilter/source/dmapper/OLEHandler.cxx
@@ -27,6 +27,7 @@
 #include <rtl/ustring.hxx>
 #include <sal/log.hxx>
 #include <osl/diagnose.h>
+#include <tools/diagnose_ex.h>
 #include <unotools/mediadescriptor.hxx>
 #include <officecfg/Office/Common.hxx>
 #include <com/sun/star/beans/PropertyValue.hpp>
@@ -124,9 +125,9 @@ void OLEHandler::lcl_attribute(Id rName, Value & rVal)
 
                     xShapeProps->getPropertyValue( getPropertyName( PROP_BITMAP ) ) >>= m_xReplacement;
                 }
-                catch( const uno::Exception& e )
+                catch( const uno::Exception& )
                 {
-                    SAL_WARN("writerfilter", "Exception in OLE Handler: " << e);
+                    TOOLS_WARN_EXCEPTION("writerfilter", "Exception in OLE Handler");
                 }
                 // No need to set the wrapping here as it's either set in oox or will be set later
             }
@@ -175,9 +176,9 @@ void OLEHandler::lcl_sprm(Sprm & rSprm)
                     if( m_rDomainMapper.IsInHeaderFooter() )
                         xShapeProps->setPropertyValue("Opaque", uno::makeAny(m_nWrapMode != text::WrapTextMode_THROUGH));
                 }
-                catch( const uno::Exception& e )
+                catch( const uno::Exception& )
                 {
-                    SAL_WARN("writerfilter", "Exception in OLE Handler: " << e);
+                    TOOLS_WARN_EXCEPTION("writerfilter", "Exception in OLE Handler");
                 }
             }
         }
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 68f1f7119564..a85b80735b1a 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -841,9 +841,9 @@ void SectionPropertyMap::CopyHeaderFooterTextProperty( const uno::Reference< bea
 
         xTxt->copyText( xPrevTxt );
     }
-    catch ( const uno::Exception& e )
+    catch ( const uno::Exception& )
     {
-        SAL_INFO( "writerfilter", "An exception occurred in SectionPropertyMap::CopyHeaderFooterTextProperty( ) - " << e );
+        TOOLS_INFO_EXCEPTION( "writerfilter", "An exception occurred in SectionPropertyMap::CopyHeaderFooterTextProperty( )" );
     }
 }
 
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 3e41aa93404e..bfd535949bf4 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -373,9 +373,9 @@ void StyleSheetTable_Impl::SetPropertiesToDefault(const uno::Reference<style::XS
             {
                 xPropertyState->setPropertyToDefault(aPropertyNames[i]);
             }
-            catch(const uno::Exception& rException)
+            catch(const uno::Exception&)
             {
-                SAL_INFO("writerfilter", "setPropertyToDefault(" << aPropertyNames[i] << ") failed: " << rException);
+                TOOLS_INFO_EXCEPTION("writerfilter", "setPropertyToDefault(" << aPropertyNames[i] << ") failed");
             }
         }
     }
diff --git a/writerfilter/source/dmapper/TableManager.cxx b/writerfilter/source/dmapper/TableManager.cxx
index 8377d356668e..f0194ca499ce 100644
--- a/writerfilter/source/dmapper/TableManager.cxx
+++ b/writerfilter/source/dmapper/TableManager.cxx
@@ -23,6 +23,7 @@
 #include "util.hxx"
 
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 
 namespace writerfilter
 {
@@ -304,9 +305,9 @@ void TableManager::resolveCurrentTable()
 
             mpTableDataHandler->endTable(mTableDataStack.size() - 1, m_bTableStartsAtCellStart);
         }
-        catch (css::uno::Exception const& e)
+        catch (css::uno::Exception const&)
         {
-            SAL_WARN("writerfilter", "resolving of current table failed with: " << e);
+            TOOLS_WARN_EXCEPTION("writerfilter", "resolving of current table failed");
         }
     }
     mState.resetTableProps();
diff --git a/writerfilter/source/filter/RtfFilter.cxx b/writerfilter/source/filter/RtfFilter.cxx
index a80c82c43e2f..3c1e975d8ad7 100644
--- a/writerfilter/source/filter/RtfFilter.cxx
+++ b/writerfilter/source/filter/RtfFilter.cxx
@@ -31,6 +31,7 @@
 #include <cppuhelper/supportsservice.hxx>
 #include <osl/file.hxx>
 #include <sal/log.hxx>
+#include <tools/diagnose_ex.h>
 #include <unotools/mediadescriptor.hxx>
 #include <unotools/streamwrap.hxx>
 #include <unotools/ucbstreamhelper.hxx>
@@ -153,9 +154,9 @@ sal_Bool RtfFilter::filter(const uno::Sequence< beans::PropertyValue >& rDescrip
         throw lang::WrappedTargetRuntimeException("",
                 static_cast<OWeakObject*>(this), anyEx);
     }
-    catch (const uno::Exception& e)
+    catch (const uno::Exception&)
     {
-        SAL_INFO("writerfilter", "Exception caught: " << e);
+        TOOLS_INFO_EXCEPTION("writerfilter", "Exception caught");
     }
 
     if (xStatusIndicator.is())
diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
index 9601a5311923..e8386c5898ef 100644
--- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx
@@ -83,10 +83,10 @@ void OOXMLDocumentImpl::resolveFastSubStream(Stream & rStreamHandler,
     {
         pStream = OOXMLDocumentFactory::createStream(mpStream, nType);
     }
-    catch (uno::Exception const& e)
+    catch (uno::Exception const&)
     {
-        SAL_INFO("writerfilter.ooxml", "resolveFastSubStream: exception while "
-                "resolving stream " << nType << " : " << e);
+        TOOLS_INFO_EXCEPTION("writerfilter.ooxml", "resolveFastSubStream: exception while "
+                "resolving stream " << nType);
         return;
     }
     OOXMLStream::Pointer_t savedStream = mpStream;
@@ -137,10 +137,10 @@ uno::Reference<xml::dom::XDocument> OOXMLDocumentImpl::importSubStream(OOXMLStre
     {
         pStream = OOXMLDocumentFactory::createStream(mpStream, nType);
     }
-    catch (uno::Exception const& e)
+    catch (uno::Exception const&)
     {
-        SAL_INFO("writerfilter.ooxml", "importSubStream: exception while "
-                "importing stream " << nType << " : " << e);
+        TOOLS_INFO_EXCEPTION("writerfilter.ooxml", "importSubStream: exception while "
+                "importing stream " << nType);
         return xRet;
     }
 
@@ -153,10 +153,10 @@ uno::Reference<xml::dom::XDocument> OOXMLDocumentImpl::importSubStream(OOXMLStre
             uno::Reference<xml::dom::XDocumentBuilder> xDomBuilder(xml::dom::DocumentBuilder::create(xContext));
             xRet = xDomBuilder->parse(xInputStream);
         }
-        catch (uno::Exception const& e)
+        catch (uno::Exception const&)
         {
-            SAL_INFO("writerfilter.ooxml", "importSubStream: exception while "
-                     "parsing stream " << nType << " : " << e);
+            TOOLS_INFO_EXCEPTION("writerfilter.ooxml", "importSubStream: exception while "
+                     "parsing stream " << nType);
             return xRet;
         }
     }
@@ -614,10 +614,10 @@ void OOXMLDocumentImpl::resolveGlossaryStream(Stream & /*rStream*/)
     {
         pStream = OOXMLDocumentFactory::createStream(mpStream, OOXMLStream::GLOSSARY);
     }
-    catch (uno::Exception const& e)
+    catch (uno::Exception const&)
     {
-        SAL_INFO("writerfilter.ooxml", "resolveGlossaryStream: exception while "
-                 "createStream for glossary" << OOXMLStream::GLOSSARY << " : " << e);
+        TOOLS_INFO_EXCEPTION("writerfilter.ooxml", "resolveGlossaryStream: exception while "
+                 "createStream for glossary" << OOXMLStream::GLOSSARY);
         return;
     }
     uno::Reference<embed::XRelationshipAccess> xRelationshipAccess;
@@ -685,10 +685,10 @@ void OOXMLDocumentImpl::resolveGlossaryStream(Stream & /*rStream*/)
                       uno::Reference<xml::dom::XDocumentBuilder> xDomBuilder(xml::dom::DocumentBuilder::create(xContext));
                       xDom = xDomBuilder->parse(xInputStream);
                   }
-                  catch (uno::Exception const& e)
+                  catch (uno::Exception const&)
                   {
-                      SAL_INFO("writerfilter.ooxml", "importSubStream: exception while "
-                      "parsing stream of Type" << nType << " : " << e);
+                      TOOLS_INFO_EXCEPTION("writerfilter.ooxml", "importSubStream: exception while "
+                                 "parsing stream of Type" << nType);
                       return;
                   }
 
@@ -767,10 +767,10 @@ void OOXMLDocumentImpl::resolveEmbeddingsStream(const OOXMLStream::Pointer_t& pS
                         if (Stream)
                             resolveEmbeddingsStream(Stream);
                     }
-                    catch (uno::Exception const& e)
+                    catch (uno::Exception const&)
                     {
-                        SAL_INFO("writerfilter.ooxml", "resolveEmbeddingsStream: can't find header/footer whilst "
-                               "resolving stream " << streamType << " : " << e);
+                        TOOLS_INFO_EXCEPTION("writerfilter.ooxml", "resolveEmbeddingsStream: can't find header/footer whilst "
+                               "resolving stream " << streamType);
                         return;
                     }
                 }
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 43463dabc152..b829c8aa9fd2 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -25,6 +25,7 @@
 #include <filter/msfilter/util.hxx>
 #include <filter/msfilter/rtfutil.hxx>
 #include <comphelper/string.hxx>
+#include <tools/diagnose_ex.h>
 #include <tools/globname.hxx>
 #include <tools/datetimeutils.hxx>
 #include <comphelper/classids.hxx>
@@ -3161,10 +3162,9 @@ RTFError RTFDocumentImpl::popState()
                             xDocumentPropertyContainer->addProperty(
                                 rKey, beans::PropertyAttribute::REMOVABLE, aValue);
                     }
-                    catch (const uno::Exception& rException)
+                    catch (const uno::Exception&)
                     {
-                        SAL_WARN("writerfilter.rtf",
-                                 "failed to set property " << rKey << ": " << rException);
+                        TOOLS_WARN_EXCEPTION("writerfilter.rtf", "failed to set property " << rKey);
                     }
                 }
             }


More information about the Libreoffice-commits mailing list