Selecting original (Shift+D) of flowed text does not select the frame
Summary:
Text that is flowed in a frame is meant to allow selecting the frame with Shift+D (Select Original). Despite being documented as such, this no longer works on my system. I have tried after resetting preferences.
Steps to reproduce:
- open Inkscape
- create a shape (e.g. a circle, rectangle, or path)
- create text
- select both, Text > Flow into frame
- select text, reported as type "text in-a-shape" in the status bar
- Hit Shift+D or Edit > Clone > Select Original
What happened?
The status bar displays a help text including "Select a flowed text to go to its frame."
What should have happened?
The frame should have been selected.
Sample attachments:
Version info
Inkscape 1.4 (1:1.4+202410161351+e7c3feb100)
Compile (Run)
GLib version: 2.72.4
GTK version: 3.24.33 (3.24.33)
glibmm version: 2.66.2
gtkmm version: 3.24.5
libxml2 version: 2.9.13
libxslt version: 1.1.34
Cairo version: 1.16.0 (1.16.0)
Pango version: 1.50.6 (1.50.6)
HarfBuzz version: 2.7.4 (2.7.4)
OS version: Ubuntu 22.04.5 LTS
I tried searching for this on here, in the main bug tracker, and in the forums, I hope this is actually new. Please let me know if there's something else I should report about my platform. Sadly I am a noob re. the Inkscape codebase. The only change I see in what might be the relevant if-else block changes the casting used to figure out what type of object is selected. In the same document, it does work for the other cases covered here, as I understand: clone, linked offset, text on path.
In the release I'm using, there are no messages in the output from this action. In case you find this interesting, I'm able to build the 1.4.x branch for further testing. (I understand it won't work with newer versions until I update my OS.)
Stepping through Inkscape::ObjectSet::cloneOriginal looks like this (forgive me if this is not a useful output):
(gdb) s
cast<SPFlowtext, SPItem> (s=s@entry=0x5555571c1df0) at /home/craab/Software/desktop/inkscape/src/util/cast.h:76
76 auto cast(S *s)
(gdb) s
is<SPFlowtext, SPItem> (s=s@entry=0x5555571c1df0) at /home/craab/Software/desktop/inkscape/src/util/cast.h:37
37 bool is(S const *s)
(gdb) print s
$37 = (const SPItem *) 0x5555571c1df0
(gdb) print s->tag()
$38 = 69
(gdb) s
SPText::tag (this=0x5555571c1df0) at /home/craab/Software/desktop/inkscape/src/object/sp-text.h:42
42 int tag() const override { return tag_of<decltype(*this)>; }
(gdb) print this
$39 = (const SPText * const) 0x5555571c1df0
(gdb) s
Inkscape::ObjectSet::cloneOriginal (this=0x555557233c00) at /home/craab/Software/desktop/inkscape/src/selection-chemistry.cpp:3005
3005 if (flowtext) {
(gdb) print flowtext
$40 = (SPFlowtext *) 0x0
So it can not cast to SPFlowtext? It seems that in src/util/cast.h:45 the expression evaluates to false, with s->tag() being 69, so the call to is<SPFlowtext, SPItem> returns false, so the cast method then returns nullptr, and therefore we skip the block if(flowtext). Is that because of the class hierarchy?