summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2022-09-23 18:11:56 +0200
committerCaolán McNamara <caolanm@redhat.com>2022-10-05 09:54:03 +0200
commit5b418bd88c1f5b04490d33308ff84852753fb4ab (patch)
treecdc830e0cd1c04a673c034c05ab8d68426120589
parentFix string length assertion and handle parentheses in multi-line formula (diff)
downloadcore-5b418bd88c1f5b04490d33308ff84852753fb4ab.tar.gz
core-5b418bd88c1f5b04490d33308ff84852753fb4ab.zip
rhbz#2122948 sw: fix ODF import of fieldmark in redline
The problem is that SwXText::compareRegionStarts() calls SwXText::CreateCursor() which creates a cursor on the last node in the body text, but it's actually a redline. Override SwXRedlineText::CreateCursor() to create a cursor in the redline text. Complete mystery why SwXText has 2 virtual functions to create cursors in the first place. (regression from commit 463178fef5c22f1a04d10e54491852d56e2038b0) Change-Id: I0f3bcf4eda25f1ac7e1c1b0cf47a920f8302d2b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140504 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit c80a3ef9f434230ae3d5ffec902edc19f34f75f7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140595 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/inc/unoredline.hxx3
-rw-r--r--sw/source/core/unocore/unoredline.cxx5
2 files changed, 8 insertions, 0 deletions
diff --git a/sw/inc/unoredline.hxx b/sw/inc/unoredline.hxx
index a73ede766af6..3a7273a199d7 100644
--- a/sw/inc/unoredline.hxx
+++ b/sw/inc/unoredline.hxx
@@ -39,6 +39,9 @@ class SwXRedlineText final :
SwNodeIndex m_aNodeIndex;
virtual const SwStartNode *GetStartNode() const override;
+ virtual css::uno::Reference< css::text::XTextCursor >
+ CreateCursor() override;
+
public:
SwXRedlineText(SwDoc* pDoc, const SwNodeIndex& aNodeIndex);
diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx
index 197a5542b072..942243e0cd0f 100644
--- a/sw/source/core/unocore/unoredline.cxx
+++ b/sw/source/core/unocore/unoredline.cxx
@@ -90,6 +90,11 @@ uno::Sequence<sal_Int8> SwXRedlineText::getImplementationId()
return css::uno::Sequence<sal_Int8>();
}
+uno::Reference<text::XTextCursor> SwXRedlineText::CreateCursor()
+{
+ return createTextCursor();
+}
+
uno::Reference<text::XTextCursor> SwXRedlineText::createTextCursor()
{
SolarMutexGuard aGuard;