Bug 83223 - Undo does not work when modifying a conditional style including Text Body
Summary: Undo does not work when modifying a conditional style including Text Body
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium minor
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:5.1.0 target:5.0.1
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-29 05:50 UTC by János Néhrer
Modified: 2016-10-25 19:24 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description János Néhrer 2014-08-29 05:50:44 UTC
Environment:
- any OS (reproduced on OpenSUSE 13.1 and Windows)
- LibreOffice 3.6 or newer (reproduced on 3.6, 4.1.x, 4.3.1)

Steps to duplicate:
1. Create a new document in Writer
2. Type some text. For example Hello world!
3. Select the paragraph and change its style to 'Text body'
4. Modify the style (either by using 'Styles and formatting' dialog or by right-clicking the paragraph and choose 'Edit paragraph style'. For example, change font size of Text body size to 72.
5. Press Ctrl+Z or click Undo.

Result:
Font size will not change back, Text body style changes remain.

Expected result:
All changes to text body style should be undone when pressing Ctrl+Z.

Facts:
- the issue can be reproduced with any style that is a conditional one. Follow these steps to create a style that produces the issue:
1. In 'Styles and formatting' dialog, select any style.
2. Click 'New...'
3. On the appearing dialog, select 'Condition' tab, and make sure 'Conditional style' checkbox is selected.
Comment 1 ign_christian 2014-09-15 15:14:19 UTC
Reproduced with LO 4.2.6.3, 3.3.0.4 under Ubuntu 12.04 x86. Also with AOO 4.1.1, seems inherited from OOO.

Click undo 2 times will undo the change
Comment 2 János Néhrer 2014-09-15 15:46:39 UTC
Incorrect. 2 undos will revert the application of the style.
The new style change cannot be undone.
Comment 3 ign_christian 2014-09-15 16:00:47 UTC
> Incorrect. 2 undos will revert the application of the style.
> The new style change cannot be undone.
Yes, you're right János. 2 undos makes it back to default style. Modified 'Text Body' not reverted.

Sorry for not observing carefully. I'll revert the summary back.
Comment 4 Michael Stahl (allotropia) 2015-07-29 22:15:05 UTC
it's just that the Undo class for this does not handle the ID of conditional styles; no idea why that is; it seems to work if i just add it.

fixed on master
Comment 5 Commit Notification 2015-07-29 22:15:50 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=37e936996acb4a8329fad2ec73a35f66be446e90

tdf#83223: sw: fix Undo of format change of conditional para style

It will be available in 5.1.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 6 Commit Notification 2015-08-03 16:08:10 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=183c317f01ccade1c7865e05e608ea7295c8d39e&h=libreoffice-5-0

tdf#83223: sw: fix Undo of format change of conditional para style

It will be available in 5.0.1.

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 7 János Néhrer 2015-08-07 12:31:04 UTC
Verified as fixed in 5.0.1