[Libreoffice-commits] core.git: sw/source
Chris Laplante
mostthingsweb at gmail.com
Thu Apr 17 09:37:04 PDT 2014
sw/source/core/doc/tblafmt.cxx | 2 ++
sw/source/core/layout/pagechg.cxx | 6 ++----
sw/source/core/text/txtftn.cxx | 1 -
sw/source/filter/xml/swxml.cxx | 1 +
sw/source/filter/xml/xmlithlp.cxx | 1 -
5 files changed, 5 insertions(+), 6 deletions(-)
New commits:
commit c34cc21244d74f115165e1893f03b9c62a0eef2b
Author: Chris Laplante <mostthingsweb at gmail.com>
Date: Wed Apr 9 18:17:34 2014 -0400
cppcheck: Fix redundant assignments in the sw module
Change-Id: I5f266ced31295b327cdd7075b2e9d66698a01ade
Reviewed-on: https://gerrit.libreoffice.org/8914
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 0dedd8b..dc0f19f 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 3b714b8..3f348b7 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 17dc849..182251e 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 2fb7a03..1073937 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 97d21b8..aade817 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;
More information about the Libreoffice-commits
mailing list