Bug 62947 - UI Add 'paste special' or even better 'paste text without formatting' to context menu in Writer
Summary: UI Add 'paste special' or even better 'paste text without formatting' to cont...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: high enhancement
Assignee: bavincen
URL:
Whiteboard: target:4.4.0 target:4.5.0 target:5.2.0
Keywords: difficultyBeginner, easyHack
: 64196 80966 (view as bug list)
Depends on:
Blocks: Context-Menu Paste-Special
  Show dependency treegraph
 
Reported: 2013-03-30 22:35 UTC by Cor Nouws
Modified: 2017-10-22 19:33 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
Paste Special patch (1.60 KB, patch)
2014-09-10 09:38 UTC, bavincen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cor Nouws 2013-03-30 22:35:56 UTC

    
Comment 1 Cor Nouws 2013-03-30 22:36:44 UTC
Choice has never been there,
Note that since some time, there are usefull options in Calc context menu
Comment 2 Robinson Tryon (qubit) 2013-10-29 04:30:04 UTC
Whiteboard: proposedEasyHack -> ProposedEasyHack
Comment 3 Joel Madero 2014-02-27 22:55:08 UTC
In order to limit the confusion between ProposedEasyHack and EasyHack and to make queries much easier we are changing ProposedEasyHack to NeedsDevEval.

Thank you and apologies for the noise
Comment 4 Cor Nouws 2014-07-06 07:44:16 UTC
*** Bug 80966 has been marked as a duplicate of this bug. ***
Comment 5 Yousuf Philips (jay) (retired) 2014-07-06 17:36:39 UTC
@Cor Nouws: glad to see that you submitted this so long ago, but so sad to see it still hasnt been implemented, when it should be quite simple to add an entry to the right-click menu.

As stated in my duplicate bug, Calc has this option but Writer doesnt. I had wanted to submit the bug for a long time, but decided to hold off on it until i was going through the OOo tracking stats < https://wiki.openoffice.org/wiki/Tracking_results > yesterday for my proposal to revamp writer's standard toolbar.

So looking at Calc's stats, here are the right-click paste related numbers:

Paste         - 924,525
Paste Special -  74,035

Analysis: the number 1 right-click menu option is paste, number 2 is copy, number 6 is cut and paste special is ranked number 8. Users use right-click paste 12.5 times as much as paste special.

Calc's stats for menu bar paste related:

Paste         - 144,984
Paste Special -  13,647

Analysis: paste is ranked 3 in menu bar items to click, number 5 is copy, number 18 is cut, and paste special is 25. Similar to the right-click, there is a close usage correlation seen here between paste and paste special, with paste being 10.6 times as much used as paste special.

Calc's stats for keyboard shortcuts paste related:

Paste         - 1,675,915
Paste Special -    13,342

Analysis: similar to the right-click context menu, paste is ranked number 1 in keyboard shortcuts. There isnt a close usage correlation this time as most people are not likely familiar with the shortcut key, IMHO. Paste is used 125.6 times more often than paste special in keyboard shortcuts.

Conclusion: I believe these stats will prove that if the paste special was added to right-click it would be a great benefit to those who use the right-click to paste and it doesnt go as they planned.
Comment 6 Marcos 2014-08-15 21:28:26 UTC
I want to do this. But I'm new with free software and of course new in LibreOffice.
If I understand well, this bug is to add functionality 'paste special' open the menu with the right mouse click on the writer, since it already exists in calc.
If this is the task, I think I can do it.
I really want to contribute to libreoffice. And I believe this may be a good start.
Can I assign this task to myself? I already have the code on my computer, and everything else.
The module to be changed must be the sw, correct? Could anyone help me locate me? I have no idea what class should I change.

PS: Sorry for my English. I'm trying to improve it.
Comment 7 Robinson Tryon (qubit) 2014-08-15 21:53:17 UTC
(In reply to comment #6)
> I want to do this. But I'm new with free software and of course new in
> LibreOffice.

:-)

> I really want to contribute to libreoffice. And I believe this may be a good
> start.

Great!

> Can I assign this task to myself? I already have the code on my computer,
> and everything else.

This bug is marked as an 'EasyHack' with Beginner difficulty, so it's probably a good place for you to start.

> The module to be changed must be the sw, correct? Could anyone help me
> locate me? I have no idea what class should I change.

The LibreOffice developers can give you some pointers to get you started hacking on the code. I suggest that you try using the mailing list and/or the IRC channel:
https://www.libreoffice.org/community/developers/


