summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-11-04 17:06:47 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-11-04 16:57:59 +0100
commit628e96ce1fce194b30a5c2912feb8b7ec0328db0 (patch)
tree7a901d6da7d0dea1da3ac55ebe96fc33fc904150 /lotuswordpro
parent9d5365f7cacecf92f1f056dce7bb6bbaf9f0cc40 (diff)
tdf#120703 PVS: V547 Expression is always true/false
Change-Id: I3432afca1ee9bf9e8adce1d55d58d57bf1a09cb4 Reviewed-on: https://gerrit.libreoffice.org/62847 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/lwptablelayout.cxx72
1 files changed, 35 insertions, 37 deletions
diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx
index b88a23bcdf1b..b595dc152c6a 100644
--- a/lotuswordpro/source/filter/lwptablelayout.cxx
+++ b/lotuswordpro/source/filter/lwptablelayout.cxx
@@ -1204,54 +1204,52 @@ void LwpTableLayout::PostProcessParagraph(XFCell *pCell, sal_uInt16 nRowID, sal_
return;
XFColor aNullColor = XFColor();
- if ( pXFPara)
+ OUString sNumfmt = pCellLayout->GetNumfmtName();
+ bool bColorMod = false;
+ XFNumberStyle* pNumStyle = nullptr;
+ XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
+ if (!sNumfmt.isEmpty())
{
- OUString sNumfmt = pCellLayout->GetNumfmtName();
- bool bColorMod = false;
- XFNumberStyle* pNumStyle = nullptr;
- XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
- if (!sNumfmt.isEmpty())
- {
- pNumStyle = static_cast<XFNumberStyle*>(pXFStyleManager->FindStyle( sNumfmt));
- XFColor aColor = pNumStyle->GetColor();
- if ( aColor != aNullColor )
- bColorMod = true;//end
- }
+ pNumStyle = static_cast<XFNumberStyle*>(pXFStyleManager->FindStyle(sNumfmt));
+ XFColor aColor = pNumStyle->GetColor();
+ if ( aColor != aNullColor )
+ bColorMod = true;//end
+ }
- XFParaStyle * pStyle = pXFStyleManager->FindParaStyle(pXFPara->GetStyleName());
- if ((pStyle && pStyle->GetNumberRight()) || bColorMod)
- {
- std::unique_ptr<XFParaStyle> xOverStyle(new XFParaStyle);
+ XFParaStyle * pStyle = pXFStyleManager->FindParaStyle(pXFPara->GetStyleName());
+ if ((pStyle && pStyle->GetNumberRight()) || bColorMod)
+ {
+ std::unique_ptr<XFParaStyle> xOverStyle(new XFParaStyle);
- if (pStyle)
- {
- *xOverStyle = *pStyle;
+ if (pStyle)
+ {
+ *xOverStyle = *pStyle;
- if (pStyle->GetNumberRight())
- xOverStyle->SetAlignType(enumXFAlignEnd);
- }
+ if (pStyle->GetNumberRight())
+ xOverStyle->SetAlignType(enumXFAlignEnd);
+ }
- if (bColorMod)
+ if (bColorMod)
+ {
+ rtl::Reference<XFFont> xFont = xOverStyle->GetFont();
+ if (xFont.is())
{
- rtl::Reference<XFFont> xFont = xOverStyle->GetFont();
- if (xFont.is())
+ XFColor aColor = xFont->GetColor();
+ if (aColor == aNullColor)
{
- XFColor aColor = xFont->GetColor();
- if ( aColor == aNullColor )
- {
- rtl::Reference<XFFont> pNewFont(new XFFont);
- aColor = pNumStyle->GetColor();
- pNewFont->SetColor(aColor);
- xOverStyle->SetFont(pNewFont);
- }
+ rtl::Reference<XFFont> pNewFont(new XFFont);
+ aColor = pNumStyle->GetColor();
+ pNewFont->SetColor(aColor);
+ xOverStyle->SetFont(pNewFont);
}
}
+ }
- xOverStyle->SetStyleName("");
- OUString StyleName = pXFStyleManager->AddStyle(std::move(xOverStyle)).m_pStyle->GetStyleName();
+ xOverStyle->SetStyleName("");
+ OUString StyleName
+ = pXFStyleManager->AddStyle(std::move(xOverStyle)).m_pStyle->GetStyleName();
- pXFPara->SetStyleName(StyleName);
- }
+ pXFPara->SetStyleName(StyleName);
}
}
}