summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/docbm.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/doc/docbm.cxx')
-rw-r--r--sw/source/core/doc/docbm.cxx15
1 files changed, 11 insertions, 4 deletions
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index e047b2d1e319..ab5e544c2358 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -197,10 +197,17 @@ namespace
bool lcl_Lower( const SwPosition& rPos, const SwNode& rNdIdx, std::optional<sal_Int32> oContentIdx )
{
- return rPos.GetNode() < rNdIdx
- || ( oContentIdx.has_value()
- && rPos.GetNode() == rNdIdx
- && rPos.GetContentIndex() < *oContentIdx );
+ if (rPos.GetNode() < rNdIdx)
+ return true;
+
+ if (rPos.GetNode() != rNdIdx || !oContentIdx)
+ return false;
+
+ if (rPos.GetContentIndex() < *oContentIdx)
+ return true;
+
+ // paragraph end selected?
+ return rNdIdx.IsTextNode() && *oContentIdx == rNdIdx.GetTextNode()->Len();
}
bool lcl_MarkOrderingByStart(const ::sw::mark::MarkBase *const pFirst,