diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2020-11-20 17:16:35 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2020-11-24 12:09:23 +0100 |
commit | 7ab349296dac79dad3fec09f60348efcbb9ea17e (patch) | |
tree | 7ac058e03eaa0020f93ad185937b0010ee0cbd74 /onlineupdate | |
parent | 93eb6a87e30c8716b5e65ce71e3d1d9deffb6425 (diff) |
sw: fix copying and deleting of section content via API
The problem happens if a section starts or ends with a table:
SwXTextSection::getAnchor() may return a SwXTextRange with one position
in a table cell and another position in a different table cell, or
outside the table, neither of which is valid to set the cursor via
SwXTextViewCurosor::gotoRange().
Introduce a new special mode for SwXTextRange, RANGE_IS_SECTION,
analogous to RANGE_IS_TABLE but actually working.
Only SwXTextView can be used to create XTransferables, and it requires
selecting first via either the SwXTextViewCursor or select().
It's currently not possible to select the content of a section in the
ViewShell in these problematic cases, and would be some effort to add.
So add a new interface XTransferableTextSupplier that can be used to
create XTransferable from the SwXTextRange with RANGE_IS_SECTION.
The core CopyRange() and DeleteRange() functions can deal with SwPaMs
that start or end in non-text-nodes, so pass the whole section content to
these in SwXTextRange::setString() and in
SwXTextView::getTransferableFromTextRange().
Change-Id: If7e3210e8a26f5618317c294f2b2f3ed5c217f1c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106293
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'onlineupdate')
0 files changed, 0 insertions, 0 deletions