summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2011-04-18 17:46:54 +0200
committerLuboš Luňák <l.lunak@suse.cz>2011-04-19 14:19:41 +0200
commit4dd6c047e4ce08832d05b8ca4c8e92a08f642e7d (patch)
treec9303d5b3727f7ddea7bddbcdab6e14a423ea5c0
parent48a1b2b9650f1139b5063f9aadc008dcd0ed2646 (diff)
avoid first-page header/footer extending to all pages (bnc#654230)
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx22
1 files changed, 13 insertions, 9 deletions
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 53c192a760..0ca016004e 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1708,22 +1708,26 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt
if ( nBreakCode != 0 )
{
- MSWordSections::SetHeaderFlag( nHeadFootFlags, *pPdFmt, WW8_HEADER_ODD );
- MSWordSections::SetFooterFlag( nHeadFootFlags, *pPdFmt, WW8_FOOTER_ODD );
-
- if ( !pPd->IsHeaderShared() || bLeftRightPgChain )
- MSWordSections::SetHeaderFlag( nHeadFootFlags, *pPdLeftFmt, WW8_HEADER_EVEN );
-
- if ( !pPd->IsFooterShared() || bLeftRightPgChain )
- MSWordSections::SetFooterFlag( nHeadFootFlags, *pPdLeftFmt, WW8_FOOTER_EVEN );
-
if ( titlePage )
{
// es gibt eine ErsteSeite:
MSWordSections::SetHeaderFlag( nHeadFootFlags, *pPdFirstPgFmt, WW8_HEADER_FIRST );
MSWordSections::SetFooterFlag( nHeadFootFlags, *pPdFirstPgFmt, WW8_FOOTER_FIRST );
}
+ // write other headers/footers only if it's not the first page - I'm not quite sure
+ // this is technically correct, but it avoids first-page headers/footers
+ // extending to all pages (bnc#654230)
+ if( pPdFmt != pPdFirstPgFmt )
+ {
+ MSWordSections::SetHeaderFlag( nHeadFootFlags, *pPdFmt, WW8_HEADER_ODD );
+ MSWordSections::SetFooterFlag( nHeadFootFlags, *pPdFmt, WW8_FOOTER_ODD );
+
+ if ( !pPd->IsHeaderShared() || bLeftRightPgChain )
+ MSWordSections::SetHeaderFlag( nHeadFootFlags, *pPdLeftFmt, WW8_HEADER_EVEN );
+ if ( !pPd->IsFooterShared() || bLeftRightPgChain )
+ MSWordSections::SetFooterFlag( nHeadFootFlags, *pPdLeftFmt, WW8_FOOTER_EVEN );
+ }
AttrOutput().SectionWW6HeaderFooterFlags( nHeadFootFlags );
}