From 004cc81168ce4e9f9b2f8fddf3361f8c23323673 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 6 Nov 2018 10:19:19 +0200 Subject: loplugin:collapseif in dbaccess..lotuswordpro Change-Id: Ia2a0d25c3833dfde0cd28337361f3cbd2aa29662 Reviewed-on: https://gerrit.libreoffice.org/62934 Tested-by: Jenkins Reviewed-by: Noel Grandin --- lotuswordpro/source/filter/lwpfribptr.cxx | 17 +++++++--------- lotuswordpro/source/filter/lwpparastyle.cxx | 30 ++++++++++++----------------- 2 files changed, 19 insertions(+), 28 deletions(-) (limited to 'lotuswordpro/source') diff --git a/lotuswordpro/source/filter/lwpfribptr.cxx b/lotuswordpro/source/filter/lwpfribptr.cxx index 902727aef38c..2001fe2069f3 100644 --- a/lotuswordpro/source/filter/lwpfribptr.cxx +++ b/lotuswordpro/source/filter/lwpfribptr.cxx @@ -536,18 +536,15 @@ void LwpFribPtr::RegisterStyle() void LwpFribPtr::ProcessDropcap(LwpStory* pStory,LwpFrib* pFrib,sal_uInt32 nLen) { - if (pStory) + if (pStory && pStory->GetDropcapFlag()) { - if (pStory->GetDropcapFlag()) - { - XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager(); - XFTextStyle* pFribStyle = pXFStyleManager->FindTextStyle(pFrib->GetStyleName()); - pFribStyle->GetFont()->SetFontSize(0); + XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager(); + XFTextStyle* pFribStyle = pXFStyleManager->FindTextStyle(pFrib->GetStyleName()); + pFribStyle->GetFont()->SetFontSize(0); - LwpDropcapLayout* pObj = dynamic_cast(pStory->GetLayoutsWithMe().GetOnlyLayout().obj().get()); - if (pObj) - pObj->SetChars(nLen); - } + LwpDropcapLayout* pObj = dynamic_cast(pStory->GetLayoutsWithMe().GetOnlyLayout().obj().get()); + if (pObj) + pObj->SetChars(nLen); } } /** diff --git a/lotuswordpro/source/filter/lwpparastyle.cxx b/lotuswordpro/source/filter/lwpparastyle.cxx index 157dc041adc1..e99ee6a9e603 100644 --- a/lotuswordpro/source/filter/lwpparastyle.cxx +++ b/lotuswordpro/source/filter/lwpparastyle.cxx @@ -436,17 +436,14 @@ void LwpParaStyle::ApplyIndent(LwpPara* pPara, XFParaStyle* pParaStyle, LwpInden pTotalIndent.reset(pIndent->clone()); //for bullet only - if (pPara) + if (pPara && pPara->GetBulletFlag()) { - if (pPara->GetBulletFlag()) - { - pTotalIndent->SetMAll(o3tl::saturating_add(pParentIndent->GetMAll(), pTotalIndent->GetMAll())); - pTotalIndent->SetMRight(o3tl::saturating_add(pParentIndent->GetMRight(), pTotalIndent->GetMRight())); - pParaStyle->SetMargins(LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits( - pTotalIndent->GetMAll())), pTotalIndent->GetRight()); - pPara->SetIndent(pTotalIndent.release()); - return; - } + pTotalIndent->SetMAll(o3tl::saturating_add(pParentIndent->GetMAll(), pTotalIndent->GetMAll())); + pTotalIndent->SetMRight(o3tl::saturating_add(pParentIndent->GetMRight(), pTotalIndent->GetMRight())); + pParaStyle->SetMargins(LwpTools::ConvertToMetric(LwpTools::ConvertFromUnits( + pTotalIndent->GetMAll())), pTotalIndent->GetRight()); + pPara->SetIndent(pTotalIndent.release()); + return; } sal_uInt16 relative = pParentIndent->GetRelative(); @@ -467,15 +464,12 @@ void LwpParaStyle::ApplyIndent(LwpPara* pPara, XFParaStyle* pParaStyle, LwpInden else { pTotalIndent.reset(pIndent->clone()); - if (pPara) + if (pPara && pPara->GetBulletFlag()) { - if (pPara->GetBulletFlag()) - { - pParaStyle->SetMargins(LwpTools::ConvertToMetric( - LwpTools::ConvertFromUnits(pIndent->GetMAll())), pIndent->GetRight()); - pPara->SetIndent(pTotalIndent.release()); - return; - } + pParaStyle->SetMargins(LwpTools::ConvertToMetric( + LwpTools::ConvertFromUnits(pIndent->GetMAll())), pIndent->GetRight()); + pPara->SetIndent(pTotalIndent.release()); + return; } pParaStyle->SetIndent(pIndent->GetFirst()); -- cgit