[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - lotuswordpro/source

Caolán McNamara caolanm at redhat.com
Wed Dec 9 05:32:56 PST 2015


 lotuswordpro/source/filter/lwptoc.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 03d61b0702edfaf5a2edcbf529f8b82c6463f9f3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Dec 9 13:30:02 2015 +0000

    guard against no default text style
    
    Change-Id: I7416d709de79ae88cf4a9546d8adfecec9935238
    (cherry picked from commit 80297dd0f21bfeaa9bae09cacfa29ab2eee64c09)
    Reviewed-on: https://gerrit.libreoffice.org/20528
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/lotuswordpro/source/filter/lwptoc.cxx b/lotuswordpro/source/filter/lwptoc.cxx
index c3bfd78..9650d7f 100644
--- a/lotuswordpro/source/filter/lwptoc.cxx
+++ b/lotuswordpro/source/filter/lwptoc.cxx
@@ -125,7 +125,8 @@ void LwpTocSuperLayout::RegisterStyle()
     LwpSuperTableLayout::RegisterStyle();
 
     // Get font info of default text style and set into tab style
-    XFParaStyle* pBaseStyle = static_cast<XFParaStyle*>(m_pFoundry->GetStyleManager()->GetStyle(*m_pFoundry->GetDefaultTextStyle()));
+    const LwpObjectID *pDefaultTextStyle = m_pFoundry->GetDefaultTextStyle();
+    XFParaStyle* pBaseStyle = pDefaultTextStyle ? static_cast<XFParaStyle*>(m_pFoundry->GetStyleManager()->GetStyle(*pDefaultTextStyle)) : nullptr;
     XFTextStyle*pTextStyle = new XFTextStyle;
     if (pBaseStyle)
         pTextStyle->SetFont(pBaseStyle->GetFont()); // who delete this font?????


More information about the Libreoffice-commits mailing list