summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-10-20 20:50:31 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-10-21 18:18:40 +0200
commit6793ae2504dea490d26cbf9b2ebd33774a66d639 (patch)
tree7f5559fde4a384bb41d5de2ca1826092862b5c13
parentd1771e8de2f49193821d281239cc6b99c7c692e4 (diff)
GetBulletOverride never returns nullptr
Change-Id: I9becc9397a93369cd46922b66b45990e9e6a51f1 Reviewed-on: https://gerrit.libreoffice.org/62108 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--lotuswordpro/source/filter/lwppara1.cxx29
-rw-r--r--lotuswordpro/source/filter/lwpparastyle.hxx2
2 files changed, 12 insertions, 19 deletions
diff --git a/lotuswordpro/source/filter/lwppara1.cxx b/lotuswordpro/source/filter/lwppara1.cxx
index 8909346a9fba..7fb671cc4ccb 100644
--- a/lotuswordpro/source/filter/lwppara1.cxx
+++ b/lotuswordpro/source/filter/lwppara1.cxx
@@ -467,12 +467,8 @@ void LwpPara::OverrideParaBullet(LwpParaProperty* pProps)
{
m_bHasBullet = true;
- const LwpOverride* pBullet= pParaStyle->GetBulletOverride();
- std::unique_ptr<LwpBulletOverride> xFinalBullet(
- pBullet
- ? polymorphic_downcast<LwpBulletOverride*>(pBullet->clone())
- : new LwpBulletOverride)
- ;
+ const LwpBulletOverride& rBullet= pParaStyle->GetBulletOverride();
+ std::unique_ptr<LwpBulletOverride> xFinalBullet(rBullet.clone());
std::unique_ptr<LwpBulletOverride> const pLocalBullet2(pLocalBullet->clone());
pLocalBullet2->Override(xFinalBullet.get());
@@ -491,21 +487,18 @@ void LwpPara::OverrideParaBullet(LwpParaProperty* pProps)
}
else
{
- const LwpBulletOverride* pBullOver = pParaStyle->GetBulletOverride();
- if (pBullOver)
+ const LwpBulletOverride& rBullOver = pParaStyle->GetBulletOverride();
+ m_aSilverBulletID = rBullOver.GetSilverBullet();
+ if (!m_aSilverBulletID.IsNull())
{
- m_aSilverBulletID = pBullOver->GetSilverBullet();
- if (!m_aSilverBulletID.IsNull())
- {
- m_bHasBullet = true;
-
- m_pSilverBullet = dynamic_cast<LwpSilverBullet*>(m_aSilverBulletID.obj(VO_SILVERBULLET).get());
- if (m_pSilverBullet)
- m_pSilverBullet->SetFoundry(m_pFoundry);
- }
+ m_bHasBullet = true;
- m_xBullOver.reset(pBullOver->clone());
+ m_pSilverBullet = dynamic_cast<LwpSilverBullet*>(m_aSilverBulletID.obj(VO_SILVERBULLET).get());
+ if (m_pSilverBullet)
+ m_pSilverBullet->SetFoundry(m_pFoundry);
}
+
+ m_xBullOver.reset(rBullOver.clone());
}
}
/**
diff --git a/lotuswordpro/source/filter/lwpparastyle.hxx b/lotuswordpro/source/filter/lwpparastyle.hxx
index 8ffa26af9a7f..3dc461ae1518 100644
--- a/lotuswordpro/source/filter/lwpparastyle.hxx
+++ b/lotuswordpro/source/filter/lwpparastyle.hxx
@@ -97,7 +97,7 @@ public:
LwpParaBorderOverride* GetParaBorder() const;
LwpBreaksOverride* GetBreaks() const;
LwpTabOverride* GetTabOverride() const;
- const LwpBulletOverride* GetBulletOverride() const { return &m_BulletOverride;}
+ const LwpBulletOverride& GetBulletOverride() const { return m_BulletOverride; }
LwpNumberingOverride* GetNumberingOverride() const;
public:
static void ApplySubBorder(LwpBorderStuff* pBorderStuff, LwpBorderStuff::BorderType eType, XFBorders* pXFBorders);