https://bugs.documentfoundation.org/show_bug.cgi?id=162752

Justin L <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|[email protected] |[email protected]
                   |desktop.org                 |
           Keywords|                            |bisected, regression
                 CC|                            |[email protected]
             Status|NEW                         |ASSIGNED
                 OS|other                       |All
            Version|24.8.0.3 release            |7.5 all versions

--- Comment #6 from Justin L <[email protected]> ---
STR
-in the second row, place the cursor behind the long content control field
-press Ctrl-A to select all of the cell's contents (but not the cell itself)
-Format - Character  (LO freezes - no character dialog appears)

This started in 7.4 with commit 1e9416fac497a58be04011cfa0ffce9c74a9e397
Author: Miklos Vajna on Wed May 11 12:22:48 2022 +0200
    sw content controls: introduce a word breaking dummy char at the end

    - this way double-clicking on the last word of a content control or the
      first word after the content control selects the correct text range,
      similar to how the same at the start of content control already worked

    - this allows not touching the expand flag in the SwTextContentControl
      ctor, which was overwritten by the ODT import (when the content
      control was at the end of the paragraph) anyway

    - hide this dummy character when accessing the paragraph content via the
      UNO API or the text export

    - still need to audit a few more places in follow-up commits to maintain
      the invariant that content controls have the same dummy char at the
      attribute start and end -- somewhat similar to how SwTextInputField
      does it with CH_TXT_ATR_INPUTFIELDSTART/END

    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134151
but it has just exposed a long-standing bug.

Also gained more exposure in 7.5 with these steps to reproduce:
-in the second row, place the cursor behind the long content control field
-select up to also select the previous cell
-while still selecting, go down again to only cell B2 is selected
-Format - Character
and now that also triggers the freeze since
commit 0031f34d0ba99de5384e13843e99ffbb01f729d0
Author: Justin Luth on Wed Jun 29 13:24:34 2022 +0200
    tdf#145151 tdf#119540 sw IsTableMode: deselect unselected cell
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135569

It is looping in SwTextFrame::GetScalingOfSelectedText, where the nIdx gets to
68 and then never changes because cChar is at the last u'\001' in the string 
"\001", ' ' <repeats 67 times>, "\001"

This commit probably points the way forward:
commit e7c0f65753e04d2de3dbac56fbe86ce0b6aed9b2
Author: Michael Stahl on Thu Nov 28 15:14:01 2019 +0100
    sw: fix asserts from SwSubFont::GetTextSize_() on ooo54042-1.doc

    The function gets passed a single CH_TXT_ATR_FIELDSTART but it looks
    like this is a problem in SwTextNode::GetMinMaxSize().

    That one should just skip over the CH_TXT_ATR_FIELD* basically, since
    it's only interested in the text; also CH_TXT_ATR_INPUTFIELD* while at it.

    Also adapt the SwTextFrame::GetScalingOfSelectedText(), as indicated by
    the comment.

    Reviewed-on: https://gerrit.libreoffice.org/83997

The part that concerns me was already there at the creation of the function, in
commit 91812b855e9bb5d35cb869ecef3f430c956e7fbc
    new: GetScalingOfSelectedText

I can only guess that this situation has been a (potential) problem ever since
initial import and just nothing has ever triggered it before to draw attention
to it? (I don't see any clues in SwTextNode::GetMinMaxSize either, other than
mstahl's patch^^^ adding some derogatory comments about it in general.)

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to