Kaydet (Commit) 45e60ae3 authored tarafından Miklos Vajna's avatar Miklos Vajna

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
üst ed92cdd7
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment