diff options
author | Noel <noelgrandin@gmail.com> | 2020-09-30 09:37:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-09-30 12:36:51 +0200 |
commit | b29ec8b26bddc03661c527b603863d9e738d1210 (patch) | |
tree | 829f01d36d867f717d4a3c9373842510bbc76e77 /sc/source/ui/docshell | |
parent | 9373320fc88c1582a2ad25bda9c5264c7c58a97e (diff) |
loplugin:reducevarscope in sc
Change-Id: If88c71351fb157b8eab242fceb65422f05eec3d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103645
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/docshell')
-rw-r--r-- | sc/source/ui/docshell/dbdocfun.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh4.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh8.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/externalrefmgr.cxx | 4 |
4 files changed, 5 insertions, 5 deletions
diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 4ead59d46fbc..cbd2471ad343 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -737,9 +737,9 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam, weld::WaitObject aWait( ScDocShell::GetActiveDialogParent() ); bool bKeepSub = false; // repeat existing partial results? - ScSubTotalParam aSubTotalParam; if (rQueryParam.GetEntry(0).bDoQuery) // not at cancellation { + ScSubTotalParam aSubTotalParam; pDBData->GetSubTotalParam( aSubTotalParam ); // partial results exist? if ( aSubTotalParam.bGroupActive[0] && !aSubTotalParam.bRemoveOnly ) diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 18e23c4851a3..11beaa2819b7 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -1158,7 +1158,6 @@ void ScDocShell::Execute( SfxRequest& rReq ) break; case SID_LANGUAGE_STATUS: { - sal_Int32 nPos = 0; OUString aLangText; const SfxStringItem* pItem = rReq.GetArg<SfxStringItem>(nSlot); if ( pItem ) @@ -1177,6 +1176,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) ScDocument& rDoc = GetDocument(); rDoc.GetLanguage( eLatin, eCjk, eCtl ); + sal_Int32 nPos = 0; if ( aLangText == "*" ) { SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index da4ca2d97160..9b5ba3f8ffdf 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -777,12 +777,12 @@ ErrCode ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncoding SCROW nDocRow = 0; ScFieldEditEngine aEditEngine(&m_aDocument, m_aDocument.GetEditPool()); OUString aString; - OUString aTabName; try { uno::Reference<sdbc::XDriverManager2> xDrvMan; uno::Reference<sdbc::XConnection> xConnection; + OUString aTabName; ErrCode nRet = lcl_getDBaseConnection(xDrvMan,xConnection,aTabName,rFullFileName,eCharSet); if ( !xConnection.is() || !xDrvMan.is() ) return nRet; diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index 182cc05150a3..7c1566472cbc 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -2419,10 +2419,10 @@ ScDocument* ScExternalRefManager::getSrcDocument(sal_uInt16 nFileId) // no file name associated with this ID. return nullptr; - OUString aFilter; SrcShell aSrcDoc; try { + OUString aFilter; aSrcDoc.maShell = loadSrcDocument(nFileId, aFilter); } catch (const css::uno::Exception&) @@ -2888,10 +2888,10 @@ public: bool ScExternalRefManager::refreshSrcDocument(sal_uInt16 nFileId) { - OUString aFilter; SfxObjectShellRef xDocShell; try { + OUString aFilter; xDocShell = loadSrcDocument(nFileId, aFilter); } catch ( const css::uno::Exception& ) {} |