summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx19
1 files changed, 6 insertions, 13 deletions
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 2d3d4cb04b3f..8542d7ed3a68 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -782,19 +782,12 @@ void SectionPropertyMap::PrepareHeaderFooterProperties( bool bFirstPage )
operator[]( PropertyDefinition( PROP_FOOTER_BODY_DISTANCE, false )) = uno::makeAny( m_nHeaderBottom );
}
- //now set the top/bottom margin
- sal_Int32 nHeaderHeight = 0, nFooterHeight = 0;
- if (bFirstPage)
- {
- PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
- // make sure the height of the header/footer is added to the top/bottom margin if necessary
- if (m_aFollowPageStyle.is() && !HasHeader(true) && HasHeader(false))
- m_aFollowPageStyle->getPropertyValue(rPropNameSupplier.GetName(PROP_HEADER_HEIGHT)) >>= nHeaderHeight;
- if (m_aFollowPageStyle.is() && !HasFooter(true) && HasFooter(false))
- m_aFollowPageStyle->getPropertyValue(rPropNameSupplier.GetName(PROP_FOOTER_HEIGHT)) >>= nFooterHeight;
- }
- operator[]( PropertyDefinition( PROP_TOP_MARGIN, false )) = uno::makeAny( m_nTopMargin + nHeaderHeight );
- operator[]( PropertyDefinition( PROP_BOTTOM_MARGIN, false )) = uno::makeAny( m_nBottomMargin + nFooterHeight );
+ //now set the top/bottom margin for the follow page style
+ operator[]( PropertyDefinition( PROP_TOP_MARGIN, false )) = uno::makeAny( m_nTopMargin );
+ operator[]( PropertyDefinition( PROP_BOTTOM_MARGIN, false )) = uno::makeAny( m_nBottomMargin );
+
+ // Restore original top margin, so we don't end up with a smaller margin in case we have to produce two page styles from one Word section.
+ m_nTopMargin = nTopMargin;
}
uno::Reference<beans::XPropertySet> lcl_GetRangeProperties(bool bIsFirstSection, DomainMapper_Impl& rDM_Impl, uno::Reference<text::XTextRange> xStartingRange)