diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-04-04 10:36:26 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2016-04-10 21:22:59 +0200 |
commit | 175b3c17e10e88560c1a40cff80d2a71d9751032 (patch) | |
tree | 5318bf905f7bb40be30c0a0dc2360116f240dc50 | |
parent | hold bullet para by reference (diff) | |
download | core-175b3c17e10e88560c1a40cff80d2a71d9751032.tar.gz core-175b3c17e10e88560c1a40cff80d2a71d9751032.zip |
currentlayout may be null
Change-Id: I1e53482e722b82f052434f45e37a2fbdb2ea6ffc
(cherry picked from commit a4bc9a43198074b529693f1852093d8d72eaae98)
Reviewed-on: https://gerrit.libreoffice.org/23804
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: David Tardon <dtardon@redhat.com>
(cherry picked from commit 51b4af045d670c67f107922b2137fea49e042606)
-rw-r--r-- | lotuswordpro/qa/cppunit/data/fail/null-1.lwp | bin | 0 -> 15952 bytes | |||
-rw-r--r-- | lotuswordpro/source/filter/lwpfribsection.cxx | 8 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lotuswordpro/qa/cppunit/data/fail/null-1.lwp b/lotuswordpro/qa/cppunit/data/fail/null-1.lwp Binary files differnew file mode 100644 index 000000000000..06b8254431df --- /dev/null +++ b/lotuswordpro/qa/cppunit/data/fail/null-1.lwp diff --git a/lotuswordpro/source/filter/lwpfribsection.cxx b/lotuswordpro/source/filter/lwpfribsection.cxx index 74cc81d78024..b5c457ab1734 100644 --- a/lotuswordpro/source/filter/lwpfribsection.cxx +++ b/lotuswordpro/source/filter/lwpfribsection.cxx @@ -317,11 +317,11 @@ bool LwpMasterPage::RegisterMasterPage(LwpFrib* pFrib) XFSectionStyle* pSectStyle= new XFSectionStyle(); //set margin pStory = dynamic_cast<LwpStory*>(m_pPara->GetStoryID().obj().get()); - if (pStory) + LwpPageLayout* pCurrentLayout = pStory ? pStory->GetCurrentLayout() : nullptr; + if (pCurrentLayout) { - LwpPageLayout* pCurrentLayout = pStory->GetCurrentLayout(); - double fLeft = m_pLayout->GetMarginsValue(MARGIN_LEFT)- pCurrentLayout->GetMarginsValue(MARGIN_LEFT); - double fRight = m_pLayout->GetMarginsValue(MARGIN_RIGHT)- pCurrentLayout->GetMarginsValue(MARGIN_RIGHT); + double fLeft = m_pLayout->GetMarginsValue(MARGIN_LEFT) - pCurrentLayout->GetMarginsValue(MARGIN_LEFT); + double fRight = m_pLayout->GetMarginsValue(MARGIN_RIGHT) - pCurrentLayout->GetMarginsValue(MARGIN_RIGHT); pSectStyle->SetMarginLeft(fLeft); pSectStyle->SetMarginRight(fRight); } |