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

New commits:
commit 14e542d58778963df461965f129286fc75459d3b
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sat Aug 23 12:33:14 2025 +0200
Commit:     Noel Grandin <noelgran...@gmail.com>
CommitDate: Sat Aug 23 13:57:52 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

diff --git a/sw/source/core/unocore/unotext.cxx 
b/sw/source/core/unocore/unotext.cxx
index e254014849be..e861d0396a94 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