Problem description: RTF groups, denoted by enclosing curly brackets, are supposed to stack the current character/ruler state and restore it after the closing bracket. If the previous state included tab settings, LibreOffice fails to delete tabs set within the brackets, leading to column misalignment. Steps to reproduce: 1. This small RTF file displays the problem: {\rtf1\ansi {\fonttbl \f0\froman Times;} \deftab31680 \pard\tx1440\plain\ql\f0\fs40 {\tx360\tx720\tx1080\tab\tab\tab\tab This is line one.\ }{\tx480\tx960\tab\tab\tab This is line two.\ }{\tx720\tab\tab This is line three.\ }{\tab This is line four.\ \tab All these lines should start one inch from the left margin.\ }} 2. This similar file doesn't, as it has no tabs set outside the groups: {\rtf1\ansi {\fonttbl \f0\froman Times;} \deftab31680 \pard\plain\ql\f0\fs40 {\tx360\tx720\tx1080\tx1440\tab\tab\tab\tab This is line one.\ }{\tx480\tx960\tx1440\tab\tab\tab This is line two.\ }{\tx720\tx1440\tab\tab This is line three.\ }{\tx1440\tab This is line four.\ \tab All these lines should start one inch from the left margin.\ }} Current behavior: The first file shows misaligned lines; the second doesn't. Expected behavior: Both files should display like the second file, as they do in Microsoft Word, (Mac) TextEdit, Nisus Writer, and other RTF readers. It's a somewhat obscure bug. I hope the fix is easy. Operating System: Mac OS X Version: 4.2.1.1 release
It was good in 3.6.4. Confirmed with 4.0.
Regression from a48e2fd9049797110b3b2505c363557284987ca8, the problem is that when we set an attribute in a nested structure, then ensureCopyBeforeWrite() before set() is only called for the child, not for the parent.
Miklos Vajna committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=6b6e4d471c2954d34d280398ed1c986d7fb27ae1 fdo#75735 RTF import: fix COW when writing a nested structure 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.
-4-2 review: https://gerrit.libreoffice.org/9100
Miklos Vajna committed a patch related to this issue. It has been pushed to "libreoffice-4-2": http://cgit.freedesktop.org/libreoffice/core/commit/?id=d65fff78bfcb4c557d35eec8293c9109ab34fc03&h=libreoffice-4-2 fdo#75735 RTF import: fix COW when writing a nested structure It will be available in LibreOffice 4.2.5. 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.