[PATCH] fdo#44176 dmapper: fix import of titlepg top/bottom margin
Miklos Vajna
vmiklos at suse.cz
Wed Apr 11 00:45:53 PDT 2012
---
writerfilter/source/dmapper/PropertyMap.cxx | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index e74e784..ab438bd 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -788,9 +788,18 @@ void SectionPropertyMap::PrepareHeaderFooterProperties( bool bFirstPage )
operator[]( PropertyDefinition( PROP_FOOTER_BODY_DISTANCE, false )) = uno::makeAny( m_nHeaderBottom );
}
- //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 );
+ //now set the top/bottom margin
+ sal_Int32 nHeaderHeight = 0, nFooterHeight = 0;
+ if (bFirstPage)
+ {
+ // 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("HeaderHeight") >>= nHeaderHeight;
+ if (m_aFollowPageStyle.is() && !HasFooter(true) && HasFooter(false))
+ m_aFollowPageStyle->getPropertyValue("FooterHeight") >>= nFooterHeight;
+ }
+ operator[]( PropertyDefinition( PROP_TOP_MARGIN, false )) = uno::makeAny( m_nTopMargin + nHeaderHeight );
+ operator[]( PropertyDefinition( PROP_BOTTOM_MARGIN, false )) = uno::makeAny( m_nBottomMargin + nFooterHeight );
}
--
1.7.7
--zYM0uCDKw75PZbzx--
More information about the LibreOffice
mailing list