offapi/com/sun/star/text/XTextRangeCompare.idl |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit dcaf395316a25775a847e3e9b2434aa602dff1f3
Author:     Neil Roberts <[email protected]>
AuthorDate: Sat Oct 4 13:13:51 2025 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Sat Oct 4 21:50:45 2025 +0200

    XTextRangeCompare: Emphasize the surprising return value in the docs
    
    Change-Id: I57a03e1e4f89d5bd68bb723f70693fe58e8ee159
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191856
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/offapi/com/sun/star/text/XTextRangeCompare.idl 
b/offapi/com/sun/star/text/XTextRangeCompare.idl
index 10309b8b442e..1baf68a3fba0 100644
--- a/offapi/com/sun/star/text/XTextRangeCompare.idl
+++ b/offapi/com/sun/star/text/XTextRangeCompare.idl
@@ -38,6 +38,11 @@ published interface XTextRangeCompare: 
com::sun::star::uno::XInterface
                     1 if <var>xR1</var> starts before <var>xR2</var>,
                     0 if <var>xR1</var> starts at the same position as 
<var>xR2</var> and
                     -1 if <var>xR1</var> starts behind <var>xR2</var>.
+                    Note that the sign of the return value might be
+                    the opposite of what you would expect if you are
+                    used to other comparison operations such as the
+                    XCollator interface, strcmp in C, the <=> operator
+                    in C++ or the compareTo method in Java.
 
                 @throws com::sun::star::lang::IllegalArgumentException
                     if either <var>xR1</var> or <var>xR2</var> is not within 
this
@@ -50,6 +55,11 @@ published interface XTextRangeCompare: 
com::sun::star::uno::XInterface
                     1, if <var>xR1</var> ends before <var>xR2</var>,
                     0, if <var>xR1</var> ends at the same position as 
<var>xR2</var> and
                     -1, if <var>xR1</var> ends behind <var>xR2</var>.
+                    Note that the sign of the return value might be
+                    the opposite of what you would expect if you are
+                    used to other comparison operations such as the
+                    XCollator interface, strcmp in C, the <=> operator
+                    in C++ or the compareTo method in Java.
 
                 @throws com::sun::star::lang::IllegalArgumentException
                     if either <var>xR1</var> or <var>xR2</var> is not within 
this

Reply via email to