diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 6ea91ee1c727..05b968737cc3 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -1909,10 +1909,6 @@ void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc, //section again. pActualSection.reset(pActualSection->GetUpper()); pLay = pLay->FindSctFrame(); - if (pLay->IsHiddenNow()) - { - newHiddenSections.push_back(static_cast(pLay)); - } if ( pActualSection ) { //Could be, that the last SectionFrame remains empty. @@ -1927,6 +1923,10 @@ void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc, } else { + if (pLay->IsHiddenNow()) + { + newHiddenSections.push_back(static_cast(pLay)); + } pPrv = pLay; pLay = pLay->GetUpper(); } @@ -1970,6 +1970,10 @@ void InsertCnt_( SwLayoutFrame *pLay, SwDoc *pDoc, } else { + if (pLay->IsHiddenNow()) + { + newHiddenSections.push_back(static_cast(pLay)); + } //Nothing more with sections, it goes on right behind //the SectionFrame. pPrv = pLay;