summaryrefslogtreecommitdiff
path: root/lotuswordpro/source/filter/lwpfribsection.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'lotuswordpro/source/filter/lwpfribsection.cxx')
-rw-r--r--lotuswordpro/source/filter/lwpfribsection.cxx8
1 files changed, 4 insertions, 4 deletions
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);
}