Files
odfstudio/sw/source/core
Justin Luth 470bf4599b tdf#172849 sw FindAll: fix miscounts of empty para (for replace)
The problem is that when finding/applying an attribute,
an empty paragraph is counted twice.

In my previous patch, I only did the move
if the paragraph contained some content.
But the same problem exists for empty paragraphs.

The unit test was quite annoying,
until I discovered it was searching for the exact opposite
of what it was intending to look for.

make CppunitTest_sw_uiwriter7 CPPUNIT_TEST_NAME=testTdf131431

It still double-counts for the very last paragraph,
since it tries to move forward but can't.

WARNING:
This patch breaks the counting for finding attribs (without replace).
The reason for this is that SwFindParaAttr doesn't bMoveFirst
when bReplaceAttr is set.
So, it worked for 'Find-All', but not for 'Replace-All'.

However, Find and Find-All suffer from skipping the first empty para,
so that bMoveFirst is a bad thing really.

While developing the follow-up patches,
I discovered that after the end of a paragraph,
a text search checks in anchored editeng objects.
So we can't move when doing a text search!

I wonder what other disasters are lurking in wait for me...

Change-Id: I10a786bd18c7b9957a70ea68324660e3c84b9b03
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208681
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Justin Luth <jluth@mail.com>
2026-07-30 14:14:05 +02:00
..
2026-05-08 09:49:13 +02:00
2026-06-05 21:52:31 +02:00
…
…