Bug 67764

Summary: FORMATTING: Spaces removed when pasting from windows clipboard data stored as HTML format
Product: LibreOffice Reporter: nubile
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: NEW --- QA Contact:
Severity: normal    
Priority: medium    
Version: 3.3.0 release   
Hardware: Other   
OS: Windows (All)   
Whiteboard: BSA
i915 platform: i915 features:
Attachments: Nirsoft InsideClipboard file showing the state of my clipboard after copying from Visual Studio, and a text file showing only the contents of the HTML entry on the clipboard

Description nubile 2013-08-05 04:00:44 UTC
Created attachment 83641 [details]
Nirsoft InsideClipboard file showing the state of my clipboard after copying from Visual Studio, and a text file showing only the contents of the HTML entry on the clipboard

Problem description: Whenever I copy text from the IDE in Microsoft Visual Studio, and try to paste into a LibreOffice Writer document, all spaces are removed. Pasting into other programs such as Microsoft Wordpad, the formatting is correct and spaces appear. 

Using Nirsoft InsideClipboard, I can see that when I copy text in Visual Studio, the data is stored as several different clipboard types, one of them with format ID number 49426 (HTML Format).

In the HTML data on the clipboard, all spaces are stored as &nbsp;, the html escape code for a space. It appears that Writer simply removes these instead of pasting them as spaces.

Steps to reproduce:
1. Copy text from the IDE in Microsoft Visual Studio 
1a. Alternatively, use Nirsoft InsideClipboard to load the attached .clp file to the clipboard
1b. Alternatively, use some other method that stores data on the clipboard as ID 49426 that uses &nbsp; escape codes for all spaces. The attached .txt file contains an example.
2. Paste the data in Writer

Current behavior: The text appears in Writer properly formatted except all spaces are removed. Pasted text contains lines like:
struct__device_builtin__cudaMemcpy3DPeerParms

Expected behavior: Spaces should appear in the pasted text, yielding lines like:
struct __device_builtin__ cudaMemcpy3DPeerParms

Known workarounds: If I use "Paste Special" and choose "Formatted Text [RTF]", I will get formatted text with spaces.

              
Operating System: Windows 7
Version: 4.1.0.4 release
Comment 1 Mike Kaganski 2013-08-05 08:46:41 UTC
Reproducible with 4.1.0.4 and 3.3.0.4, as well as with AOO 4.0 under Win7x64 and clipboard data from Attachment 83641 [details] using InsideClipboard.

Can not reproduce this with VS 2012 Express, it looks that it only stores text to clipboard as text and RTF. This, however, doesn't change things: the bug in LO exist.
Comment 2 nubile 2013-08-06 18:37:06 UTC
(In reply to comment #1)
> Can not reproduce this with VS 2012 Express, it looks that it only stores
> text to clipboard as text and RTF. This, however, doesn't change things: the
> bug in LO exist.

Thanks for verifying this. I looked into this a bit more and found that Visual Studio only copies to the clipboard in HTML format when a certain extension is installed and enabled: Microsoft's Productivity Power Tools 2012

As a workaround for my specific instance of this bug, I can disable that plugin. But that obviously doesn't repair the bug in Writer.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.