diff options
author | Cédric Bosdonnat <cedricbosdo@openoffice.org> | 2010-11-26 17:02:07 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedricbosdo@openoffice.org> | 2010-11-26 17:03:21 +0100 |
commit | 56a6681b4292702677a9bfc3ee0b8903a4bbc99e (patch) | |
tree | 22530719f8a43e35e97ddab75be44595b17b2d00 | |
parent | c4cb9ca53070293f6be4b1fffbd551829bf558a3 (diff) |
Fix n#653526: Some section was added after having written the SEPX
The real problem is probably more on the docx import side, but it can't
hurt to have some guards on the export as well.
-rw-r--r-- | sw/source/filter/ww8/wrtw8sty.cxx | 19 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.hxx | 1 |
2 files changed, 15 insertions, 5 deletions
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index c82f2b1d24..38e9d25f00 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -966,7 +966,8 @@ WW8_WrPlcSepx::WW8_WrPlcSepx( MSWordExportBase& rExport ) : MSWordSections( rExport ), aCps( 4, 4 ), pAttrs( 0 ), - pTxtPos( 0 ) + pTxtPos( 0 ), + bNoMoreSections( false ) { // to be in sync with the AppendSection() call in the MSWordSections // constructor @@ -1042,9 +1043,12 @@ void MSWordSections::AppendSection( const SwPageDesc* pPd, void WW8_WrPlcSepx::AppendSep( WW8_CP nStartCp, const SwPageDesc* pPd, const SwSectionFmt* pSectionFmt, ULONG nLnNumRestartNo ) { - aCps.Insert( nStartCp, aCps.Count() ); + if ( !bNoMoreSections ) + { + aCps.Insert( nStartCp, aCps.Count() ); - AppendSection( pPd, pSectionFmt, nLnNumRestartNo ); + AppendSection( pPd, pSectionFmt, nLnNumRestartNo ); + } } void MSWordSections::AppendSection( const SwFmtPageDesc& rPD, @@ -1059,9 +1063,12 @@ void MSWordSections::AppendSection( const SwFmtPageDesc& rPD, void WW8_WrPlcSepx::AppendSep( WW8_CP nStartCp, const SwFmtPageDesc& rPD, const SwNode& rNd, const SwSectionFmt* pSectionFmt, ULONG nLnNumRestartNo ) { - aCps.Insert(nStartCp, aCps.Count()); + if ( !bNoMoreSections ) + { + aCps.Insert(nStartCp, aCps.Count()); - AppendSection( rPD, rNd, pSectionFmt, nLnNumRestartNo ); + AppendSection( rPD, rNd, pSectionFmt, nLnNumRestartNo ); + } } // MSWordSections::SetNum() setzt in jeder Section beim 1. Aufruf den @@ -1746,6 +1753,8 @@ bool WW8_WrPlcSepx::WriteKFTxt( WW8Export& rWrt ) WW8_SepInfo& rSepInfo = aSects[i]; rWrt.SectionProperties( rSepInfo, pA ); + + bNoMoreSections = true; } rWrt.SetHdFtIndex( nOldIndex ); //0 diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index a1529b4763..081609d93f 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -228,6 +228,7 @@ class WW8_WrPlcSepx : public MSWordSections SvULongs aCps; // PTRARR von CPs WW8_PdAttrDesc* pAttrs; WW8_WrPlc0* pTxtPos; // Pos der einzelnen Header / Footer + bool bNoMoreSections; // No copy, no assign WW8_WrPlcSepx( const WW8_WrPlcSepx& ); |