Bug 64612 - EDITING: Text not handled when converting 2D rect to Polygon
Summary: EDITING: Text not handled when converting 2D rect to Polygon
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Draw-UX
  Show dependency treegraph
 
Reported: 2013-05-15 04:27 UTC by Jim Avera
Modified: 2020-01-20 15:27 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
ConvertToCurve combined with text examples (17.27 KB, application/vnd.oasis.opendocument.graphics)
2020-01-20 15:27 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Avera 2013-05-15 04:27:40 UTC
A normal polygon can have text in it, and the text can be edited and so can the polygon points.

However if the polygon was the result of converting a 2D Rectangle with text to Polygon, it behaves strangely: Neither the text nor the polygon points can be edited.

STEPS TO REPRODUCE:
1. Open a new Draw document
2. Create a 2D Rectangle (click the rectangle shape icon, then select a plain square-edged rectangle from the shapes drop-down; then place a rectangle on the drawing).
3. Add some text to the rectangle (select the rect and then type)
4. Modify->Convert->To Polygon
5. Try Edit Points on the polygon - no editing icons are enabled
6. Try to edit the text (you can't get a text-selection cursor)

EXPECTED BEHAVIOR: Converting a 2D object with text to a Polygon would convert the graphic to a polygon and then insert the text, so the result would be the same as if the polygon had originally be created as such and the text added to it.

Note: If an ordinary polygon has text, the "Word wrap" option is greyed out if you do Rightclick->Text... .  I don't see why this feature would not be available because the bounding box should be available (it is displayed when not in Edit Points mode).  For text to carry over from 2D to Polygons as expected (ok; as I expected), this any any similar limitations would need to be fixed.  
Operating System: Ubuntu
Version: 4.0.3.3 release
Comment 1 Joel Madero 2013-06-23 03:39:29 UTC
I think this may be as expected - the individual characters are changed so you can select them individually, stretch them out, and even add more characters to the selection

This being said - honestly I need some outside advice so cc'ing our presentation expert (since draw is very similar) -> also going to call out for more general advice on this.

For now, leaving as UNCONFIRMED - Thorsten or someone else can comment if this is expected behavior
Comment 2 Robinson Tryon (qubit) 2013-10-23 17:14:42 UTC Comment hidden (obsolete)
Comment 3 Robinson Tryon (qubit) 2014-02-03 16:32:43 UTC
TESTING on Ubuntu 12.04.3 + LO 4.2.0.4

(In reply to comment #0)
> 
> STEPS TO REPRODUCE:
> 1. Open a new Draw document
> 2. Create a 2D Rectangle (click the rectangle shape icon, then select a
> plain square-edged rectangle from the shapes drop-down; then place a
> rectangle on the drawing).
> 3. Add some text to the rectangle (select the rect and then type)
> 4. Modify->Convert->To Polygon
> 5. Try Edit Points on the polygon - no editing icons are enabled

Confirmed

> 6. Try to edit the text (you can't get a text-selection cursor)

Confirmed

> EXPECTED BEHAVIOR: Converting a 2D object with text to a Polygon would
> convert the graphic to a polygon and then insert the text, so the result
> would be the same as if the polygon had originally be created as such and
> the text added to it.

Sounds reasonable to me.

I created a draw document per the rules above and saved it when the element was a rectangle, then saved it again after the modification to a polygon. I then create a new document (with a similar rectangular area and text), just using the polygon tool.

The content.xml files for the rectangle and the (directly-created) polygon are VERY similar. It appears that when the object is converted from a rect to a poly, 

1) A bunch of text styles are stripped from the document, e.g.

    <text:list-style style:name="L1">

2) The rect is re-created as a polygon not with a single <draw:polygon ...> element (as is used in the case in which a rectangle is created directly with the polygon tool), but with 7 different <draw:polygon...> and 5 <draw:path...> elements nested inside a single <draw:g>.


It's not clear to me why this particular transformation route is used. Perhaps this example is just a very simple base-case?  In any event, if this is not actually a bug, it is still a very reasonable enhancement request.
Comment 4 Regina Henschel 2014-02-03 17:11:52 UTC
The text is converted to polygons too. So after converting you get a group. A group has no "points" and therefore switching to point edit mode will have no effect.

This is no bug but a missing feature.
Comment 5 Robinson Tryon (qubit) 2014-02-03 17:23:12 UTC
(In reply to comment #4)
> The text is converted to polygons too. So after converting you get a group.
> A group has no "points" and therefore switching to point edit mode will have
> no effect.

Ah, okay -- that makes much more sense! :-)

> 
> This is no bug but a missing feature.

Whiteboard: (remove NeedAdvice)
Priority: enhancement
Comment 6 Heiko Tietze 2016-06-01 07:32:17 UTC
The text is converted to polygon leaving all freedom to the user. Works as designed, IMHO. The parts of the converted object are grouped and in order to edit points users need to enter the group or to ungroup. No problem as well (despite the fact that groups are not easy to recognize).

Let's close this ticket as WORKSFORME.
Comment 7 Regina Henschel 2016-06-01 13:07:13 UTC
I think, it is a valid enhancement request. The user does not have "all freedom", because the text is converted to a curve and therefore has lost all text properties e.g. font and language. From the file format point of view, it would be no problem to preserve the text, only it is not implemented.
Comment 8 Heiko Tietze 2016-06-02 08:38:09 UTC
If letters should be handled as text it could be (re)added afterwards. But the conversion may be done intentionally in order to modify the letters, for instance. And I would not always get asked whether or not the text should be converted with the shape. So I'm still in favor of WORKSFORME.
Comment 9 Buovjaga 2016-08-02 12:25:46 UTC
There seems to be no way convert text inside a shape to polygon without converting the shape as well. I can't edit points of the shape or text even after exiting group and ungrouping.
I guess something needs to be done, even if the default behavior is not changed.
Comment 10 Heiko Tietze 2020-01-20 10:03:31 UTC
Let's take Regina's comment 7 for the solution: Preserve text when converting polygons.
Comment 11 Regina Henschel 2020-01-20 12:51:57 UTC
You need a new command, because the option to convert texts to curves is still needed for mirroring text and for non-linear transformations.
Comment 12 Heiko Tietze 2020-01-20 13:00:09 UTC Comment hidden (obsolete)
Comment 13 Regina Henschel 2020-01-20 15:27:30 UTC
Created attachment 157272 [details]
ConvertToCurve combined with text examples

Please see attached examples. I have sheared the rectangle to make the problems more visible.
A If a shape has a text, then transforming the shape results in a transformed text.
B If shape A is mirrored, then the text is not mirrored, but it follows the new direction.
C If shape A including the text is converted to curve, it looks like A but the text is not editable because the text is no longer text, but a curve too.
D If you mirror shape C, you get a mirrored text.
E The shape was first converted to curve, then the text was added. Now the text has no transformation. I guess, that is not the expected result of "convert shape but keep text editable".
F Shape first converted, then text added, then sheared. I think, that would be the expected result of "convert shape but keep text editable" with a new convert mode option applied to shape A.

If you keep the text editable as text, then you cannot get result D. Mirroring and non-linear transformations are not possible on text. Therefore you need an option to convert the shape and the text together (behavior now) and you need a second option to convert the shape, but keep the text editable (new feature).