summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-02-11 15:56:21 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-02-12 10:31:25 +0100
commitf147b160aef1735d34c488353a7d4b875788a7e1 (patch)
treeab3bd613cf016cde906b3fdcbaab4246ca699e1e /sw
parent718f540fb63af27c1336f89213444e9af753b8a9 (diff)
clang-analyzer-deadcode.DeadStores
Change-Id: Ifa384933569b27d0d08eb479bb95b799163ae386 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88450 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/tblrwcl.cxx1
-rw-r--r--sw/source/core/edit/ednumber.cxx10
-rw-r--r--sw/source/core/fields/authfld.cxx9
-rw-r--r--sw/source/core/frmedt/feshview.cxx8
-rw-r--r--sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx2
-rw-r--r--sw/source/core/text/wrong.cxx2
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx6
-rw-r--r--sw/source/uibase/ribbar/inputwin.cxx2
-rw-r--r--sw/source/uibase/shells/listsh.cxx3
9 files changed, 9 insertions, 34 deletions
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index d075c7015c55..f98197afa9ae 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -3048,7 +3048,6 @@ bool SwTable::SetRowHeight( SwTableBox& rCurrentBox, TableChgWidthHeightType eTy
// Is a nested Line (Box!)
pLines = &pLine->GetUpper()->GetTabLines();
nBaseLinePos = pLines->GetPos( pLine );
- pBaseLine = pLine;
[[fallthrough]];
case TableChgWidthHeightType::RowBottom:
diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx
index 650a88816ae4..0b96be07b05c 100644
--- a/sw/source/core/edit/ednumber.cxx
+++ b/sw/source/core/edit/ednumber.cxx
@@ -126,7 +126,6 @@ const SwNumRule* SwEditShell::GetOutlineNumRule() const
// paragraphs without numbering, with indentations
void SwEditShell::NoNum()
{
- bool bRet = true;
StartAllAction();
SwPaM* pCursor = GetCursor();
@@ -136,12 +135,12 @@ void SwEditShell::NoNum()
SwPamRanges aRangeArr( *pCursor );
SwPaM aPam( *pCursor->GetPoint() );
for( size_t n = 0; n < aRangeArr.Count(); ++n )
- bRet = bRet && GetDoc()->NoNum( aRangeArr.SetPam( n, aPam ));
+ GetDoc()->NoNum( aRangeArr.SetPam( n, aPam ));
GetDoc()->GetIDocumentUndoRedo().EndUndo( SwUndoId::END, nullptr );
}
else
// sw_redlinehide: leave cursor as is, will be split at Point & apply to new node
- bRet = GetDoc()->NoNum( *pCursor );
+ GetDoc()->NoNum( *pCursor );
EndAllAction();
}
@@ -308,17 +307,16 @@ void SwEditShell::NumUpDown( bool bDown )
{
StartAllAction();
- bool bRet = true;
SwPaM* pCursor = GetCursor();
if( !pCursor->IsMultiSelection() )
- bRet = GetDoc()->NumUpDown(*pCursor, bDown, GetLayout());
+ GetDoc()->NumUpDown(*pCursor, bDown, GetLayout());
else
{
GetDoc()->GetIDocumentUndoRedo().StartUndo( SwUndoId::START, nullptr );
SwPamRanges aRangeArr( *pCursor );
SwPaM aPam( *pCursor->GetPoint() );
for( size_t n = 0; n < aRangeArr.Count(); ++n )
- bRet = bRet && GetDoc()->NumUpDown(aRangeArr.SetPam( n, aPam ), bDown, GetLayout());
+ GetDoc()->NumUpDown(aRangeArr.SetPam( n, aPam ), bDown, GetLayout());
GetDoc()->GetIDocumentUndoRedo().EndUndo( SwUndoId::END, nullptr );
}
GetDoc()->getIDocumentState().SetModified();
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx
index 4e85e2243353..6e0af56c4a51 100644
--- a/sw/source/core/fields/authfld.cxx
+++ b/sw/source/core/fields/authfld.cxx
@@ -349,7 +349,6 @@ void SwAuthorityFieldType::QueryValue( Any& rVal, sal_uInt16 nWhichId ) const
void SwAuthorityFieldType::PutValue( const Any& rAny, sal_uInt16 nWhichId )
{
- bool bRet = true;
switch( nWhichId )
{
case FIELD_PROP_PAR1:
@@ -381,8 +380,7 @@ void SwAuthorityFieldType::PutValue( const Any& rAny, sal_uInt16 nWhichId )
case FIELD_PROP_LOCALE:
{
css::lang::Locale aLocale;
- bRet = rAny >>= aLocale;
- if( bRet )
+ if( rAny >>= aLocale )
SetLanguage( LanguageTag::convertToLanguageType( aLocale ));
}
break;
@@ -390,8 +388,7 @@ void SwAuthorityFieldType::PutValue( const Any& rAny, sal_uInt16 nWhichId )
case FIELD_PROP_PROP_SEQ:
{
Sequence<PropertyValues> aSeq;
- bRet = rAny >>= aSeq;
- if( bRet )
+ if( rAny >>= aSeq )
{
m_SortKeyArr.clear();
const PropertyValues* pValues = aSeq.getConstArray();
@@ -409,8 +406,6 @@ void SwAuthorityFieldType::PutValue( const Any& rAny, sal_uInt16 nWhichId )
sal_Int16 nVal = -1; rValue.Value >>= nVal;
if(nVal >= 0 && nVal < AUTH_FIELD_END)
aSortKey.eField = static_cast<ToxAuthorityField>(nVal);
- else
- bRet = false;
}
else if(rValue.Name == UNO_NAME_IS_SORT_ASCENDING)
{
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 99ee92524af7..66d7fd61a919 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -1005,14 +1005,6 @@ void SwFEShell::SetLineEnds(SfxItemSet& rAttr, SdrObject const & rObj, sal_uInt1
// and again, for the still missing ends
switch (nSlotId)
{
- case SID_LINE_ARROW_CIRCLE:
- {
- long nValue = aSet.Get( XATTR_LINEWIDTH ).GetValue();
- if( nValue > 0 )
- nWidth = nValue * 3;
- }
- break;
-
case SID_LINE_CIRCLE_ARROW:
{
// circle start
diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
index 0a19ebc7c4ae..fd4193918171 100644
--- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
@@ -188,7 +188,7 @@ void SwToContentAnchoredObjectPosition::CalcPosition()
// determine frame the object position has to be oriented at.
const SwTextFrame* pOrientFrame = &rAnchorTextFrame;
- const SwTextFrame* pAnchorFrameForVertPos = &rAnchorTextFrame;
+ const SwTextFrame* pAnchorFrameForVertPos;
{
// if object is at-character anchored, determine character-rectangle
// and frame, position has to be oriented at.
diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx
index 436214ea2e86..be570670593d 100644
--- a/sw/source/core/text/wrong.cxx
+++ b/sw/source/core/text/wrong.cxx
@@ -713,7 +713,6 @@ bool WrongListIterator::Check(TextFrameIndex & rStart, TextFrameIndex & rLen)
sw::Extent const& rExtentEnd(m_pMergedPara->extents[i]);
if (rExtentEnd.pNode != rExtent.pNode)
{
- nInLen = 0;
break;
}
// add gap too
@@ -721,7 +720,6 @@ bool WrongListIterator::Check(TextFrameIndex & rStart, TextFrameIndex & rLen)
if (nInLen <= rExtentEnd.nEnd - rExtentEnd.nStart)
{
nLen += nInLen;
- nInLen = 0;
break;
}
nLen += rExtentEnd.nEnd - rExtentEnd.nStart;
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 379b9cf46264..d06072c6de5a 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -3491,12 +3491,6 @@ WW8Ruby::WW8Ruby(const SwTextNode& rNode, const SwFormatRuby& rRuby, const MSWor
m_nRubyHeight = rHeight.GetHeight();
}
- if (pRubyText)
- nRubyScript
- = g_pBreakIt->GetBreakIter()->getScriptType(rNode.GetText(), pRubyText->GetStart());
- else
- nRubyScript = i18n::ScriptType::ASIAN;
-
const OUString &rText = rNode.GetText();
sal_uInt16 nScript = i18n::ScriptType::LATIN;
diff --git a/sw/source/uibase/ribbar/inputwin.cxx b/sw/source/uibase/ribbar/inputwin.cxx
index 47e551f69c8e..4b6ee2d286b3 100644
--- a/sw/source/uibase/ribbar/inputwin.cxx
+++ b/sw/source/uibase/ribbar/inputwin.cxx
@@ -520,7 +520,7 @@ void InputEdit::UpdateRange(const OUString& rBoxes,
nEndPos = nStartPos;
while( nEndPos < nLen )
{
- if( cClose == (cCh = aActText[ nEndPos ]))
+ if( cClose == aActText[ nEndPos ] )
{
bFound = true;
break;
diff --git a/sw/source/uibase/shells/listsh.cxx b/sw/source/uibase/shells/listsh.cxx
index 1beb2bf489a9..a8d7eb91f8c7 100644
--- a/sw/source/uibase/shells/listsh.cxx
+++ b/sw/source/uibase/shells/listsh.cxx
@@ -60,12 +60,12 @@ static void lcl_OutlineUpDownWithSubPoints( SwWrtShell& rSh, bool bMove, bool bU
{
const IDocumentOutlineNodes* pIDoc( rSh.getIDocumentOutlineNodesAccess() );
const int nActLevel = pIDoc->getOutlineLevel( nActPos );
- SwOutlineNodes::size_type nActEndPos = nActPos + 1;
SwOutlineNodes::difference_type nDir = 0;
if ( !bUp )
{
// Move down with subpoints:
+ SwOutlineNodes::size_type nActEndPos = nActPos + 1;
while ( nActEndPos < pIDoc->getOutlineNodesCount() &&
(!pIDoc->isOutlineInLayout(nActEndPos, *rSh.GetLayout())
|| nActLevel < pIDoc->getOutlineLevel(nActEndPos)))
@@ -94,7 +94,6 @@ static void lcl_OutlineUpDownWithSubPoints( SwWrtShell& rSh, bool bMove, bool bU
// Move up with subpoints:
if ( nActPos > 0 )
{
- nActEndPos = nActPos;
SwOutlineNodes::size_type nDest = nActPos - 1;
while (nDest > 0 &&
(!pIDoc->isOutlineInLayout(nDest, *rSh.GetLayout())