diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2011-04-18 17:05:04 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2011-04-19 14:16:46 +0200 |
commit | e9054fe1757de13767c1a521cd01fa6ed1291e9e (patch) | |
tree | 1ab82e78bc5dc5d8ec98dfa7b7989e2ba08186e0 | |
parent | 201066430dc2a49eecd4ad55a0f02c831de13d57 (diff) |
a more reliable way to detect w:titlePg (bnc#654230)
-rw-r--r-- | sw/source/filter/ww8/wrtw8sty.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 83cece4881dc..7549cd367986 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -1594,6 +1594,7 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt } } + bool titlePage = false; if ( bOutPgDscSet ) { // es ist ein Follow gesetzt und dieser zeigt nicht auf sich @@ -1620,10 +1621,19 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt pPdFmt = &rFollowFmt; // has different headers/footers for the title page - AttrOutput().SectionTitlePage(); + titlePage = true; } } + // The code above tries to detect if this is first page headers/footers, + // but it doesn't work even for quite trivial testcases. As I don't actually + // understand that code, I'll keep it. The simple and (at least for me) reliable way + // to detect for first page seems to be just RES_POOLPAGE_FIRST. + if( pPd->GetPoolFmtId() == RES_POOLPAGE_FIRST ) + titlePage = true; + if( titlePage ) + AttrOutput().SectionTitlePage(); + const SfxItemSet* pOldI = pISet; AttrOutput().SectionPageBorders( pPdFmt, pPdFirstPgFmt ); @@ -1707,7 +1717,7 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt if ( !pPd->IsFooterShared() || bLeftRightPgChain ) MSWordSections::SetFooterFlag( nHeadFootFlags, *pPdLeftFmt, WW8_FOOTER_EVEN ); - if ( pPdFmt != pPdFirstPgFmt ) + if ( titlePage ) { // es gibt eine ErsteSeite: MSWordSections::SetHeaderFlag( nHeadFootFlags, *pPdFirstPgFmt, WW8_HEADER_FIRST ); |