summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-11-21 17:41:24 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-11-21 18:10:59 +0100
commit17e51f427b3f0cec74ac8e0a1b3f51189006ae6f (patch)
tree8ba685a9029fe5972a490abc58fcef69b843f7e9 /writerfilter
parente37e8f38d1f5c6bc427965dc535f1a64f0c8649c (diff)
DOCX import: first page header should always set default headers as well
writerfilter imports a section with first and default headers / footers as two page styles: a first page one and a follow one. In case we nominally have a header on the first page only, we still need to enable it in the follow page style as well, otherwise on export when we recognize the first + follow chain as a single section, we'll end up with a header that looses its header margin. Change-Id: I4923daffefb243d2de4805a9931150ce4d9a6c81
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index b4fa15bd45e4..5c3aaebbe1ec 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1478,6 +1478,17 @@ void DomainMapper_Impl::PushPageHeaderFooter(bool bHeader, SectionPropertyMap::P
rPropNameSupplier.GetName(ePropIsOn),
uno::makeAny(sal_True));
+ if (bFirst)
+ {
+ OUString aFollowStyle = xPageStyle->getPropertyValue("FollowStyle").get<OUString>();
+ if (GetPageStyles()->hasByName(aFollowStyle))
+ {
+ // This is a first page and has a follow style, then enable the header/footer there as well to be consistent.
+ uno::Reference<beans::XPropertySet> xFollowStyle(GetPageStyles()->getByName(aFollowStyle), uno::UNO_QUERY);
+ xFollowStyle->setPropertyValue(rPropNameSupplier.GetName(ePropIsOn), uno::makeAny(sal_True));
+ }
+ }
+
// If the 'Different Even & Odd Pages' flag is turned on - do not ignore it
// Even if the 'Even' header/footer is blank - the flag should be imported (so it would look in LO like in Word)
if (!bFirst && GetSettingsTable()->GetEvenAndOddHeaders())