Apache OpenOffice (AOO) Bugzilla – Issue 115148
Using middle mouse button to paste under linux does not behave as expected
Last modified: 2017-05-20 11:11:24 UTC
- Open new presentation or drawing document - Insert a shape with some text - Put some text in the clipboard, f.e. from an html page - Move mouse cursor over the previously created text shape and press middle mouse button. Expected behavior Middle mouse press actives text editing and puts the text cursor at the current mouse position, then insert the clipboard text at the text cursor Current behavior Middle mouse press always inserts a new text shape. Under windows there is no paste using middle mouse button. To paste using the mouse one has to use the context menu. The right mouse click on a text shape to open the context menu also starts the text edit mode and selection of the paste command works as expected. therefore the handling of the middle mouse button paste on unix systems is not consistent.
:-( it turns out that this is one of the things that looks like a small bug from the outside but it is nearly un fixable from the inside. Problem is as follows... The middle mouse button pastes the 'selection clipboard', not the 'clipboard'. There is a technical difference. Only mac and linux support the 'selection clipboard' across different applications. On windows there is no such thing so we only know about selections inside office applications (this means in windows if you select something in firefox and then press middle mouse button inside a writer or impress document nothing happens). Now, to enable inserting text in a shape while doing middle mouse button I have to get that shape into edit mode first. while putting the shape into edit mode it is also selected. this action changes the selection clipboard from anything that was previously selected into the shape itself. the result is that even so I go into edit mode,no text is pasted in that shape but the same shape is duplicated. In writer this works because they do not need a selection to paste text in existing text. The only workaround would be to identify the situation (check the clipboard for text and check that there is actually text under the mouse pointer and then copy the text from clipboard and then enter text edit mode and insert copied shape). At this point it is not a small fix any longer but a lot of work. yikes
cl->cl: The solution is in View::InsertData for SOT_FORMATSTR_ID_HTML, SOT_FORMATSTR_ID_EDITENGINE, FORMAT_RTF and FORMAT_STRING to start text edit on mouse click but *after* the stream was taken from the current transferable helper. If this does not work make a memory copy of the stream before starting optional text edit. This conflicts with TL's work to convert the edit engine clipboard format from binary to xml so I have to wait until his cws is integrated.
Reset assigne to the default "issues@openoffice.apache.org".