From 9bac19e37f5a432375d24e8f210bb58de9c31bd8 Mon Sep 17 00:00:00 2001 From: Noel Date: Thu, 1 Oct 2020 14:02:32 +0200 Subject: loplugin:reducevarscope in comphelper,connectivity Change-Id: Ia70d4963fb892120cc8f79597b46a8fe67b540a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103762 Tested-by: Jenkins Reviewed-by: Noel Grandin --- comphelper/source/misc/documentinfo.cxx | 3 +-- comphelper/source/misc/instancelocker.cxx | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'comphelper') diff --git a/comphelper/source/misc/documentinfo.cxx b/comphelper/source/misc/documentinfo.cxx index 3b191f956866..044a6d0103fd 100644 --- a/comphelper/source/misc/documentinfo.cxx +++ b/comphelper/source/misc/documentinfo.cxx @@ -66,7 +66,6 @@ namespace comphelper { if ( !_rxDocument.is() ) return sTitle; - OUString sDocURL; try { // 1. ask the model and the controller for their XTitle::getTitle @@ -81,7 +80,7 @@ namespace comphelper { // work around a problem with embedded objects, which sometimes return // private:object as URL - sDocURL = _rxDocument->getURL(); + OUString sDocURL = _rxDocument->getURL(); if ( sDocURL.startsWithIgnoreAsciiCase( "private:" ) ) sDocURL.clear(); diff --git a/comphelper/source/misc/instancelocker.cxx b/comphelper/source/misc/instancelocker.cxx index c32747e26514..b942d7ec8329 100644 --- a/comphelper/source/misc/instancelocker.cxx +++ b/comphelper/source/misc/instancelocker.cxx @@ -121,7 +121,6 @@ void SAL_CALL OInstanceLocker::initialize( const uno::Sequence< uno::Any >& aArg uno::Reference< uno::XInterface > xInstance; uno::Reference< embed::XActionsApproval > xApproval; - sal_Int32 nModes = 0; try { @@ -138,6 +137,7 @@ void SAL_CALL OInstanceLocker::initialize( const uno::Sequence< uno::Any >& aArg uno::Reference< uno::XInterface >(), 0 ); + sal_Int32 nModes = 0; if ( !( aArguments[1] >>= nModes ) || ( -- cgit