sw/source/core/unocore/unotext.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit ee60c7a37b11eba85e05ef317ef91c32c89e0bbd
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sat Aug 23 12:33:14 2025 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Tue Aug 26 17:50:06 2025 +0200

    tdf#168008 XTextRangeCompare doesn't throw when ranges are in different 
texts
    
    regression from
        commit 27e9fd67260b8ad321cf0f8722e2db8a08473927
        Author: Noel Grandin <noel.gran...@collabora.co.uk>
        Date:   Thu Jun 13 09:01:50 2024 +0200
        tdf#144208 speedup doc with lots of redline (7)
    
    Change-Id: I2df6a7c345735be84b459bab0bbfd874c991f6f7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190092
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Tested-by: Jenkins
    (cherry picked from commit 14e542d58778963df461965f129286fc75459d3b)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190096
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    (cherry picked from commit f72b23deb73542c60984e8cc6390c62b8b9370c7)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190143

diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index 0f932b244a9b..3af3fc6113bb 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -914,12 +914,13 @@ sal_Int16 SwXText::ComparePositions(
     {
         throw lang::IllegalArgumentException();
     }
-#ifdef DBG_UTIL
+    // The UNO API documentation for this method says we have to throw
+    // if either aPam1 or aPam2 is not within this text, and some
+    // extensions rely on that behaviour.
     if (!CheckForOwnMember(aPam1) || !CheckForOwnMember(aPam2))
     {
         throw lang::IllegalArgumentException();
     }
-#endif
 
     sal_Int16 nCompare = 0;
     SwPosition const*const pStart1 = aPam1.Start();

Reply via email to