summaryrefslogtreecommitdiff
path: root/sw/source/core/text/txtfrm.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/text/txtfrm.cxx')
-rw-r--r--sw/source/core/text/txtfrm.cxx17
1 files changed, 16 insertions, 1 deletions
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index b8d450779ee7..676210c0c800 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -1373,6 +1373,9 @@ bool SwTextFrame::IsHiddenNow() const
return true;
}
+ if (SwContentFrame::IsHiddenNow())
+ return true;
+
bool bHiddenCharsHidePara(false);
bool bHiddenParaField(false);
if (m_pMergedPara)
@@ -1438,6 +1441,19 @@ bool SwTextFrame::IsHiddenNow() const
( bHiddenCharsHidePara &&
!pVsh->GetViewOptions()->IsShowHiddenChar() ) )
{
+ // in order to put the cursor in the body text, one paragraph must
+ // be visible - check this for the 1st body paragraph
+ if (IsInDocBody() && FindPrevCnt() == nullptr)
+ {
+ for (SwContentFrame const* pNext = FindNextCnt(true);
+ pNext != nullptr; pNext = pNext->FindNextCnt(true))
+ {
+ if (!pNext->IsHiddenNow())
+ return true;
+ }
+ SAL_INFO("sw.core", "unhiding one body paragraph");
+ return false;
+ }
return true;
}
}
@@ -1922,7 +1938,6 @@ void UpdateMergedParaForMove(sw::MergedPara & rMerged,
}
if (nLastEnd != rNode.Len()) // without nLen, string yet to be removed
{
- assert(rNode.Len() == 0 || nLastEnd < nSourceEnd);
if (nLastEnd < nSourceEnd)
{
deleted.emplace_back(std::max(nLastEnd, nSourceStart), nSourceEnd);