Bug 106249 - Should not routinely expose the draw:frame draw:text-box and overwrite OLE objects, e.g. F2 opening text-box of an OLE Formula in Impress
Summary: Should not routinely expose the draw:frame draw:text-box and overwrite OLE ob...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
5.2.5.1 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: OLE-Object-Interoperability
  Show dependency treegraph
 
Reported: 2017-03-01 07:23 UTC by john
Modified: 2024-10-18 00:52 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description john 2017-03-01 07:23:28 UTC
Description:
When I create a formula in Impress, I can type F2 and start typing text on top of the formula, as though it were a text box.

This is strange behaviour and would certainly confuse a newbie, since they can't double-click the formula to edit/remove that overlaid text.

I think it should be set to be impossible to edit the text on a formula object, in general.

Steps to Reproduce:
1. Insert Formula
2. Add some formula text eg "E = m c^2"
3. Exit the formula
4. Highlight the formula and type F2 (edit)
5. Type 'xxx'
6. Type Escape. The formula is now a mess.
7. Type enter. You can edit the formula but not the 'xxx'
8. Type F2. You can edit the 'xxx' but not the formula.


Actual Results:  
Nasty mess, best avoided! But the F2 keystroke is an easy habit eg after using Spreadsheets for a while.

Expected Results:
To me, 'enter' and F2 should both have the same effect when an object is a formula. I think there is no benefit at all in being able to edit the text on top of a Formula. Additionally, I am surprised that the OpenDocument specification allows this...


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:51.0) Gecko/20100101 Firefox/51.0
Comment 1 Regina Henschel 2017-03-01 14:23:35 UTC
An OLE object (Math and charts are OLE objects) is always child of a <draw:frame>. And such element can have a <draw:text-box> element. The UI needs a method to access this <draw:text-box>. So a solution cannot be to remove the access, but a solution would be to implement an access to <draw:text-box> which is not confused with uses of key F2 in other modules and other situations. Because the feature is seldom used, it does not need a predefined key, but a menu item would be sufficient.

But the feature itself has bugs. I'll write an additional report for it.

Not sure, whether this one is a bug or better an enhancement request.
Comment 2 V Stuart Foote 2017-03-01 15:15:38 UTC
Agree. To enhancement.
Comment 3 john 2017-03-16 06:00:16 UTC
So to me 'F2' means 'edit the contents of this'. It works with cells in Calc, and it works with text boxes in Impress, and it works with text boxed in Writer. It makes total sense to me that it should do the same for Formulas, wherever they appear. If it is somehow necessary to continue to be able to write normal text-box text over the top of a formula (heaven knows who) then I agree, bury it in menu somewhere (context menu 'Edit as text box' might be good?). There is already an undo action 'Edit text of frame' that shows in the Undo menu. The only place that editing a Formula seems to appear in the UI is in the context menu "Edit". That is where the F2 binding should be made, I think. (note that the F2 shortcut doesn't seem to appear anywhere on the menus. In the keyboard bindings the action associated with 'F2' is "Formula" (which I can't see anywhere on the menus).
Comment 4 john 2017-03-16 06:02:08 UTC
Sorry another note: in Writer, F2 does *not* allow text to be written over Formulas. So is it true that this problem has already been fixed somehow in Writer, but not in Impress?
Comment 5 Regina Henschel 2017-10-22 16:03:08 UTC
(In reply to john from comment #4)
> Sorry another note: in Writer, F2 does *not* allow text to be written over
> Formulas. So is it true that this problem has already been fixed somehow in
> Writer, but not in Impress?

No. In Writer formulas and charts are handled different from Draw/Impress/Calc. Therefore their text has no UI in Writer.

If you like to have F2 to switch to open the OLE, you can customize your UI to do it.
Comment 6 john 2018-03-19 22:34:19 UTC
@Regina: Can I do that though? I would still want F2 to retain the normal edit behaviour for text boxes. Why should I use 'enter' to edit formulas, but F2 to edit text boxes?

I agree with Regina, this kind of text is seldom deliberately used (only ever used by me accidentally!) so it would be best if F2 is redirected for editing the OLE content for equations, if possible.
Comment 7 john 2024-09-21 10:34:51 UTC
Seems like in Impress the F2 shortcut should be redefined to mean "edit this in the most natural way" and then menus or other methods can be used to access the nearly-never-needed feature of editing text on a formula or potentially other kinds of objects that don't need text in front of them, like eg a table or a calc frame.
Comment 8 V Stuart Foote 2024-09-21 12:02:26 UTC
Agree to enhancement as per comment 1, *not* to a refactoring of <F2> behavior vis-a-vis OLE objects in Impress, or changes to the Calc behavior.
Comment 9 Heiko Tietze 2024-09-23 08:37:33 UTC
The technical implementation is obviously different from the user expectation. If F2 is seen as "Edit" (without the addition of a particular object), we should follow John's suggestion.

On the other hand, to "edit a slide", ie. when no object is selected, should remain to "insert a text box". Slightly inconsistent.

What I like at the proposal is to assign a function key with a very generic function. F2 could also open the paragraph properties in Writer (or Character in case of a selection). And we could introduce another shortcut to insert a text box. This would be a major change affecting many users.
Comment 10 V Stuart Foote 2024-09-23 12:15:22 UTC
<F2> shortcut has no explicit meaning to edit or insert.

Rather we assign the <F2> key per module, and simply assign a module specific UNO to each, no OLE dependency:

Calc -- .uno:SetInputMode "Cell Edit Mode" (tt. Cell Edit Mode)
Impress -- .uno:Text "Text Box" (tt. Insert Text Box (double click for multi-selection))
Draw -- .uno:Text "Text Box" (tt. Insert Text Box (double click for multi-selection))
Writer -- .uno:InsertFormula "Edit Formula" (tt. Insert or Edit Formula)
Math -- no assignment

Making <F2> some sort of LibreOffice generalized shortcut doesn't make a lot of sense, and the concerns of applying draw:text-box annotation over an OLE's draw:frame doesn't justify clobbering our legacy shortcut assignments across the modules.
Comment 11 Heiko Tietze 2024-09-23 13:34:22 UTC
Shortcuts are assigned exclusively to commands- unless assigned per module, which is questioned here. However, a new command uno:EditObject could run any action depending on the selected object.
Comment 12 Heiko Tietze 2024-10-18 00:52:04 UTC
We discussed the topic in the design meeting. Comparing with MSO365, F2 goes into formula edit mode when the formula is in focus and into edit mode for a text box. We should do the same (and provide and option to change the object's text). I vaguely remember a similar ticket, perhaps it was about charts.