summaryrefslogtreecommitdiff
path: root/sw/source/filter
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-02-08 17:41:36 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2019-02-11 07:08:50 +0100
commit30c0134cd31c1409c374b9b0b38d2f2ac2f4bd03 (patch)
tree5b5db3b64e6b9d601a508cdb427e2ca990fa72f2 /sw/source/filter
parent04c1a98c10a24e65c4460d198c4009dc512c44ab (diff)
tdf#120703 PVS: V560 A part of conditional expression is always true/false
Change-Id: I4449fead67459bdcbdc0e9320129e7a5b36aecd9 Reviewed-on: https://gerrit.libreoffice.org/67545 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/source/filter')
-rw-r--r--sw/source/filter/html/wrthtml.cxx3
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx5
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx9
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx3
-rw-r--r--sw/source/filter/ww8/ww8par.cxx6
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx23
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx6
7 files changed, 18 insertions, 37 deletions
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index 816c53726e3b..1e3afd632211 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -227,8 +227,7 @@ ErrCode SwHTMLWriter::WriteStream()
if (pPasteEnv)
{
OUString aPasteStr;
- if (pPasteEnv
- && osl::FileBase::getFileURLFromSystemPath(OUString::fromUtf8(pPasteEnv), aPasteStr)
+ if (osl::FileBase::getFileURLFromSystemPath(OUString::fromUtf8(pPasteEnv), aPasteStr)
== osl::FileBase::E_None)
{
pPasteStream.reset(new SvFileStream(aPasteStr, StreamMode::WRITE));
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index b737fa123792..075849739ef3 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -2426,9 +2426,8 @@ bool WinwordAnchoring::ConvertPosition( SwFormatHoriOrient& _iorHoriOri,
{
SwTextNode& rAnchorTextNode =
dynamic_cast<SwTextNode&>(_rFrameFormat.GetAnchor().GetContentAnchor()->nNode.GetNode());
- const SvxFormatBreakItem* pBreak = &(ItemGet<SvxFormatBreakItem>(rAnchorTextNode, RES_BREAK));
- if ( pBreak &&
- pBreak->GetBreak() == SvxBreak::ColumnBefore )
+ const SvxFormatBreakItem& rBreak = ItemGet<SvxFormatBreakItem>(rAnchorTextNode, RES_BREAK);
+ if (rBreak.GetBreak() == SvxBreak::ColumnBefore)
{
bConvDueToAnchoredAtColBreakPara = true;
}
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 2565e216e27b..0cf9e5a15f56 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2826,16 +2826,15 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
if ( !rNode.GetpSwAttrSet() ||
SfxItemState::SET != rNode.GetpSwAttrSet()->GetItemState(RES_BREAK, false) )
{
- const SvxFormatBreakItem* pBreakAtParaStyle =
- &(ItemGet<SvxFormatBreakItem>(rNode.GetSwAttrSet(), RES_BREAK));
- if ( pBreakAtParaStyle &&
- pBreakAtParaStyle->GetBreak() == SvxBreak::PageAfter )
+ const SvxFormatBreakItem& rBreakAtParaStyle
+ = ItemGet<SvxFormatBreakItem>(rNode.GetSwAttrSet(), RES_BREAK);
+ if (rBreakAtParaStyle.GetBreak() == SvxBreak::PageAfter)
{
if ( !pTmpSet )
{
pTmpSet = new SfxItemSet(rNode.GetSwAttrSet());
}
- pTmpSet->Put( *pBreakAtParaStyle );
+ pTmpSet->Put(rBreakAtParaStyle);
}
else if( pTmpSet )
{ // Even a pagedesc item is set, the break item can be set 'NONE',
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index a0f0769c922b..87e2a54f0e5f 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -639,8 +639,7 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(WW8_CP nStartCp, WW8_CP nEndCp,
break;
}
}
- else if ( aRes.nSprmId && (
- (eFTN > aRes.nSprmId) || (0x0800 <= aRes.nSprmId) ) )
+ else if ((eFTN > aRes.nSprmId) || (0x0800 <= aRes.nSprmId))
{
// Here place them onto our usual stack and we will pop them
// off and convert them later
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index f5591d64d1e4..eb685c83edd0 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2355,7 +2355,7 @@ void SwWW8ImplReader::Read_HdFt(int nSect, const SwPageDesc *pPrev,
else
Read_HdFtText(nStart, nLen, pHdFtFormat);
}
- else if (!bOk && pPrev)
+ else if (pPrev)
CopyPageDescHdFt(pPrev, pPD, nI);
m_bIsHeader = m_bIsFooter = false;
@@ -5165,7 +5165,7 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const *pGloss)
}
else // ordinary case
{
- if (m_bNewDoc && m_pStg && !pGloss) /*meaningless for a glossary */
+ if (m_bNewDoc && m_pStg) /*meaningless for a glossary */
{
m_pDocShell->SetIsTemplate( m_xWwFib->m_fDot ); // point at tgc record
uno::Reference<document::XDocumentPropertiesSupplier> const
@@ -6434,7 +6434,7 @@ bool SwMSDffManager::GetOLEStorageName(sal_uInt32 nOLEId, OUString& rStorageName
if( nLen < nSL )
break; // Not enough Bytes left
- if( 0x6A03 == nId && 0 < nLen )
+ if (0x6A03 == nId)
{
nPictureId = SVBT32ToUInt32(pSprm +
aSprmParser.DistanceToData(nId));
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 38a349fb5dc2..544f3785ddae 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -1742,18 +1742,11 @@ void SwWW8ImplReader::SetStylesList(sal_uInt16 nStyle, sal_uInt16 nCurrentLFO,
rStyleInf.m_nLFOIndex = nCurrentLFO;
rStyleInf.m_nListLevel = nCurrentLevel;
- if (
- (USHRT_MAX > nCurrentLFO) &&
- (WW8ListManager::nMaxLevel > nCurrentLevel)
- )
- {
- std::vector<sal_uInt8> aParaSprms;
- SwNumRule *pNmRule =
- m_xLstManager->GetNumRuleForActivation(nCurrentLFO,
- nCurrentLevel, aParaSprms);
- if (pNmRule)
- UseListIndent(rStyleInf, pNmRule->Get(nCurrentLevel));
- }
+ std::vector<sal_uInt8> aParaSprms;
+ SwNumRule* pNmRule = m_xLstManager->GetNumRuleForActivation(
+ nCurrentLFO, nCurrentLevel, aParaSprms);
+ if (pNmRule)
+ UseListIndent(rStyleInf, pNmRule->Get(nCurrentLevel));
}
}
}
@@ -1942,11 +1935,7 @@ void SwWW8ImplReader::Read_ListLevel(sal_uInt16, const sal_uInt8* pData,
if (WW8ListManager::nMaxLevel <= m_nListLevel )
m_nListLevel = WW8ListManager::nMaxLevel;
- else if
- (
- (USHRT_MAX > m_nLFOPosition) &&
- (WW8ListManager::nMaxLevel > m_nListLevel)
- )
+ else if (USHRT_MAX > m_nLFOPosition)
{
RegisterNumFormat(m_nLFOPosition, m_nListLevel);
m_nLFOPosition = USHRT_MAX;
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 1f2487dfa51b..deae6c38a6e2 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -787,10 +787,7 @@ void SwWW8ImplReader::HandleLineNumbering(const wwSection &rSection)
m_bNoLnNumYet = false;
}
- if (
- (0 < rSection.maSep.lnnMin) ||
- (bRestartLnNumPerSection && !m_bNoLnNumYet)
- )
+ if ((0 < rSection.maSep.lnnMin) || bRestartLnNumPerSection)
{
SwFormatLineNumber aLN;
if (const SwFormatLineNumber* pLN
@@ -802,7 +799,6 @@ void SwWW8ImplReader::HandleLineNumbering(const wwSection &rSection)
NewAttr(aLN);
m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_LINENUMBER);
}
- m_bNoLnNumYet = false;
}
}