diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-12-13 17:05:30 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-12-13 17:05:30 +0000 |
commit | 01f920f2cece7a05ea075130c19229029efe7c0f (patch) | |
tree | 722bf10fb95614fb9509d9b67c35bde8c0763dcc /lotuswordpro | |
parent | 80509545cc43893776dd24f441e9b95567ce06db (diff) |
most casts and checks
Change-Id: I8be1b8298f096791628d1f51d36ceeabdc804f9a
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/source/filter/lwppara.cxx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lotuswordpro/source/filter/lwppara.cxx b/lotuswordpro/source/filter/lwppara.cxx index 29c8fe0fb8d2..99a2132fb6ee 100644 --- a/lotuswordpro/source/filter/lwppara.cxx +++ b/lotuswordpro/source/filter/lwppara.cxx @@ -348,13 +348,14 @@ void LwpPara::RegisterStyle() //2 reg para style if (!m_pFoundry) return; - XFParaStyle* pBaseStyle = static_cast<XFParaStyle*>(m_pFoundry->GetStyleManager()->GetStyle(m_ParaStyle)); + XFParaStyle* pBaseStyle = dynamic_cast<XFParaStyle*>(m_pFoundry->GetStyleManager()->GetStyle(m_ParaStyle)); if (pBaseStyle == nullptr) return; m_StyleName = pBaseStyle->GetStyleName();//such intf to be added m_ParentStyleName = m_StyleName; XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager(); - if (GetParaStyle()->GetIndent()) + LwpParaStyle* pParaStyle = GetParaStyle(); + if (pParaStyle && pParaStyle->GetIndent()) { std::unique_ptr<LwpIndentOverride> pIndentOverride(GetParaStyle()->GetIndent()->clone()); delete m_pIndentOverride; @@ -736,13 +737,13 @@ void LwpPara::RegisterStyle() //register tab style if(m_Fribs.HasFrib(FRIB_TAG_TAB)) { - XFParaStyle* pParaStyle = new XFParaStyle; - *pParaStyle = *GetXFParaStyle(); + XFParaStyle* pNewParaStyle = new XFParaStyle; + *pNewParaStyle = *GetXFParaStyle(); //pOverStyle->SetStyleName(""); - this->RegisterTabStyle(pParaStyle); + this->RegisterTabStyle(pNewParaStyle); if (!m_ParentStyleName.isEmpty()) - pParaStyle->SetParentStyleName(m_ParentStyleName); - m_StyleName = pXFStyleManager->AddStyle(pParaStyle).m_pStyle->GetStyleName(); + pNewParaStyle->SetParentStyleName(m_ParentStyleName); + m_StyleName = pXFStyleManager->AddStyle(pNewParaStyle).m_pStyle->GetStyleName(); } //register master page; |