Index: sw/source/filter/ww8/wrtww8.cxx =================================================================== --- sw/source/filter/ww8/wrtww8.cxx (revision 1355201) +++ sw/source/filter/ww8/wrtww8.cxx (working copy) @@ -2537,20 +2537,39 @@ ; else if ( !IsInTable() ) //No sections in table { - ReplaceCr( (char)0xc ); // Indikator fuer Page/Section-Break + //#120140# Do not need to insert a page/section break after a section end. Check this case first + sal_Bool bNeedExportBreakHere = sal_True; + if ( aIdx.GetNode().IsTxtNode() ) + { + SwTxtNode *pTempNext = aIdx.GetNode().GetTxtNode(); + if ( pTempNext ) + { + const SfxPoolItem * pTempItem = NULL; + if (SFX_ITEM_SET == pTempNext->GetpSwAttrSet()->GetItemState(RES_PAGEDESC, false, &pTempItem) + && pTempItem && ((SwFmtPageDesc*)pTempItem)->GetRegisteredIn()) + { + //Next node has a new page style which means this node is a section end. Do not insert another page/section break here + bNeedExportBreakHere = sal_False; + } + } + } + if (bNeedExportBreakHere) //#120140# End of check + { + ReplaceCr( (char)0xc ); // Indikator fuer Page/Section-Break - const SwSectionFmt* pParentFmt = rSect.GetFmt()->GetParent(); - if ( !pParentFmt ) - pParentFmt = (SwSectionFmt*)0xFFFFFFFF; + const SwSectionFmt* pParentFmt = rSect.GetFmt()->GetParent(); + if ( !pParentFmt ) + pParentFmt = (SwSectionFmt*)0xFFFFFFFF; - sal_uLong nRstLnNum; - if ( aIdx.GetNode().IsCntntNode() ) - nRstLnNum = ((SwCntntNode&)aIdx.GetNode()).GetSwAttrSet(). - GetLineNumber().GetStartValue(); - else - nRstLnNum = 0; + sal_uLong nRstLnNum; + if ( aIdx.GetNode().IsCntntNode() ) + nRstLnNum = ((SwCntntNode&)aIdx.GetNode()).GetSwAttrSet(). + GetLineNumber().GetStartValue(); + else + nRstLnNum = 0; - AppendSection( pAktPageDesc, pParentFmt, nRstLnNum ); + AppendSection( pAktPageDesc, pParentFmt, nRstLnNum ); + } } } else if ( pNd->IsStartNode() ) @@ -2731,10 +2750,9 @@ #10570# Similiarly having msvbasic storage seems to also trigger creating this stream */ - // memory leak #i120098#, the unnamed obj will be released in destructor. - xEscherStg = GetWriter().GetStorage().OpenSotStorage(CREATE_CONST_ASC(SL::aObjectPool), + GetWriter().GetStorage().OpenSotStorage(CREATE_CONST_ASC(SL::aObjectPool), STREAM_READWRITE | STREAM_SHARE_DENYALL); - } + } // dggInfo - escher stream WriteEscher(); Index: sw/source/filter/ww8/ww8atr.cxx =================================================================== --- sw/source/filter/ww8/ww8atr.cxx (revision 1355201) +++ sw/source/filter/ww8/ww8atr.cxx (working copy) @@ -3566,7 +3566,8 @@ nUCode = 0x0; } //And the para is not of len 0, then replace this cr with the mark - if( nChar == 0x0e || nUCode == 0x0d ) + //#120140# If there is a cr before a column break, need replace the cr. So remove the "nChar==0x0e" check. + if( nUCode == 0x0d ) bReplaced = false; else {