Font size changes when pasting cells from LibreOffice Calc
Categories
(Core :: DOM: Editor, defect)
Tracking
()
People
(Reporter: subscriptions, Unassigned)
References
Details
(Whiteboard: dupeme)
Comment 3•14 years ago
|
||
Comment 4•14 years ago
|
||
Updated•14 years ago
|
Comment 6•14 years ago
|
||
| Reporter | ||
Comment 10•14 years ago
|
||
| Reporter | ||
Comment 11•14 years ago
|
||
Comment 12•14 years ago
|
||
Comment 13•14 years ago
|
||
Comment 14•14 years ago
|
||
Comment 15•14 years ago
|
||
Comment 16•14 years ago
|
||
| Reporter | ||
Comment 17•14 years ago
|
||
Comment 18•14 years ago
|
||
| Reporter | ||
Comment 19•14 years ago
|
||
Comment 20•13 years ago
|
||
Updated•12 years ago
|
Comment 21•12 years ago
|
||
Comment 22•12 years ago
|
||
Comment 23•10 years ago
|
||
Comment 24•9 years ago
|
||
Comment 25•9 years ago
|
||
Comment 26•9 years ago
|
||
Comment 27•6 years ago
|
||
Still happening on some emails sent, but not all. Thunderbird 60.8.0 (64-bit), LibreOffice 6.3.1.2, Ubuntu 19.04. Looking at the source code of the email, I wonder if it not a problem with the zoom changing automatically for showing more on the view pane. But I am not an expert regarding TB.
Comment 28•4 years ago
|
||
Thunderbird 78.13.0 (64-bit), Ubuntu.
This stuff gets inserted:
"<style type="text/css">body,div,table,thead,tbody,tfoot,tr,th,td,p { font-family:"Arial"; font-size:x-small } ..."
Format -> Size from the menu shows Medium, and changing the font size there has no effect. Everything is still x-small.
Got here from this 11 year old bug: https://bugzilla.mozilla.org/show_bug.cgi?id=648797
Updated•3 years ago
|
Comment 29•3 years ago
|
||
This is really annoying and a waste of time to try to format it back like it was before. Bug was opened 12 years ago! :(
Issue is still happening with LibreOffice 6.4.7.2 and Thunderbird 102.4.2 and so easy to reproduce; just copy cells from LibreOffice Calc to Thunderbird when you reply to an email. Everything is messed up.
The fix from Mark still works but no need to click, after pasting the cells: DOWN ARROW then SHIFT+LEFT ARROW then DELETE
Comment 30•3 years ago
|
||
You'd think that two open source software would work well together but that is not the case.
My fix is still the fastest way around: paste the cells like CTRL-V, then DOWN ARROW once then SHIFT+LEFT ARROW then DELETE
However, I just found out, make sure that the copied cells are not the last lines in the emails, else it will not work. Press ENTER a couple of times and paste above.
Comment 31•3 years ago
|
||
Could it be possible to manage the copied html from Libreoffice:
- wrapping the content in one new <div>, so to isolate the new pasted html
- get the original libreofffice <style> contained in the <head>, and move it as a <style> for the new <div>
the idea is to keep the pasted style, without applying it to the whole message.
In case there is no <head> with a <style> (eg: no libreoffice clipboard source) in the clipboard content , the paste is performed just injecting the clipboard content in a new <div>
May it work ?
Comment 32•3 years ago
|
||
This is an 11 years old bug, not assigned. There is no developer following this issue.
Forget it. It will never be fixed.
Consider the workaround on Comment #20 as the only possible solution.
Comment 33•3 years ago
|
||
An excellent idea, by Giuliano Lotta, in Comment 31.
https://bugzilla.mozilla.org/show_bug.cgi?id=758999#c31
Comment 34•3 years ago
|
||
Thunderbird 102, Libre Office 7.4, the bug is still there and very upsetting...
Thanx for the workaround, but it's a bit tricky for non tech people :-(
Comment 36•1 month ago
|
||
This is a 13 years old bug.
There is no developer following it.
Try the Comment #20 workaround and I guess worth to open a new bug report. This one is dead.
Comment 37•1 month ago
|
||
Bug has a status OPEN, it's not dead. Making a new bug report will just make a duplicate of this one.
I found a really nice fix but I have no idea if it will cause a regression issue. I am not a Thunderbird developer. The patch below is from ChatGPT.
Fix Thunderbird Spreadsheet Paste Font Size Bug on Linux
Problem : When pasting cells from Excel / LibreOffice Calc into a Thunderbird email, the pasted HTML can bring bad font-size styling and make the whole email text appear smaller. This patch strips spreadsheet font-size junk before Thunderbird inserts the HTML.
-
Backup
sudo cp /usr/lib/thunderbird/omni.ja /usr/lib/thunderbird/omni.ja.bak -
Extract
mkdir /tmp/tbpatch
cd /tmp/tbpatch
unzip /usr/lib/thunderbird/omni.ja -
Edit
xed chrome/messenger/content/messenger/messengercompose/MsgComposeCommands.js
Find:
// Ok, we have html content to paste.
const html = dataTransfer.getData("text/html");
const doc = new DOMParser().parseFromString(html, "text/html");
It is at line 4439. Add this after:
// Fix spreadsheet paste font-size pollution.
const hasFontJunk =
doc.querySelector("[style*='font-size']") ||
doc.querySelector("font[size]");
if (hasFontJunk) {
e.preventDefault();
for (const el of doc.querySelectorAll("[style]")) {
if (el.style.fontSize) {
el.style.fontSize = "";
}
if (!el.getAttribute("style")?.trim()) {
el.removeAttribute("style");
}
}
for (const font of doc.querySelectorAll("font[size]")) {
font.removeAttribute("size");
}
GetCurrentEditor().insertHTML(doc.body.innerHTML);
return;
}
-
Repack
cd /tmp/tbpatch
zip -r9 ../omni.ja * -
Replace
sudo cp ../omni.ja /usr/lib/thunderbird/omni.ja -
Clear cache
rm -rf ~/.cache/thunderbird ~/.thunderbird/*/startupCache -
Start Thunderbird and test
To rollback:
sudo cp /usr/lib/thunderbird/omni.ja.bak /usr/lib/thunderbird/omni.ja
Notes:
Thunderbird updates will overwrite this patch.
This only modifies HTML paste containing font-size junk, so normal paste behavior should mostly remain untouched.
Comment 38•1 month ago
|
||
(In reply to Zurd from comment #37)
Bug has a status OPEN, it's not dead. Making a new bug report will just make a duplicate of this one.
In 13 years, not a single developer jumped in. So this bug report is dead. It's in a limbo.
It was reported on Thunberbird 12, we are now on version 140.
Open a new bug report to Thunderbird 140 and fingers crossed that someone will look at it. Doesn't worth to keep insisting on this one.
Description
•