summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/uiview/viewtab.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index b7f6e02dcc09..33dc8c268a3c 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -2416,14 +2416,17 @@ void SwView::StateTabWin(SfxItemSet& rSet)
rSet.Put( SfxBoolItem(SID_ATTR_PAGE_HEADER, bHeaderOn ) );
if(bHeaderOn)
{
- const SvxLRSpaceItem* rLR = static_cast<const SvxLRSpaceItem*>(
+ const SvxLRSpaceItem* pLR = static_cast<const SvxLRSpaceItem*>(
rHeader.GetHeaderFormat()->GetAttrSet().GetItem(SID_ATTR_LRSPACE));
- const SvxULSpaceItem* rUL = static_cast<const SvxULSpaceItem*>(
+ const SvxULSpaceItem* pUL = static_cast<const SvxULSpaceItem*>(
rHeader.GetHeaderFormat()->GetAttrSet().GetItem(SID_ATTR_ULSPACE));
- SvxLongLRSpaceItem aLR(rLR->GetLeft(), rLR->GetRight(), SID_ATTR_PAGE_HEADER_LRMARGIN);
- rSet.Put(aLR);
- SvxLongULSpaceItem aUL( rUL->GetUpper(), rUL->GetLower(), SID_ATTR_PAGE_HEADER_SPACING);
- rSet.Put(aUL);
+ if (pLR && pUL)
+ {
+ SvxLongLRSpaceItem aLR(pLR->GetLeft(), pLR->GetRight(), SID_ATTR_PAGE_HEADER_LRMARGIN);
+ rSet.Put(aLR);
+ SvxLongULSpaceItem aUL( pUL->GetUpper(), pUL->GetLower(), SID_ATTR_PAGE_HEADER_SPACING);
+ rSet.Put(aUL);
+ }
bool bShared = !rDesc.IsHeaderShared();
bool bFirst = !rDesc.IsFirstShared(); // FIXME control changes for both header footer - tdf#100287