diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-06-18 09:33:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-06-18 10:31:43 +0200 |
commit | 70accc2904edb5c4aa9b5acb7ff2889a77717b75 (patch) | |
tree | f6b8aa6e318694b8fe81b40abcf115e4fe54230f /unotools/source/config | |
parent | b8775ff8961dbe589799ac7f59427a8e5d07ac72 (diff) |
loplugin:logexceptionnicely in toolkit..unoxml
Change-Id: I0a3126545f9ef98640f6dd166290e9b9e91b8355
Reviewed-on: https://gerrit.libreoffice.org/74244
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools/source/config')
-rw-r--r-- | unotools/source/config/configitem.cxx | 96 | ||||
-rw-r--r-- | unotools/source/config/pathoptions.cxx | 5 |
2 files changed, 38 insertions, 63 deletions
diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx index 803413259d11..6f5e99940703 100644 --- a/unotools/source/config/configitem.cxx +++ b/unotools/source/config/configitem.cxx @@ -412,13 +412,12 @@ Sequence< Any > ConfigItem::GetProperties(const Sequence< OUString >& rNames) { pRet[i] = xHierarchyAccess->getByHierarchicalName(pNames[i]); } - catch (const Exception& rEx) + catch (const Exception&) { - SAL_WARN( + TOOLS_WARN_EXCEPTION( "unotools.config", "ignoring XHierarchicalNameAccess to /org.openoffice." - << sSubTree << "/" << pNames[i] << " Exception: " - << rEx); + << sSubTree << "/" << pNames[i]); } } @@ -494,11 +493,9 @@ bool ConfigItem::PutProperties( const Sequence< OUString >& rNames, xTopNodeReplace->replaceByName(sProperty, pValues[i]); } } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN( - "unotools.config", - "Exception from PutProperties: " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from PutProperties"); } } try @@ -506,11 +503,9 @@ bool ConfigItem::PutProperties( const Sequence< OUString >& rNames, Reference<XChangesBatch> xBatch(xHierarchyAccess, UNO_QUERY); xBatch->commitChanges(); } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN( - "unotools.config", - "Exception from commitChanges(): " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from commitChanges"); } } @@ -636,11 +631,9 @@ Sequence< OUString > ConfigItem::GetNodeNames(const OUString& rNode, ConfigNameF } } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN( - "unotools.config", - "Exception from GetNodeNames: " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from GetNodeNames"); } } return aRet; @@ -674,19 +667,17 @@ bool ConfigItem::ClearNodeSet(const OUString& rNode) { xCont->removeByName(pNames[i]); } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN( - "unotools.config", - "Exception from removeByName(): " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from removeByName"); } } xBatch->commitChanges(); bRet = true; } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN("unotools.config", "Exception from ClearNodeSet" << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from ClearNodeSet"); } } return bRet; @@ -721,19 +712,15 @@ bool ConfigItem::ClearNodeElements(const OUString& rNode, Sequence< OUString > c Reference<XChangesBatch> xBatch(xHierarchyAccess, UNO_QUERY); xBatch->commitChanges(); } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN( - "unotools.config", - "Exception from commitChanges(): " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from commitChanges()"); } bRet = true; } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN( - "unotools.config", - "Exception from GetNodeNames: " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from GetNodeNames()"); } } return bRet; @@ -818,11 +805,9 @@ bool ConfigItem::SetSetProperties( { xBatch->commitChanges(); } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN( - "unotools.config", - "Exception from commitChanges(): " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from commitChanges()"); } const PropertyValue* pProperties = rValues.getConstArray(); @@ -859,21 +844,17 @@ bool ConfigItem::SetSetProperties( OSL_ENSURE( xHierarchyAccess->hasByHierarchicalName(pValues[nValue].Name), "Invalid config path" ); } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN( - "unotools.config", - "Exception form insert/replaceByName(): " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from insert/replaceByName()"); } } xBatch->commitChanges(); } } - catch (const Exception& rEx) + catch (const Exception&) { - SAL_WARN( - "unotools.config", - "Exception from SetSetProperties: " << rEx); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from SetSetProperties"); bRet = false; } } @@ -949,11 +930,9 @@ bool ConfigItem::ReplaceSetProperties( } } try { xBatch->commitChanges(); } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN( - "unotools.config", - "Exception from commitChanges(): " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from commitChanges"); } } @@ -970,11 +949,9 @@ bool ConfigItem::ReplaceSetProperties( } } try { xBatch->commitChanges(); } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN( - "unotools.config", - "Exception from commitChanges(): " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from commitChanges"); } const PropertyValue* pProperties = rValues.getConstArray(); @@ -1009,20 +986,17 @@ bool ConfigItem::ReplaceSetProperties( else xCont->insertByName(sSubNode, pValues[nValue].Value); } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN( - "unotools.config", - "Exception from insert/replaceByName(): " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from insert/replaceByName"); } } xBatch->commitChanges(); } } - catch (const Exception& rEx) + catch (const Exception& ) { - SAL_WARN( - "unotools.config", "Exception from ReplaceSetProperties: " << rEx); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from ReplaceSetProperties"); bRet = false; } } @@ -1064,9 +1038,9 @@ bool ConfigItem::AddNode(const OUString& rNode, const OUString& rNewNode) { xBatch->commitChanges(); } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN("unotools.config", "Exception from commitChanges(): " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from commitChanges"); } } else @@ -1077,9 +1051,9 @@ bool ConfigItem::AddNode(const OUString& rNode, const OUString& rNewNode) if(!xCont->hasByName(rNewNode)) xCont->insertByName(rNewNode, Any()); } - catch (css::uno::Exception & e) + catch (css::uno::Exception &) { - SAL_WARN("unotools.config", "Exception from AddNode(): " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "Exception from AddNode"); } } xBatch->commitChanges(); diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx index 29a143f2bb35..df102637118e 100644 --- a/unotools/source/config/pathoptions.cxx +++ b/unotools/source/config/pathoptions.cxx @@ -21,6 +21,7 @@ #include <sal/log.hxx> #include <unotools/pathoptions.hxx> +#include <tools/diagnose_ex.h> #include <tools/urlobj.hxx> #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> @@ -294,9 +295,9 @@ void SvtPathOptions_Impl::SetPath( SvtPathOptions::Paths ePath, const OUString& { m_xPathSettings->setFastPropertyValue( m_aMapEnumToPropHandle[ static_cast<sal_Int32>(ePath)], a ); } - catch (const Exception& e) + catch (const Exception&) { - SAL_WARN("unotools.config", "SetPath: " << e); + TOOLS_WARN_EXCEPTION("unotools.config", "SetPath"); } } } |