[Libreoffice-commits] core.git: Branch 'libreoffice-5-1' - lotuswordpro/qa lotuswordpro/source
Caolán McNamara
caolanm at redhat.com
Tue Apr 5 05:45:27 UTC 2016
lotuswordpro/qa/cppunit/data/fail/null-1.lwp |binary
lotuswordpro/source/filter/lwpfribsection.cxx | 8 ++++----
2 files changed, 4 insertions(+), 4 deletions(-)
New commits:
commit b5966b8f43d9f46e2a6ba89b2f955a3216cdd367
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Apr 4 10:36:26 2016 +0100
currentlayout may be null
Change-Id: I1e53482e722b82f052434f45e37a2fbdb2ea6ffc
(cherry picked from commit a4bc9a43198074b529693f1852093d8d72eaae98)
Reviewed-on: https://gerrit.libreoffice.org/23803
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: David Tardon <dtardon at redhat.com>
diff --git a/lotuswordpro/qa/cppunit/data/fail/null-1.lwp b/lotuswordpro/qa/cppunit/data/fail/null-1.lwp
new file mode 100644
index 0000000..06b8254
Binary files /dev/null and b/lotuswordpro/qa/cppunit/data/fail/null-1.lwp differ
diff --git a/lotuswordpro/source/filter/lwpfribsection.cxx b/lotuswordpro/source/filter/lwpfribsection.cxx
index a6ad875..8a6d334 100644
--- a/lotuswordpro/source/filter/lwpfribsection.cxx
+++ b/lotuswordpro/source/filter/lwpfribsection.cxx
@@ -314,11 +314,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);
}
More information about the Libreoffice-commits
mailing list