Files
odfstudio/include
Michael Weghorn a881b303b3 tdf#130857 formula: Only use selection indices if selection exists
The bool return value of weld::TextWidget::get_selection_bounds
indicates whether a text selection actually exists.

Only use the start and end indices from the out params
if that is the case and otherwise return a default-constructed
Selection object (i.e. one using start and end indices of 0).

Otherwise, this would result in an assertion due to the use of
invalid string indices as seen with the qt6 vcl plugin and native
widgets enabled (SAL_VCL_QT_USE_WELDED_WIDGETS=1) for the following
scenario with upcoming commit

    Change-Id: I10fcd9c326a047cf4abd34369f02be1847d77ae1
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Wed Jul 22 14:20:53 2026 +0200

        tdf#130857 qt weld: Support Calc "Edit Print Ranges" dialog

in place:

* start Calc
* "Format" -> "Print Ranges" -> "Edit..."
* click on the "Shrink" button in the "Print Range" section
* click anywhere in the sheet

Assertion:

    soffice.bin: /home/michi/development/git/libreoffice/sal/rtl/strtmpl.hxx:1059: void rtl::str::newReplaceStrAt(rtl_tString **, rtl_tString *, sal_Int32, sal_Int32, rtl_tString *) [rtl_tString = _rtl_uString]: Assertion `nIndex >= 0 && nIndex <= pStr->length' failed.

This is because QtInstanceEntry::get_selection_bounds
sets the indices to -1 if no selection exists.

Change-Id: Ifc8fd6f6a6d676fe26364da9077cb10acb439a5a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208474
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2026-07-25 10:34:14 +02:00
..
2026-04-30 08:54:45 +02:00
2026-06-04 10:00:29 +02:00
2026-04-30 08:54:45 +02:00
2026-06-09 14:49:09 +02:00
2026-04-30 08:54:45 +02:00
2026-07-24 17:37:22 +02:00
2026-06-16 01:20:43 +02:00
…
2026-06-29 10:16:53 +02:00
2026-05-22 09:32:38 +02:00
…
…
…