summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editeng/inc/outleeng.hxx2
-rw-r--r--editeng/source/editeng/impedit2.cxx10
-rw-r--r--editeng/source/outliner/outleeng.cxx5
3 files changed, 16 insertions, 1 deletions
diff --git a/editeng/inc/outleeng.hxx b/editeng/inc/outleeng.hxx
index 56f7aa62485e..fe118d78ed92 100644
--- a/editeng/inc/outleeng.hxx
+++ b/editeng/inc/outleeng.hxx
@@ -69,6 +69,8 @@ public:
virtual tools::Rectangle GetBulletArea( sal_Int32 nPara ) override;
+ sal_Int16 GetDepth( sal_Int32 nPara ) const;
+
/// @returns state of the SdrCompatibilityFlag
std::optional<bool> GetCompatFlag(SdrCompatibilityFlag eFlag) const;
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 4fcf6e142a7a..f8d15dcdbee2 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -75,6 +75,7 @@
#include <memory>
#include <string_view>
#include <fstream>
+#include <outleeng.hxx>
using namespace ::com::sun::star;
@@ -4501,10 +4502,17 @@ bool ImpEditEngine::isInEmptyClusterAtTheEnd(ParaPortion& rPortion)
return false;
sal_Int32 nCurrent = rParagraphs.lastIndex();
+
while (nCurrent > 0 && rParagraphs.getRef(nCurrent).IsEmpty())
{
if (nCurrent == nPortion)
- return true;
+ {
+ OutlinerEditEng* pOutlEditEng{ dynamic_cast<OutlinerEditEng*>(mpEditEngine)};
+ if (pOutlEditEng)
+ return pOutlEditEng->GetDepth(nCurrent) < 0;
+ else
+ return true;
+ }
nCurrent--;
}
return false;
diff --git a/editeng/source/outliner/outleeng.cxx b/editeng/source/outliner/outleeng.cxx
index 67fcd0c4bd93..da297400382b 100644
--- a/editeng/source/outliner/outleeng.cxx
+++ b/editeng/source/outliner/outleeng.cxx
@@ -191,4 +191,9 @@ void OutlinerEditEng::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet )
pOwner->UndoActionEnd();
}
+sal_Int16 OutlinerEditEng::GetDepth(sal_Int32 nPara) const
+{
+ return pOwner->GetDepth(nPara);
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */