Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hi,

See
http://cgit.freedesktop.org/libreoffice/core/commit/?id=b0edaff

Regression from 3.4 for RTF, as far as I see this was never correct for
DOCX. Backported patch attached.

Thanks,

Miklos
From 951d8b3f2a476115e36cfe0d32133b6237e0e3e9 Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos@suse.cz>
Date: Wed, 11 Apr 2012 09:45:53 +0200
Subject: [PATCH] fdo#44176 dmapper: fix import of titlepg top/bottom margin

---
 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


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.