Kaydet (Commit) d2a48f8b authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) Andras Timar

guard against null Foundry

Change-Id: I8aabc68e8dfb9376cafe4cc709b18344da083a01
(cherry picked from commit 2f0fba49)
(cherry picked from commit 51a1b41a)
Reviewed-on: https://gerrit.libreoffice.org/20755Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarDavid Tardon <dtardon@redhat.com>
(cherry picked from commit f1c1380c)
üst 1e382999
...@@ -250,14 +250,14 @@ void LwpFrib::RegisterStyle(LwpFoundry* pFoundry) ...@@ -250,14 +250,14 @@ void LwpFrib::RegisterStyle(LwpFoundry* pFoundry)
m_StyleName.clear(); m_StyleName.clear();
XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager(); XFStyleManager* pXFStyleManager = LwpGlobalMgr::GetInstance()->GetXFStyleManager();
XFTextStyle* pNamedStyle = nullptr; XFTextStyle* pNamedStyle = nullptr;
if (m_pModifiers->HasCharStyle) if (m_pModifiers->HasCharStyle && pFoundry)
{ {
pNamedStyle = static_cast<XFTextStyle*> pNamedStyle = static_cast<XFTextStyle*>
(pFoundry->GetStyleManager()->GetStyle(m_pModifiers->CharStyleID)); (pFoundry->GetStyleManager()->GetStyle(m_pModifiers->CharStyleID));
} }
if (pNamedStyle) if (pNamedStyle)
{ {
if (m_pModifiers->FontID) if (m_pModifiers->FontID && pFoundry)
{ {
pStyle = new XFTextStyle(); pStyle = new XFTextStyle();
*pStyle = *pNamedStyle; *pStyle = *pNamedStyle;
...@@ -277,7 +277,7 @@ void LwpFrib::RegisterStyle(LwpFoundry* pFoundry) ...@@ -277,7 +277,7 @@ void LwpFrib::RegisterStyle(LwpFoundry* pFoundry)
} }
else else
{ {
if (m_pModifiers->FontID) if (m_pModifiers->FontID && pFoundry)
{ {
pStyle = new XFTextStyle(); pStyle = new XFTextStyle();
pFont = pFoundry->GetFontManger().CreateFont(m_pModifiers->FontID); pFont = pFoundry->GetFontManger().CreateFont(m_pModifiers->FontID);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment