diff options
author | Justin Luth <justin_luth@sil.org> | 2016-07-29 22:03:55 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2016-07-30 04:33:04 +0000 |
commit | 4a6329badc9c8679945d1a1ec225e26e15d7bfd2 (patch) | |
tree | 02db44e5d63988b0f1632742388ca8296f1a3a88 /writerfilter | |
parent | 74a017e27d04be13f072d03cab3a623a6b6d43ae (diff) |
docx - inherit FollowPage before FirstPage
GetPageStyle(bTitlePage == true) will check if the follow exists.
If not, it will create a new style - which defeats the purpose
of inheriting from the previous section if this section didn't define
a new follow.
Change-Id: I235bc9b7bc35c9875295733313a6452ba8896c4f
Reviewed-on: https://gerrit.libreoffice.org/27700
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/PropertyMap.cxx | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index 094e2b41849c..f36c150d5fb6 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -1126,17 +1126,8 @@ throw ( css::beans::UnknownPropertyException, // if no new styles have been created for this section, inherit from the previous section, // otherwise apply this section's settings to the new style. + // Ensure that FollowPage is inherited first - otherwise GetPageStyle may auto-create a follow when checking FirstPage. SectionPropertyMap* pLastContext = rDM_Impl.GetLastSectionContext(); - if( pLastContext && m_sFirstPageStyleName.isEmpty() ) - m_sFirstPageStyleName = pLastContext->GetPageStyleName( /*bFirst=*/true ); - else - { - HandleMarginsHeaderFooter( /*bFirst=*/true, rDM_Impl ); - GetPageStyle( xPageStyles, xTextFactory, /*bFirst=*/true ); - if( rDM_Impl.IsNewDoc() && m_aFirstPageStyle.is() ) - ApplyProperties_( m_aFirstPageStyle ); - } - if( pLastContext && m_sFollowPageStyleName.isEmpty() ) m_sFollowPageStyleName = pLastContext->GetPageStyleName(); else @@ -1147,6 +1138,16 @@ throw ( css::beans::UnknownPropertyException, ApplyProperties_( m_aFollowPageStyle ); } + if( pLastContext && m_sFirstPageStyleName.isEmpty() ) + m_sFirstPageStyleName = pLastContext->GetPageStyleName( /*bFirst=*/true ); + else + { + HandleMarginsHeaderFooter( /*bFirst=*/true, rDM_Impl ); + GetPageStyle( xPageStyles, xTextFactory, /*bFirst=*/true ); + if( rDM_Impl.IsNewDoc() && m_aFirstPageStyle.is() ) + ApplyProperties_( m_aFirstPageStyle ); + } + GetPageStyle( xPageStyles, xTextFactory, /*bFirst=*/true ); // Chain m_aFollowPageStyle to be after m_aFirstPageStyle m_aFirstPageStyle->setPropertyValue( "FollowStyle", uno::makeAny(m_sFollowPageStyleName) ); |