Good luck!
Comment 8 Tomaz Vajngerl 2014-08-16 12:01:57 UTC
Cut/copy/paste is defined in [1], in Writer "paste" action triggers [2]. To find other uses search with "git grep SID_PASTE".
I guess [3] should be useful to show how to conditionally enable or disable one context menu action (paste in this case).

[1] http://opengrok.libreoffice.org/xref/core/sfx2/source/menu/menu.src#33
[2] http://opengrok.libreoffice.org/xref/core/sw/source/uibase/shells/basesh.cxx#266
[3] http://opengrok.libreoffice.org/xref/core/sw/source/uibase/shells/basesh.cxx#419
Comment 9 Yousuf Philips (jay) (retired) 2014-08-16 19:37:19 UTC
Hi Marcos,

Thanks for taking this on. Yes it would be great to the have the 'Paste Special...' option in the right-click menu, but i think it would be even more useful if 'Paste Special' had submenu options for common paste special entries like 'libreoffice writer', 'formatted text[rtf]', 'html format without comments', 'unformatted text', and 'more...' which opened up the dialog.
Comment 10 Tomaz Vajngerl 2014-08-16 21:16:57 UTC
Except for 'unformatted text' I don't think 'libreoffice writer', 'formatted text[rtf]' and 'html format without comments' are useful. I think users use 'paste special' most of the time to paste unformatted text. Unless there are other useful options I would just add either "paste special" or "paste unformatted" or both.
Comment 11 Yousuf Philips (jay) (retired) 2014-08-17 12:28:55 UTC
Hi Tomaz,

Yes 'libreoffice writer' isnt that useful, as regular paste will normally choose that option, but how useful the rest are will very from user to user, so the best means would be to show the same list available in the paste special dialog and paste special list in the toolbar and let the user decide.

On windows, i've found libreoffice pasting html rather than rtf, so i have had to always paste special rtf. While i've seen bug reports, like bug 80796, where libreoffice's default paste isnt the one the user wishes and they didnt want 'unformatted text'.

Ultimately, the context menu is to simplify when possible the need to access the menu, toolbars, and dialogs. Adding 'paste unformatted' to the context menu would clutter up the main menu, which was the reason i had suggested it in the submenu.
Comment 12 Cor Nouws 2014-08-17 21:13:34 UTC
@Jay,

thanks a lot for your explanation.
However I fail to understand how the frequency of usage can be directly related to the easiness that would be brought to users, when the UI is changed.
Even more: offering "paste as text without formatting" might even give a lot of people the idea that it's smart to use that to prevent formatting trouble. 
(I know those from many trainings ;) )
So. simply, pls add 'paste text without formatting' to the context menu.

Cheers,
Cor
Comment 13 Yousuf Philips (jay) (retired) 2014-08-18 10:34:24 UTC
@Cor,

Limiting the addition of just 'paste text without formatting', limits the usefulness to many users, while 'paste special' will fulfill everyones needs. The addition of both to the main list when one is sub-feature of another, simply adds more bloat to an already bloated context menu (bug 81132).
Comment 14 Cor Nouws 2014-08-18 11:20:11 UTC
Hi Jay :)

(In reply to comment #13)

> Limiting the addition of just 'paste text without formatting', limits the
> usefulness to many users, while 'paste special' will fulfill everyones
> needs. 

I do not agree with that. But adding Paste special already is a large improvement that I can easily live with ;)

Cheers,
Cor
Comment 15 Marcos 2014-08-19 01:07:36 UTC
Hi guys,
Thanks for the answers and yours comments.

