summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Laplante <mostthingsweb@gmail.com>2014-04-09 18:17:34 -0400
committerCaolán McNamara <caolanm@redhat.com>2014-04-17 16:36:36 +0000
commitc34cc21244d74f115165e1893f03b9c62a0eef2b (patch)
tree0b48e43fa398664f53a61e5588b377f304bac4e2
parent91821848a3a50229b8b96e91e9eb053a8ebc5d9a (diff)
cppcheck: Fix redundant assignments in the sw module
Change-Id: I5f266ced31295b327cdd7075b2e9d66698a01ade Reviewed-on: https://gerrit.libreoffice.org/8914 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/core/doc/tblafmt.cxx2
-rw-r--r--sw/source/core/layout/pagechg.cxx6
-rw-r--r--sw/source/core/text/txtftn.cxx1
-rw-r--r--sw/source/filter/xml/swxml.cxx1
-rw-r--r--sw/source/filter/xml/xmlithlp.cxx1
5 files changed, 5 insertions, 6 deletions
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 0dedd8b1eece..dc0f19fd68ab 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -1206,6 +1206,8 @@ sal_Bool SwTableAutoFmtTbl::Save( SvStream& rStream ) const
.WriteUChar( (sal_uInt8)GetStoreCharSet( ::osl_getThreadTextEncoding() ) );
bRet = 0 == rStream.GetError();
+ if (!bRet)
+ return sal_False;
// Write this version number for all attributes
m_pImpl->m_AutoFormats[0].GetBoxFmt(0).SaveVersionNo(
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 3b714b813fd6..3f348b7257bf 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -1156,10 +1156,9 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, sal_Bool bNotifyFields, SwPageFrm
SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, sal_Bool bFtn )
{
SwRootFrm *pRoot = (SwRootFrm*)pPrevPage->GetUpper();
- SwPageFrm *pSibling = (SwPageFrm*)pRoot->GetLower();
- SwPageDesc *pDesc = pSibling->GetPageDesc();
+ SwPageFrm *pSibling = (SwPageFrm*)pPrevPage->GetNext();
+ SwPageDesc *pDesc = 0;
- pSibling = (SwPageFrm*)pPrevPage->GetNext();
// insert right (odd) or left (even) page?
bool bNextOdd = !pPrevPage->OnRightPage();
bool bWishedOdd = bNextOdd;
@@ -1167,7 +1166,6 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, sal_Bool bFtn )
// Which PageDesc is relevant?
// For CntntFrm take the one from format if provided,
// otherwise from the Follow of the PrevPage
- pDesc = 0;
if ( IsFlowFrm() && !SwFlowFrm::CastFlowFrm( this )->IsFollow() )
{ SwFmtPageDesc &rDesc = (SwFmtPageDesc&)GetAttrSet()->GetPageDesc();
pDesc = rDesc.GetPageDesc();
diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index 17dc849d762f..182251e758c8 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -1102,7 +1102,6 @@ sal_Int32 SwTxtFormatter::FormatQuoVadis( const sal_Int32 nOffset )
pCurrPor = pFollow;
}
- nLastLeft = nOldRealWidth - nQuoWidth;
Right( Right() - nQuoWidth );
SWAP_IF_NOT_SWAPPED( pFrm )
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index 2fb7a034a059..1073937bb5cb 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -676,6 +676,7 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, c
*pArgs++ <<= aLateInitSettings;
Sequence<Any> aEmptyArgs( 3 );
+ // cppcheck-suppress redundantAssignment
pArgs = aEmptyArgs.getArray();
*pArgs++ <<= xInfoSet;
*pArgs++ <<= xStatusIndicator;
diff --git a/sw/source/filter/xml/xmlithlp.cxx b/sw/source/filter/xml/xmlithlp.cxx
index 97d21b816030..aade817ba8ec 100644
--- a/sw/source/filter/xml/xmlithlp.cxx
+++ b/sw/source/filter/xml/xmlithlp.cxx
@@ -292,7 +292,6 @@ void sw_frmitems_MergeXMLVertPos( SvxGraphicPosition& ePos,
case GPOS_LT:
case GPOS_LM:
case GPOS_LB:
- ePos = GPOS_MT==eVert ? GPOS_LT : (GPOS_MM==eVert ? GPOS_LM : GPOS_LB);
ePos = eVert;
break;