diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-06-28 13:06:52 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-06-28 13:19:18 +0200 |
commit | 45e60ae3120b81e2987151a8485766c2fa946d48 (patch) | |
tree | 2dbeff8dcd52f1f9ef0a2c0d2bdd3eb10b7f4beb | |
parent | ed92cdd7f131bc37957d91d9ff171a2c5c2716c7 (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
-rw-r--r-- | writerfilter/source/dmapper/PropertyMap.cxx | 19 |
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) |