Even though for personal use, I like 'paste text without formatting'. I think the 'paste special' is more interesting than 'paste text without formatting' for libreoffice.
Anyway, obviously I'll wait for the community decision. (you guys)
And sorry for making you wait. I am very much college work to do these days.
Comment 16 Cor Nouws 2014-08-25 21:12:21 UTC
On a second thought,
a- considering the importance of pasting as plain text
b- considering the way too long context menu (as the saying goes)
c- considering that reducing the length context menu needs to be done in a different manner;
I vote for adding both.
Comment 17 Cor Nouws 2014-08-25 21:22:51 UTC
(In reply to comment #13)
> @Cor,
> 
> Limiting the addition of just 'paste text without formatting', limits the
> usefulness to many users, while 'paste special' will fulfill everyones
> needs. 

Where do I learn that it's _not_ the case that 90+% of 'paste special' use is just to use 'paste text only' :)
Comment 18 Yousuf Philips (jay) (retired) 2014-08-25 21:58:58 UTC
Cor wishes to add:

Paste Special...
Paste Text Without Formatting

Jay wishes to add:

Paste Special > Submenu with list of Paste Special entries

Seems we need need some votes.
Comment 19 Cor Nouws 2014-08-25 22:01:03 UTC
(In reply to comment #18)
> Cor wishes to add:
> 
> Paste Special...
> Paste Text Without Formatting

Or sub menu with the most needed ;)

But both simple or full sub menu are acceptable for me
Comment 20 Robinson Tryon (qubit) 2014-08-25 22:22:30 UTC
(In reply to comment #18)
> Cor wishes to add:
> 
> Paste Special...
> Paste Text Without Formatting
> 
> Jay wishes to add:
> 
> Paste Special > Submenu with list of Paste Special entries
> 
> Seems we need need some votes.

I see the usefulness of pasting text w/o formatting: The problem happens w/Rich-Text emails all the time. I'm not sure I'm quite convinced of the utility of more paste-special choices in a menu, but I'm happy to hear compelling arguments.
Comment 21 Cor Nouws 2014-08-26 10:55:19 UTC
Still I think that insight in the question in comment 17 is important.

Furthermore: could write a short mail to users@ just asking what they (from own use, or experience with helping others) would find most useful to have in the context menu:
  paste special (ps) / paste as text (pas) / ps + pas / ps + pas + other options
Just as a (non-binding) poll to get a feeling of what lives there.
Comment 22 Yousuf Philips (jay) (retired) 2014-08-26 14:42:41 UTC
I wouldnt argue that paste as text isnt highly used, but only including a clickable pas in the menu, which you say will is 90% of the time, mandates the remaining 10% have to use the ps dialog, when it easy enough to have all the options clickable in a submenu and fulfills everyones needs.

Was checking ms word and they have a third option of special paste text which is a mix of the default and text with no formatting. Will suggest its addition in another bug. :)
Comment 23 Tomaz Vajngerl 2014-08-26 15:02:26 UTC
Well.. it is not easy to implement a submenu with dynamic entries - it is an order of magnitude difference in implementation difficulty between dynamic submenu and static PS and/or PAS entries (I think you need just 2 lines of code).
Comment 24 Yousuf Philips (jay) (retired) 2014-08-26 15:23:34 UTC
Yes i alway felt that the dynamic submenu might be a difficult thing to achieve and would depend on the assigners capabilities. So how about a mix of the two, with the ability to expand on it in the future. Have a static submenu with a text only entry and a more entry which opens the dialog.

Paste
Paste Special
  Text Only
  More

One thing to also take into consideration is that sometimes 'Text Only' would have to be dimmed or unlisted, if the option isnt possible (e.g. pasting an image).
Comment 25 Tomaz Vajngerl 2014-08-26 21:28:51 UTC
Yes, I think this is the best solution.
Comment 26 Cor Nouws 2014-08-26 21:39:10 UTC
Fine for me too.

(And apologies for typing something when not awake/concentrated, and using pas as abbreviation for paste as text ;) )
Comment 27 Yousuf Philips (jay) (retired) 2014-08-26 22:09:18 UTC
Glad we could agree. Everything is now up to you Marcos. :)
Comment 28 jeyli 2014-09-10 08:07:17 UTC
Hi Marcos, are you still working on this bug? Else I would try to work on it :)
Comment 29 bavincen 2014-09-10 09:38:01 UTC
Created attachment 106037 [details]
Paste Special patch

Hello!
I have attached a patch file to add "paste special -> text only/More" sub menus to writer pop-up menu.

Text only which is PASTE_UNFORMATTED
More which is PASTE_SPECIAL 

thanks
Comment 30 Marcos 2014-09-11 01:06:49 UTC
Hi guys,

I'm having some problems on my HD.

@Jeyli, It would be great if you could work on that. :)
Comment 31 Adolfo Jayme Barrientos 2014-09-19 14:26:53 UTC
The patch was merged: http://cgit.freedesktop.org/libreoffice/core/commit/?id=bd39fb69202c759445c97d099add3b6e5556d5f2
Comment 32 Commit Notification 2014-09-19 15:57:32 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5398664eed621fbcc644ff949d4841590973bfa3

fdo#62947 make IDs unique, fixes, better names



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 33 Cor Nouws 2014-09-19 17:37:54 UTC
thnks a lot guys!
Comment 34 Yousuf Philips (jay) (retired) 2014-09-19 21:06:16 UTC
Thanks bavincen and Tomaz for the patch and Cor for suggesting this a year and a half ago. :D

