Bug 86639 - FORMATTING: application paragraph style on text in RTF works incorrectly
Summary: FORMATTING: application paragraph style on text in RTF works incorrectly
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.5.0 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:5.0.0
Keywords: notBibisectable, regression
Depends on:
Blocks: RTF-Styles
  Show dependency treegraph
 
Reported: 2014-11-23 21:42 UTC by Paolo Meozzi
Modified: 2022-01-10 09:32 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
RTF file saved from Wordpad for testing (192 bytes, application/rtf)
2015-02-22 10:48 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paolo Meozzi 2014-11-23 21:42:00 UTC
Problem description: 
When i apply a style to a text in RTF format (pasted from WordPad, for example), the font remains the original one.

Steps to reproduce:
1.Open WordPad (or Visual Studio, for example)
2.Insert text, copy and past to Writer
3.Apply a paragraph style with different font

Current behavior:
Font remains the original one

Expected behavior:
Font become one defined style.
Comment 1 Robinson Tryon (qubit) 2015-02-08 13:16:02 UTC
(In reply to Paolo Meozzi from comment #0)
> Problem description: 
> When i apply a style to a text in RTF format (pasted from WordPad, for
> example), the font remains the original one.
> 
> Steps to reproduce:
> 1.Open WordPad (or Visual Studio, for example)
> 2.Insert text, copy and past to Writer
> 3.Apply a paragraph style with different font

Hi Paolo,
Can you reproduce the issue if you open an RTF file with LibreOffice directly? It would be great to be able to test in that fashion.

Status -> NEEDINFO

(Please change status back to UNCONFIRMED after you test it out. Thanks!)
Comment 2 Paolo Meozzi 2015-02-10 18:12:39 UTC
I reproduce the issue. The problem remains.

To reproduce:

1.Open WordPad, insert a text and save document.
2.Open the document with Writer.
3.Apply a paragraph style with different font

Current behavior:
Font remains the original one

Expected behavior:
Font become one defined style.
Comment 3 Buovjaga 2015-02-22 10:48:01 UTC
(In reply to Paolo Meozzi from comment #2)
> I reproduce the issue. The problem remains.
> 
> To reproduce:
> 
> 1.Open WordPad, insert a text and save document.
> 2.Open the document with Writer.
> 3.Apply a paragraph style with different font
> 
> Current behavior:
> Font remains the original one
> 
> Expected behavior:
> Font become one defined style.

Reproduced already in 3.5.0. Not reproduced in 3.3.0. In 3.3.0 the font family changes when applying style.

Win 7 Pro 64-bit, LibO Version: 4.4.0.3
Build ID: de093506bcdc5fafd9023ee680b8c60e3e0645d7
Locale: fi_FI

Version: 4.5.0.0.alpha0+
Build ID: b13534de022972131b46f93f5ada90af155eec9e
TinderBox: Win-x86@62-TDF, Branch:MASTER, Time: 2015-02-19_00:21:37
Locale: fi_FI

Ubuntu 14.10 64-bit 
Version: 4.4.0.3
Build ID: 40m0(Build:3)
Locale: en_US

LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4

LibreOffice 3.5.0rc3 
Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735
Comment 4 Buovjaga 2015-02-22 10:48:37 UTC
Created attachment 113597 [details]
RTF file saved from Wordpad for testing
Comment 5 Robinson Tryon (qubit) 2015-03-05 17:00:59 UTC
(In reply to Beluga from comment #3)
> Reproduced already in 3.5.0. Not reproduced in 3.3.0. In 3.3.0 the font
> family changes when applying style.

Ah, too early a regression for bibisect
Whiteboard -> notBibisectable
Comment 6 Miklos Vajna 2015-05-13 16:06:14 UTC
The old internal RTF filter used to call SwTxtNode::SetAttr() without setting SetAttrMode::NOFORMATATTR, so character attributes which cover the whole node got converted to paragraph attributes.  The new UNO filter goes through SwXText::insertTextPortion(), which sets SetAttrMode::NOFORMATATTR, so this doesn't happen. The result of this is that when the UI sets a new paragraph
style on the text node, then such character attributes are no longer removed.
Comment 7 Commit Notification 2015-05-14 09:48:37 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3c0805e1f4f4d14e92c7e655d59c87de5c207e48

tdf#86639 SwEditShell: when setting para style, reset char attrs if needed

It will be available in 5.0.0.

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.
Comment 8 Robinson Tryon (qubit) 2015-12-17 10:58:19 UTC Comment hidden (obsolete)