summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2016-07-29 22:03:55 +0300
committerAndras Timar <andras.timar@collabora.com>2016-10-10 18:58:47 +0200
commit82ff907974ad666bb9183f511c391ce2acf00515 (patch)
tree4cff65bb1a73b421e559bb1d8d3016549252d4e4 /writerfilter
parent703735db025347626294926059854e25c228c626 (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> (cherry picked from commit 4a6329badc9c8679945d1a1ec225e26e15d7bfd2)
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/PropertyMap.cxx21
1 files changed, 11 insertions, 10 deletions
diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx
index 180196e1a076..e1d5987c5b22 100644
--- a/writerfilter/source/dmapper/PropertyMap.cxx
+++ b/writerfilter/source/dmapper/PropertyMap.cxx
@@ -1132,17 +1132,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
@@ -1153,6 +1144,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) );