I think it would be good if this was added to the 4.4 release notes wiki.
Comment 35 Adolfo Jayme Barrientos 2014-09-20 06:36:15 UTC
The additions look good, with one exception: between the existent Paste and the new Paste Special there’s a separator that shouldn’t be there — new bug to follow…

(In reply to comment #34)
> Thanks bavincen and Tomaz for the patch and Cor for suggesting this a year
> and a half ago. :D

Why should the time a bug was reported on matter at all?

> I think it would be good if this was added to the 4.4 release notes wiki.

It’s a wiki: don’t ask, JFDI [1] ;)

[1]: http://en.wikipedia.org/wiki/WP:BOLD
Comment 36 bavincen 2014-09-20 06:55:47 UTC
@Adolfo Jayme - Thought of adding it, :)
Comment 37 Yousuf Philips (jay) (retired) 2014-09-21 00:16:06 UTC
One more thing bavincen, 'Text Only' should be dimmed/hidden when there isnt any unformatted text to be pasted, as mentioned in comment 24.
Comment 38 bavincen 2014-09-21 06:58:28 UTC
(In reply to comment #37)
> One more thing bavincen, 'Text Only' should be dimmed/hidden when there isnt
> any unformatted text to be pasted, as mentioned in comment 24.

Yup!
Comment 39 Yousuf Philips (jay) (retired) 2014-09-22 17:00:55 UTC
bavincen: you may wish to look at < http://cgit.freedesktop.org/libreoffice/core/commit/?id=3f8e114bae8bb3ef45a08ced3434e7a9669ed4f9 > as that is the commit that brought the cut/copy/paste entries to the top of the context menu.

If things seem to difficult, then maybe the simplest solution is to add a separator below Paste Special to separate it from clear direct formatting.

Also think its worth pushing this same patch onto other modules like Impress and Draw.
Comment 40 Yousuf Philips (jay) (retired) 2014-10-25 10:36:28 UTC
Though i was the one who mentioned 'Text Only' and 'More' in my example, i think these labels need to be changed to 'Unformatted Text' and 'More Options...'.

I've submitted a patch to change these labels and move 'clear direct formatting' above style and line spacing, which partially fixes the issue with the separator that i mentioned before.

https://gerrit.libreoffice.org/12093
Comment 41 Adolfo Jayme Barrientos 2014-10-26 03:57:56 UTC
This was reopened with no explanation. Don’t.
Comment 42 Yousuf Philips (jay) (retired) 2014-10-26 09:09:11 UTC
(In reply to Adolfo Jayme from comment #41)
> This was reopened with no explanation. Don’t.

The bug report was closed even though comment 37 wasnt completed, so i reopened it.
Comment 43 Adolfo Jayme Barrientos 2014-10-26 19:07:16 UTC
(In reply to Jay Philips from comment #42)
> The bug report was closed even though comment 37 wasnt completed, so i
> reopened it.

And we can keep adding comments and bugs will never get closed, right? And that is already reported in a separate report, bug 84177.
Comment 44 Yousuf Philips (jay) (retired) 2014-10-26 22:12:33 UTC
(In reply to Adolfo Jayme from comment #43)
> And we can keep adding comments and bugs will never get closed, right? And
> that is already reported in a separate report, bug 84177.

As you wish. Note your bug doesnt cover comment 37.
Comment 45 Commit Notification 2014-12-02 10:35:51 UTC
Yousuf Philips committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=b46f781440130e6a629bf9ae14a62310d2a31021

fdo#62947 add paste special to table and text box context menus

It will be available in 4.5.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 46 Mike §chinagl 2014-12-20 23:03:13 UTC
This bug fix comes with LibreOffice 4.4 (release notes https://wiki.documentfoundation.org/ReleaseNotes/4.4) 

Writer now has the ability to access the Paste Special dialog via the context menu, reaching feature parity with Calc.
Comment 47 Adolfo Jayme Barrientos 2015-05-02 17:52:33 UTC
*** Bug 64196 has been marked as a duplicate of this bug. ***
Comment 48 Robinson Tryon (qubit) 2015-12-16 05:12:55 UTC Comment hidden (obsolete)
Comment 49 Commit Notification 2016-01-25 16:50:28 UTC
Maxim Monastirsky committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=7b6fdcd83b14a271061b70d43273d5c6cf0bb43c

Revert "fdo#62947 make IDs unique, fixes, better names"

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.