From 1ffba0e356608fb6dbf568248e2a953b4d7fb5d6 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 28 Sep 2017 10:33:09 +0200 Subject: loplugin:flatten check for throw in then clause also make the plugin ignore the case where we have var decl's in the clause we want to flatten, which could lead to problematic extension of variable lifetime Change-Id: I3061f7104e8c6a460bf74f5eac325a516ec50c59 Reviewed-on: https://gerrit.libreoffice.org/42889 Tested-by: Jenkins Reviewed-by: Noel Grandin --- unodevtools/source/skeletonmaker/skeletoncommon.cxx | 3 +-- unodevtools/source/unodevtools/options.cxx | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'unodevtools/source') diff --git a/unodevtools/source/skeletonmaker/skeletoncommon.cxx b/unodevtools/source/skeletonmaker/skeletoncommon.cxx index 98d388681ddf..90efd23e3168 100644 --- a/unodevtools/source/skeletonmaker/skeletoncommon.cxx +++ b/unodevtools/source/skeletonmaker/skeletoncommon.cxx @@ -81,9 +81,8 @@ bool getOutputStream(ProgramOptions const & options, { throw CannotDumpException( "cannot open " + b2u(targetSourceFileName) + " for writing"); - } else { - tmpSourceFileName = file.getName(); } + tmpSourceFileName = file.getName(); file.close(); *ppOutputStream = new std::ofstream(tmpSourceFileName.getStr(), std::ios_base::binary); diff --git a/unodevtools/source/unodevtools/options.cxx b/unodevtools/source/unodevtools/options.cxx index 8156660ef735..b0b1071e209f 100644 --- a/unodevtools/source/unodevtools/options.cxx +++ b/unodevtools/source/unodevtools/options.cxx @@ -49,11 +49,10 @@ bool readOption( OUString * pValue, const sal_Char * pOpt, { throw CannotDumpException( "incomplete option \"-" + aOpt + "\" given!"); - } else { - SAL_INFO("unodevtools", "identified option -" << pOpt << " = " << *pValue); - ++(*pnIndex); - return true; } + SAL_INFO("unodevtools", "identified option -" << pOpt << " = " << *pValue); + ++(*pnIndex); + return true; } else if (aArg.indexOf(aOpt) == 1) { *pValue = aArg.copy(1 + aOpt.getLength()); SAL_INFO("unodevtools", "identified option -" << pOpt << " = " << *pValue); -- cgit