diff options
-rw-r--r-- | sw/source/core/doc/docfld.cxx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index 8c0169502842..8474c968f359 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -1304,10 +1304,16 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds ) // This section will be hidden, but it wasn't before if (nShownSections == 1) { - // This would be the last section, so set its condition to false, and avoid hiding it. - OUString aCond("0"); - pSect->SetCondition(aCond); - bHide = false; + // Is the last node part of a section? + SwPaM aPam(GetNodes()); + aPam.Move(fnMoveForward, fnGoDoc); + if (aPam.Start()->nNode.GetNode().StartOfSectionNode()->IsSectionNode()) + { + // This would be the last section, so set its condition to false, and avoid hiding it. + OUString aCond("0"); + pSect->SetCondition(aCond); + bHide = false; + } } nShownSections--; } |