summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-04-18 11:03:43 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-04-20 11:02:45 +0000
commitb0c0a074a2318a231f3f635784da494f1b713c53 (patch)
tree148eff548408d274d4208109d948e763c66e1b5d /cui/source
parent29a9f433c268414747d8ec7343fc2b5987971738 (diff)
clang-tidy clang-analyzer-deadcode.DeadStores
suspect that some of these may reveal latent bugs.... Change-Id: I9de9aabbda9c8952715631577c29c1830df1eb71 Reviewed-on: https://gerrit.libreoffice.org/24200 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/customize/cfg.cxx6
-rw-r--r--cui/source/dialogs/cuihyperdlg.cxx2
-rw-r--r--cui/source/dialogs/linkdlg.cxx6
-rw-r--r--cui/source/options/optjava.cxx4
-rw-r--r--cui/source/options/optpath.cxx3
-rw-r--r--cui/source/tabpages/chardlg.cxx2
-rw-r--r--cui/source/tabpages/swpossizetabpage.cxx4
7 files changed, 8 insertions, 19 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index f995d46017ce..a5344548e252 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -3463,10 +3463,10 @@ IMPL_LINK_TYPED( SvxToolbarConfigPage, EntrySelectHdl, MenuButton *, pButton, vo
bNeedsApply = true;
}
- catch ( uno::Exception& )
- {
+ catch ( uno::Exception& )
+ {
OSL_TRACE("Error restoring image");
- }
+ }
break;
}
case ID_BEGIN_GROUP:
diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx
index b423b1cc0627..57601d19cbfa 100644
--- a/cui/source/dialogs/cuihyperdlg.cxx
+++ b/cui/source/dialogs/cuihyperdlg.cxx
@@ -331,7 +331,7 @@ void SvxHpLinkDlg::SetPage ( SvxHyperlinkItem* pItem )
nPageId = RID_SVXPAGE_HYPERLINK_DOCUMENT;
else
{
- eProtocolTyp = INetProtocol::NotValid;
+ // not valid
nPageId = GetCurPageId();
}
break;
diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx
index 98064ce3ab95..2403bb9e5126 100644
--- a/cui/source/dialogs/linkdlg.cxx
+++ b/cui/source/dialogs/linkdlg.cxx
@@ -166,7 +166,7 @@ void SvBaseLinksDlg::dispose()
*************************************************************************/
IMPL_LINK_TYPED( SvBaseLinksDlg, LinksSelectHdl, SvTreeListBox *, pSvTabListBox, void )
{
- sal_uLong nSelectionCount = pSvTabListBox ?
+ const sal_uLong nSelectionCount = pSvTabListBox ?
pSvTabListBox->GetSelectionCount() : 0;
if(nSelectionCount > 1)
{
@@ -180,7 +180,6 @@ IMPL_LINK_TYPED( SvBaseLinksDlg, LinksSelectHdl, SvTreeListBox *, pSvTabListBox,
{
pSvTabListBox->SelectAll(false);
pSvTabListBox->Select(pEntry);
- nSelectionCount = 1;
}
else
{
@@ -277,9 +276,6 @@ IMPL_LINK_NOARG_TYPED( SvBaseLinksDlg, ManualClickHdl, Button*, void )
IMPL_LINK_NOARG_TYPED(SvBaseLinksDlg, UpdateNowClickHdl, Button*, void)
{
SvTabListBox& rListBox = *m_pTbLinks;
- sal_uLong nSelCnt = rListBox.GetSelectionCount();
- if( 255 < nSelCnt )
- nSelCnt = 255;
std::vector< SvBaseLink* > aLnkArr;
std::vector< sal_Int16 > aPosArr;
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index b954b3077708..fe08355c8e9d 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -667,13 +667,11 @@ bool SvxJavaOptionsPage::FillItemSet( SfxItemSet* /*rCoreSet*/ )
Sequence< OUString > aParamList = m_pParamDlg->GetParameters();
sal_Int32 i, nSize = aParamList.getLength();
rtl_uString** pParamArr = static_cast<rtl_uString**>(rtl_allocateMemory( sizeof(rtl_uString*) * nSize ));
- rtl_uString** pParamArrIter = pParamArr;
const OUString* pList = aParamList.getConstArray();
for ( i = 0; i < nSize; ++i )
pParamArr[i] = pList[i].pData;
- eErr = jfw_setVMParameters( pParamArrIter, nSize );
+ eErr = jfw_setVMParameters( pParamArr, nSize );
SAL_WARN_IF(JFW_E_NONE != eErr, "cui.options", "SvxJavaOptionsPage::FillItemSet(): error in jfw_setVMParameters"); (void)eErr;
- pParamArrIter = pParamArr;
rtl_freeMemory( pParamArr );
bModified = true;
}
diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx
index 03155e4dfc7f..2b84c1f79346 100644
--- a/cui/source/options/optpath.cxx
+++ b/cui/source/options/optpath.cxx
@@ -490,7 +490,6 @@ void SvxPathTabPage::ChangeCurrentEntry( const OUString& _rFolder )
GetPathList( pPathImpl->nRealId, sInternal, sUser, sWritable, bReadOnly );
sUser = pPathImpl->sUserPath;
sWritable = pPathImpl->sWritablePath;
- sal_uInt16 nPos = pPathImpl->nRealId;
// old path is an URL?
INetURLObject aObj( sWritable );
@@ -512,7 +511,7 @@ void SvxPathTabPage::ChangeCurrentEntry( const OUString& _rFolder )
if ( bChanged )
{
pPathBox->SetEntryText( Convert_Impl( sNewPathStr ), pEntry, 1 );
- nPos = (sal_uInt16)pPathBox->GetModel()->GetAbsPos( pEntry );
+ sal_uInt16 nPos = (sal_uInt16)pPathBox->GetModel()->GetAbsPos( pEntry );
pPathImpl = static_cast<PathUserData_Impl*>(pPathBox->GetEntry(nPos)->GetUserData());
pPathImpl->eState = SfxItemState::SET;
pPathImpl->sWritablePath = sNewPathStr;
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index d2e7fabda54e..d0d76c1be32a 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -1587,8 +1587,8 @@ void SvxCharEffectsPage::SetCaseMap_Impl( SvxCaseMap eCaseMap )
sal::static_int_cast< sal_Int32 >( eCaseMap ) );
else
{
+ // not mapped
m_pEffectsLB->SetNoSelection();
- eCaseMap = SVX_CASEMAP_NOT_MAPPED;
}
UpdatePreview_Impl();
diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx
index 4af228b46e3d..30e1cd68fc5b 100644
--- a/cui/source/tabpages/swpossizetabpage.cxx
+++ b/cui/source/tabpages/swpossizetabpage.cxx
@@ -451,7 +451,6 @@ static SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(
return eStringId;
}
}
- nIndex = 0;
for(nIndex = 0; nIndex < SAL_N_ELEMENTS(aVertIds); ++nIndex)
{
if(aVertIds[nIndex].eHori == eStringId)
@@ -1194,9 +1193,6 @@ IMPL_LINK_NOARG_TYPED(SvxSwPosSizeTabPage, RangeModifyHdl, Control&, void)
m_aValidateLink.Call(aVal);
- nWidth = aVal.nWidth;
- nHeight = aVal.nHeight;
-
// minimum width also for style
m_pHeightMF->SetMin(m_pHeightMF->Normalize(aVal.nMinHeight), FUNIT_TWIP);
m_pWidthMF-> SetMin(m_pWidthMF->Normalize(aVal.nMinWidth), FUNIT_TWIP);