diff options
author | Noel <noelgrandin@gmail.com> | 2020-10-02 13:37:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-04 14:06:37 +0200 |
commit | a36ada7c5400735b6d03d7215a32ea7e98aacd63 (patch) | |
tree | d90c9995144614d47b997f8becdf488caa25cd53 /svtools | |
parent | 27f1827afa11ba9c5d912614dc84dd308ecf8b5f (diff) |
loplugin:reducevarscope in store..svtools
Change-Id: Iaa6c6eac15cb73fc2a76ba1c5241297c94d297cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103839
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/tabbar.cxx | 3 | ||||
-rw-r--r-- | svtools/source/misc/imagemgr.cxx | 4 | ||||
-rw-r--r-- | svtools/source/misc/langtab.cxx | 6 | ||||
-rw-r--r-- | svtools/source/svrtf/svparser.cxx | 2 | ||||
-rw-r--r-- | svtools/source/uno/popupmenucontrollerbase.cxx | 3 |
5 files changed, 8 insertions, 10 deletions
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index a6ea801b5e10..14a8e05251f0 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -2296,7 +2296,6 @@ bool TabBar::StartDrag(const CommandEvent& rCEvt, vcl::Region& rRegion) sal_uInt16 TabBar::ShowDropPos(const Point& rPos) { - sal_uInt16 nDropId; sal_uInt16 nNewDropPos; sal_uInt16 nItemCount = mpImpl->getItemSize(); sal_Int16 nScroll = 0; @@ -2325,7 +2324,7 @@ sal_uInt16 TabBar::ShowDropPos(const Point& rPos) } else { - nDropId = GetPageId(rPos); + sal_uInt16 nDropId = GetPageId(rPos); if (nDropId) { nNewDropPos = GetPagePos(nDropId); diff --git a/svtools/source/misc/imagemgr.cxx b/svtools/source/misc/imagemgr.cxx index 06fc2edfc253..2a3932ac86a5 100644 --- a/svtools/source/misc/imagemgr.cxx +++ b/svtools/source/misc/imagemgr.cxx @@ -323,9 +323,9 @@ static bool GetVolumeProperties_Impl( ::ucbhelper::Content& rContent, svtools::V static SvImageId GetFolderImageId_Impl( const OUString& rURL ) { SvImageId nRet = SvImageId::Folder; - ::svtools::VolumeInfo aVolumeInfo; try { + ::svtools::VolumeInfo aVolumeInfo; ::ucbhelper::Content aCnt( rURL, css::uno::Reference< css::ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() ); if ( GetVolumeProperties_Impl( aCnt, aVolumeInfo ) ) { @@ -455,10 +455,10 @@ static OUString GetDescriptionByFactory_Impl( const OUString& rFactory ) static const char* GetFolderDescriptionId_Impl( const OUString& rURL ) { const char* pRet = STR_DESCRIPTION_FOLDER; - svtools::VolumeInfo aVolumeInfo; try { ::ucbhelper::Content aCnt( rURL, css::uno::Reference< css::ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() ); + svtools::VolumeInfo aVolumeInfo; if ( GetVolumeProperties_Impl( aCnt, aVolumeInfo ) ) { if ( aVolumeInfo.m_bIsRemote ) diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx index 7c655b1f04f6..c5df133b1daf 100644 --- a/svtools/source/misc/langtab.cxx +++ b/svtools/source/misc/langtab.cxx @@ -82,9 +82,9 @@ OUString ApplyLreOrRleEmbedding( const OUString &rText ) if (nLen == 0) return OUString(); - const sal_Unicode cLRE_Embedding = 0x202A; // the start char of an LRE embedding - const sal_Unicode cRLE_Embedding = 0x202B; // the start char of an RLE embedding - const sal_Unicode cPopDirectionalFormat = 0x202C; // the unicode PDF (POP_DIRECTIONAL_FORMAT) char that terminates an LRE/RLE embedding + constexpr sal_Unicode cLRE_Embedding = 0x202A; // the start char of an LRE embedding + constexpr sal_Unicode cRLE_Embedding = 0x202B; // the start char of an RLE embedding + constexpr sal_Unicode cPopDirectionalFormat = 0x202C; // the unicode PDF (POP_DIRECTIONAL_FORMAT) char that terminates an LRE/RLE embedding // check if there are already embedding characters at the strings start // if so change nothing diff --git a/svtools/source/svrtf/svparser.cxx b/svtools/source/svrtf/svparser.cxx index 429e9e045f91..b3aea78145a0 100644 --- a/svtools/source/svrtf/svparser.cxx +++ b/svtools/source/svrtf/svparser.cxx @@ -250,7 +250,6 @@ sal_uInt32 SvParser<T>::GetNextChar() if( RTL_TEXTENCODING_UCS2 == eSrcEnc ) { - sal_Unicode cUC = USHRT_MAX; unsigned char c1, c2; rInput.ReadUChar( c1 ).ReadUChar( c2 ); @@ -262,6 +261,7 @@ sal_uInt32 SvParser<T>::GetNextChar() bErr = !rInput.good(); if( !bErr ) { + sal_Unicode cUC = USHRT_MAX; if( bUCS2BSrcEnc ) cUC = (sal_Unicode(c1) << 8) | c2; else diff --git a/svtools/source/uno/popupmenucontrollerbase.cxx b/svtools/source/uno/popupmenucontrollerbase.cxx index 1b2f6df58c0b..066deda28830 100644 --- a/svtools/source/uno/popupmenucontrollerbase.cxx +++ b/svtools/source/uno/popupmenucontrollerbase.cxx @@ -278,7 +278,6 @@ void SAL_CALL PopupMenuControllerBase::removeStatusListener( OUString PopupMenuControllerBase::determineBaseURL( const OUString& aURL ) { // Just use the main part of the URL for popup menu controllers - sal_Int32 nQueryPart( 0 ); sal_Int32 nSchemePart( 0 ); OUString aMainURL( "vnd.sun.star.popup:" ); @@ -286,7 +285,7 @@ OUString PopupMenuControllerBase::determineBaseURL( const OUString& aURL ) if (( nSchemePart > 0 ) && ( aURL.getLength() > ( nSchemePart+1 ))) { - nQueryPart = aURL.indexOf( '?', nSchemePart ); + sal_Int32 nQueryPart = aURL.indexOf( '?', nSchemePart ); if ( nQueryPart > 0 ) aMainURL += aURL.copy( nSchemePart, nQueryPart-nSchemePart ); else if ( nQueryPart == -1 ) |