Bug 90021 - Inserting an email address deletes document content.
Summary: Inserting an email address deletes document content.
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.3.4.1 release
Hardware: IA64 (Itanium) Windows (All)
: medium critical
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-15 16:56 UTC by Albrecht Müller
Modified: 2016-09-20 18:23 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example to show the effect (5.64 KB, application/rtf)
2015-03-15 16:56 UTC, Albrecht Müller
Details
malformed rtf file (2.86 KB, application/rtf)
2015-03-17 01:10 UTC, Gordo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Albrecht Müller 2015-03-15 16:56:20 UTC
Created attachment 114108 [details]
Example to show the effect

How to reproduce/current behaviour: Open LibreOffice Writer, create a new document, enter some text and save it in RTF format. Close Writer and open the document again – you may just use the attached document. Copy some email address into the clipboard, e.g. this one (without the quotes): „Dummy User <dummy@example.com>“. Set the cursor at the beginning of the document and paste the email address as plain text (e.g. using Shift+Ctrl+V). Press enter. 
Now the first line of the document is this email address. Close Writer without saving the changed document before. Writer should remind you that there are unsaved changes and ask you if you want to save the changes. Answer „Yes“. Depending on the Writer configuration another dialog box may appear asking if you want to save the document in RTF format. Choose saving in RTF format. The Writer window should disappear.
Reopen the document. It now contains the first line only up to but not including the closing bracket („>“). The rest of the content is gone and I did not find any way to recover it.
Expected behaviour: When the saved document is reopened, it should contain the content it had when saved.
Observed with: Version: 4.3.4.1, Build-ID: bc356b2f991740509f321d70e4512a6a54c5f243

I think this is a critial error as it causes unrecoverable data loss.
Comment 1 Albrecht Müller 2015-03-16 08:32:59 UTC
Same effect observed with LibreOffice Writer Version: 4.3.3.2 Build-ID: 430m0(Build:2) and Ubuntu 14.10.
Comment 2 Albrecht Müller 2015-03-16 09:05:46 UTC
A still easier way to reproduce the problem: Create a new document, insert some text, save it in RTF format. Reload it to make sure that the text has been saved. Goto the beginning of the text and enter some email address in the form "Name <dummy@example.com>" and press enter. Save the document and reload it. The content of the document now consists of a single line containing the email address truncated before the closing ">".
Comment 3 Gordo 2015-03-17 01:10:50 UTC
Created attachment 114140 [details]
malformed rtf file

I can confirm that the data does not display.  Opening the file with wordpad also fails to display the data.  Opening the file with notepad shows that the data is still there.

I think the data has become part of the link.

Removing the brackets before saving keeps the data.

Version: 4.4.1.2
Build ID: 45e2de17089c24a1fa810c8f975a7171ba4cd432
Comment 4 Michael Meeks 2015-03-19 11:23:29 UTC
An interesting RTF issue Miklos - I forget where the tracker is.

FYI - as/when the RTF parser stumbles on something - it is absolutely normal to loose the rest of the document from then onwards =) I imagine to get your data back, you'd want to manually edit the RTF file to tweak around this issue & restore your file data.

Thanks for reporting.
Comment 5 Paul 2015-05-15 20:42:35 UTC
Bug confirmed on:
Version: 4.4.3.2
Build ID: 40m0(Build:2) (Debian)
Locale : fr_FR

Here is how is saved a paragraph with 3 emails links:

\par \pard\plain \s0\ql\nowidctlpar\ltrpar{\*\hyphen2\hyphlead0\hyphtrail2\hyphmax0}\cf1\kerning1\dbch\af10\langfe1081\dbch\af10\afs24\alang1081\loch\f3\fs24\lang1036\ql\nowidctlpar{{\field{\*\fldinst HYPERLINK "mailto:email1@example.com" }{\fldrslt {\cf2\ul\ulc0\langfe255\lang255\cf1\i\kerning1\dbch\af9\langfe1081\rtlch \ltrch\loch\fs24\lang1036
email1@example.}{}}}{\field{\*\fldinst HYPERLINK "mailto:comemail2@example.com" }{\fldrslt {\cf2\ul\ulc0\langfe255\lang255\cf1\i\kerning1\dbch\af9\langfe1081\rtlch \ltrch\loch\fs24\lang1036
comemail2@example.com}{}}}\cf1\i\kerning1\dbch\af9\langfe1081\rtlch \ltrch\loch\fs24\lang1036
\~; }{{\field{\*\fldinst HYPERLINK "mailto:email3@example.com" }{\fldrslt {\cf2\ul\ulc0\langfe255\lang255\cf1\i\kerning1\dbch\af9\langfe1081\rtlch \ltrch\loch\fs24\lang1036
email3@example.com}{}}}}}}{\field{\*\fldinst HYPERLINK }{\fldrslt {\cf1\i\kerning1\dbch\af9\langfe1081\rtlch \ltrch\loch\fs24\lang1036
 }
Comment 6 QA Administrators 2016-09-20 09:41:55 UTC Comment hidden (obsolete)
Comment 7 Albrecht Müller 2016-09-20 18:23:18 UTC
Seems to work now.

Version: 5.1.4.2
Build-ID: f99d75f39f1c57ebdd7ffc5f42867c12031db97a
BS-Version: Windows 6.1;
Gebietsschema: de-DE (de_DE)