diff options
author | Noel <noelgrandin@gmail.com> | 2020-10-02 09:35:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-02 10:27:52 +0200 |
commit | ab6dbb228a703fb289733d285e93415521bc5202 (patch) | |
tree | d5d4905ab1fdcfffb59fdbced4d8d71bb4079515 /cui/source/dialogs | |
parent | 2e3afaebd027d0280b871c3515c4999b7912692a (diff) |
loplugin:reducevarscope in cui
Change-Id: Iedfda307d149fe2a5a196c83d3ea02b618e7dd23
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103809
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui/source/dialogs')
-rw-r--r-- | cui/source/dialogs/about.cxx | 2 | ||||
-rw-r--r-- | cui/source/dialogs/cuicharmap.cxx | 12 | ||||
-rw-r--r-- | cui/source/dialogs/insdlg.cxx | 2 |
3 files changed, 6 insertions, 10 deletions
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx index 558f54b3da0e..99729ee2f10d 100644 --- a/cui/source/dialogs/about.cxx +++ b/cui/source/dialogs/about.cxx @@ -71,8 +71,8 @@ AboutDialog::AboutDialog(weld::Window *pParent) m_pVersionLabel->set_label(GetVersionString()); OUString sbuildId = GetBuildString(); - const long nMaxChar = 25; if (IsStringValidGitHash(sbuildId)) { + const long nMaxChar = 25; m_pBuildLabel->set_uri("https://gerrit.libreoffice.org/gitweb?p=core.git;a=log;h=" + sbuildId); m_pBuildLabel->set_label(sbuildId.getLength() > nMaxChar ? sbuildId.replaceAt( diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx index 5042a2079210..28260d70cf4c 100644 --- a/cui/source/dialogs/cuicharmap.cxx +++ b/cui/source/dialogs/cuicharmap.cxx @@ -950,8 +950,6 @@ IMPL_LINK_NOARG(SvxCharacterMap, FavClickHdl, SvxShowCharSet*, void) IMPL_LINK_NOARG(SvxCharacterMap, CharHighlightHdl, SvxShowCharSet*, void) { OUString aText; - OUString aHexText; - OUString aDecimalText; sal_UCS4 cChar = m_xShowSet->GetSelectCharacter(); bool bSelect = (cChar > 0); @@ -961,9 +959,9 @@ IMPL_LINK_NOARG(SvxCharacterMap, CharHighlightHdl, SvxShowCharSet*, void) // using the new UCS4 constructor aText = OUString( &cChar, 1 ); // Get the hexadecimal code - aHexText = OUString::number(cChar, 16).toAsciiUpperCase(); + OUString aHexText = OUString::number(cChar, 16).toAsciiUpperCase(); // Get the decimal code - aDecimalText = OUString::number(cChar); + OUString aDecimalText = OUString::number(cChar); setCharName(cChar); // Update the hex and decimal codes only if necessary @@ -991,8 +989,6 @@ IMPL_LINK_NOARG(SvxCharacterMap, CharHighlightHdl, SvxShowCharSet*, void) IMPL_LINK_NOARG(SvxCharacterMap, SearchCharHighlightHdl, SvxShowCharSet*, void) { OUString aText; - OUString aHexText; - OUString aDecimalText; sal_UCS4 cChar = m_xSearchSet->GetSelectCharacter(); bool bSelect = (cChar > 0); @@ -1001,9 +997,9 @@ IMPL_LINK_NOARG(SvxCharacterMap, SearchCharHighlightHdl, SvxShowCharSet*, void) { aText = OUString( &cChar, 1 ); // Get the hexadecimal code - aHexText = OUString::number(cChar, 16).toAsciiUpperCase(); + OUString aHexText = OUString::number(cChar, 16).toAsciiUpperCase(); // Get the decimal code - aDecimalText = OUString::number(cChar); + OUString aDecimalText = OUString::number(cChar); setCharName(cChar); // Update the hex and decimal codes only if necessary diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx index 273d3c065f73..dd89d0174774 100644 --- a/cui/source/dialogs/insdlg.cxx +++ b/cui/source/dialogs/insdlg.cxx @@ -160,12 +160,12 @@ short SvInsertOleDlg::run() m_xLbObjecttype->append_text((*m_pServers)[i].GetHumanName()); m_xLbObjecttype->thaw(); m_xLbObjecttype->select(0); - OUString aName; DBG_ASSERT( m_xStorage.is(), "No storage!"); if ( m_xStorage.is() && ( nRet = InsertObjectDialog_Impl::run() ) == RET_OK ) { OUString aFileName; + OUString aName; bool bCreateNew = IsCreateNew(); if ( bCreateNew ) { |