summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-06-28 13:06:52 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-09-28 14:59:47 +0200
commitc4461be541f89918efe77546def18835ef90c490 (patch)
tree157a7527b3946f7c3055288a666e7414600aadeb /writerfilter
parent4da461814f158a6ec150700474a191adbce21e9a (diff)
dmapper: better fix for import of titlepg top/bottom margin
This commit reverts the fix for fdo#44176, and implements a better fix, which keeps the original testcase passing, but also fixes the layout of a simple document, having different first, odd and even headers within the same section. Change-Id: I96893ce3e886e479f1d7640b126ad7a1dd828bdb (cherry picked from commit 45e60ae3120b81e2987151a8485766c2fa946d48)
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)