summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Specht <oliver.specht@cib.de>2024-12-11 14:24:17 +0100
committerThorsten Behrens <thorsten.behrens@allotropia.de>2024-12-11 16:34:49 +0100
commitcf696143db7163bbcecf5e5b5fb26309f001df80 (patch)
tree9a062ebc0d5f388e6b5999ea7941ce92c1db5497
parent77454306e200a3936f9d33d0dbab349dac3c72f7 (diff)
tdf#163634 Format empty paragraph if they have a bullet/numbering
Some optimization in commit 52abeff6d5836b29dbefe69f284bbd89f6672ae2 ignores paragph attributes if the paragraph is empty. But it is not empty if it has an active list. Change-Id: I8885d0f201fc48279263a3d41ec6d660b534ded2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178312 Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de> Tested-by: allotropia jenkins <jenkins@allotropia.de>
-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 36194c3d0f6f..79495bb07899 100644
--- a/editeng/inc/outleeng.hxx
+++ b/editeng/inc/outleeng.hxx
@@ -77,6 +77,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 981a75ae9c6b..d05648aa732d 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;
@@ -4397,10 +4398,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 1136ef37b9e2..ff9e0e725299 100644
--- a/editeng/source/outliner/outleeng.cxx
+++ b/editeng/source/outliner/outleeng.cxx
@@ -200,4 +200,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: */