Posted: Mon May 16, 2011 9:00 am Post subject: Copy & Paste applies wrong text formatting.
I'm working with some documents, in which coping and pasting parts of text with several different formats (bold, underlined, different font), causes the pasted text to have an unique format (but I did't use special paste). It seems a random future, because it's not so for every copy/paste... I really can't figure why sometimes the text will be pasted with the original format, and sometime with an unique format.
Can you explain what happens, or investigate about it (btw, it was so with NeoOffice 3.1.x and it's so with NeoOffice 3.2)?
Last edited by sta_admin on Mon May 16, 2011 9:37 am; edited 2 times in total
Thank you for the document. The first thing that I see is that in all of the lines with underlines, only the words are set to use the Times New Roman font and all of the spaces and underlines next in those lines use the MS Comic Sans font. I suspect that that is what is sometimes triggering NeoOffice's underlying OpenOffice.org code to set all of the paste content to MS Comic Sans.
If you select all of the lines in an entire section like the "denominazione" section, and set the font to Times New Roman for the entire section, does that stop the problem from occurring when pasting any content copies from that section?
If you select all of the lines in an entire section like the "denominazione" section, and set the font to Times New Roman for the entire section, does that stop the problem from occurring when pasting any content copies from that section?
Maybe, I'll try later. But I need to have the document as it is, with the empty places underlined and with a different fonts
Maybe, I'll try later. But I need to have the document as it is, with the empty places underlined and with a different fonts
I understand. What I can give you then is a way to avoid this problem. In the first case, you highlight the last "denominazione" line and insert a newline at the at of the copied line and then past the copied line.
In this case, then end of the copied line is MS Comic Sans so when you insert a newline, then end of the copied line through the beginning of the new line are set to MS Comic Sans. This is what triggers the behavior that you see. Specifically, the behavior is that when you insert newlines, spaces, or text, the font at the cursor is given priority over the font in the copied content.
Unfortunately, this unintuitive behavior is normal behavior in both OpenOffice.org 3.3 (the latest version) and OpenOffice.org 3.1.2 (the version that NeoOffice 3.1.2 and 3.2 are based on) so I started looking for a workaround.
Fortunatly, the workaround for the first case is to modify your steps slightly. Like before, select the entire line but then move the cursor to the beginning of the next line and insert an empty new line. Then move the cursor backwards to the empty new line and paste.
Does that workaround work for you in the first case? If so, I will check and see if the same workaround works for the seconds case and, if not, investigate the second case further.
Fortunatly, the workaround for the first case is to modify your steps slightly. Like before, select the entire line but then move the cursor to the beginning of the next line and insert an empty new line. Then move the cursor backwards to the empty new line and paste.
Patrick
This seems to work. But I've same doubts it will work flawless for any case, because in some case I got strange combination of pasted formats, something like underlined Times New Roman (that I didn't have in copied text), or like in the first example, parts of converted MS Comic Sans font without underlining (see letter "P" before ".IVA" in pasted text). But until now it's OK.
pluby wrote:
If you select all of the lines in an entire section like the "denominazione" section, and set the font to Times New Roman for the entire section, does that stop the problem from occurring when pasting any content copies from that section?
This a bit less, because even I change font to Times New Roman, the pastes text will be entirely underlined.
If you select all of the lines in an entire section like the "denominazione" section, and set the font to Times New Roman for the entire section, does that stop the problem from occurring when pasting any content copies from that section?
This a bit less, because even I change font to Times New Roman, the pastes text will be entirely underlined.
I will look at your document again tomorrow and see if I can find any way to change the paragraph styles or character formatting so that this behavior does not get triggered. It appears to me that the many overlapping styles, font size, and underlining attributes in that section causes NeoOffice's underlying OpenOffice.org code to "give up" and use the "start of the line" format for the new pasted line.
I think that I have found a way to stop NeoOffice's underlying OpenOffice.org code from overriding the formatting in the pasted content: after you insert an empty new line but before you paste, right-click or Control-click on the empty new line and in the popup menu that appears, select the "Default Formatting" menu. After selecting that menu, you should be able to paste without losing any formatting in the copied content.
Does this workaround work for you?
Unfortunately, the OpenOffice.org code appears to always give priority to the formatting already assigned to the cursor and there is no way to turn this behavior off so if my latest workaround does not work, let us know and I will continue searching for alternative workarounds.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum