[Libreoffice-commits] core.git: lotuswordpro/source

Caolán McNamara caolanm at redhat.com
Sun Dec 13 09:06:11 PST 2015


 lotuswordpro/source/filter/lwppara.cxx |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

New commits:
commit 01f920f2cece7a05ea075130c19229029efe7c0f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Dec 13 17:05:30 2015 +0000

    most casts and checks
    
    Change-Id: I8be1b8298f096791628d1f51d36ceeabdc804f9a

diff --git a/lotuswordpro/source/filter/lwppara.cxx b/lotuswordpro/source/filter/lwppara.cxx
index 29c8fe0..99a2132 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;


More information about the Libreoffice-commits mailing list