Bug 81463 - UNO: No refresh after calling setPropertyToDefault
Summary: UNO: No refresh after calling setPropertyToDefault
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
4.1.6.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: lhm-limux
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2014-07-17 14:09 UTC by Ignaz Forster
Modified: 2015-12-17 08:26 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Example document (12.40 KB, application/vnd.oasis.opendocument.text)
2014-07-17 14:09 UTC, Ignaz Forster
Details
Patch for master to verify bisect result (3.42 KB, patch)
2015-01-30 07:48 UTC, Michael Weghorn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ignaz Forster 2014-07-17 14:09:41 UTC
Created attachment 102984 [details]
Example document

Since LibreOffice 4.1 the setPropertyToDefault UNO call doesn't work as expected any more: When resetting a property ("CharBackColor" in this case) with setPropertyToDefault, the view is not updated (i.e. the background color doesn't change in this case).

When scrolling the text out of the view and in again, pressing enter in any line or inserting a character the background color is suddenly correct.

Steps to reproduce:
- Open the attached document and allow macro execution
- Double click on the text "Test" in the document to select it
- Select "Macro_Colorize" -> "Mark" from the menu bar; the text now has blue / cyan background
- Select "Macro_Colorize" -> "Unmark" from the menu bar; the background _should_ be white again, however the cyan background is still present
- Press Enter; the background changed to the expected transparent / white from the previous step now.

The error occurs on every release since 4.1 and also in last week's daily build of master.


The BASIC code for reference:

Sub Mark
oDoc = ThisComponent
range = oDoc.CurrentController.getViewCursor
range.setPropertyValue("CharBackColor", 44444)
End Sub

Sub Unmark
oDoc = ThisComponent
range = oDoc.CurrentController.getViewCursor
range.setPropertyToDefault("CharBackColor")
End Sub
Comment 1 Jan-Marek Glogowski 2014-07-22 17:30:18 UTC
Just an additional observation - Undo works as expected.
Both - Undo and Macro call SwDoc::ResetAttrs.

Also changing the focus to the header causes a view refresh.
Comment 2 Buovjaga 2014-11-05 08:44:05 UTC
I confirm.

From the desc, I understand this to be a regression, so adding appropriate whiteboard and keyword.

Win 7 64-bit Version: 4.4.0.0.alpha1+
Build ID: b7d8a58ff2698ffc6e22943f64aa97c5ea253bd9
TinderBox: Win-x86@42, Branch:master, Time: 2014-11-05_00:40:38
Comment 3 Matthew Francis 2014-12-10 05:21:19 UTC
Bibisect results from 43all:
This one was somewhat challenging to bibisect, so these results should be taken with a pinch of scepticism;
- The bug is difficult to reproduce. Sometimes the macro works as intended several times before the bug is visible
- There is a range of commits in the vicinity of the bug where it's necessary to delete the user profile (~/.config/libreoffice) or LO won't start


commit aed6d9e275e4560aa251d23dd7ba6a0a725afab7
Author: Bjoern Michaelsen <bjoern.michaelsen@canonical.com>
Date:   Sun Dec 9 12:51:45 2012 +0000

    source-hash-c77918bb03974ff9be90c889f77e62ea0755052f
    
    commit c77918bb03974ff9be90c889f77e62ea0755052f
    Author:     Fridrich Štrba <fridrich.strba@bluewin.ch>
    AuthorDate: Fri May 25 16:46:41 2012 +0200
    Commit:     Fridrich Štrba <fridrich.strba@bluewin.ch>
    CommitDate: Fri May 25 16:47:23 2012 +0200
    
        Revert "Make SotStorage and SotStorageStream dtors public"
    
        This reverts commit 90f3840e4c767154266c6be1c532f5e748e8c3f7.


# bad: [a71a4447320f177181c9cff9f7c6fd93802cbd8e] source-hash-9afb6e1e38c362a768e8e981f7b03cf8bcaf22cf
# good: [cf86b7f14a98d2d81a5cd93507acb35ff6775d8b] source-hash-85c6244b85b29c1d2bb9d89b62e9512dd65378b5
git bisect start 'last36onmaster' 'last35onmaster'
# good: [5071c2206541a2db45ead3ead86da2de873fa2c2] source-hash-b36a42fb831b853120928e05dcf322898a92a731
git bisect good 5071c2206541a2db45ead3ead86da2de873fa2c2
# good: [09b0c68ed3c0cb7a96ac98146a67e9540df994c8] source-hash-d50f02bec4a70bd26a518e4e76f4a876454ab937
git bisect good 09b0c68ed3c0cb7a96ac98146a67e9540df994c8
# good: [d101b9946a6a04e65e3923038503436c790b7e12] source-hash-18e6e7d929c2be209407ed2e56b8ec4d5e6c4900
git bisect good d101b9946a6a04e65e3923038503436c790b7e12
# bad: [e4c742a9e244bd7ebeabc50c90182df28ac3daaf] source-hash-c52ba433491afbca70aa1977a624c795bdd5b9ef
git bisect bad e4c742a9e244bd7ebeabc50c90182df28ac3daaf
# good: [e87a0055deae2c9e25ae1d1a365cec8418b785ce] source-hash-67ff63988f3b8eef2cc2b5bdf917918b93c3f070
git bisect good e87a0055deae2c9e25ae1d1a365cec8418b785ce
# bad: [aed6d9e275e4560aa251d23dd7ba6a0a725afab7] source-hash-c77918bb03974ff9be90c889f77e62ea0755052f
git bisect bad aed6d9e275e4560aa251d23dd7ba6a0a725afab7
# good: [638cb54cb50a2b1269009db83f70792cf5076abc] source-hash-877c96a601e6e50d0c7a8f704d57baec22f089c5
git bisect good 638cb54cb50a2b1269009db83f70792cf5076abc
# first bad commit: [aed6d9e275e4560aa251d23dd7ba6a0a725afab7] source-hash-c77918bb03974ff9be90c889f77e62ea0755052f
Comment 4 Matthew Francis 2014-12-10 05:29:40 UTC
Nothing immediately stands out to me in the source commit range for the above, and it's a bit too old to readily build on a modern distribution. A VM with an older install will be required to build and bisect further
Comment 5 Michael Weghorn 2015-01-30 06:55:10 UTC
(In reply to Matthew Francis from comment #4)
> Nothing immediately stands out to me in the source commit range for the
> above, and it's a bit too old to readily build on a modern distribution. A
> VM with an older install will be required to build and bisect further

After some problems getting those old LibreOffice versions to build (on Debian Jessie, Debian Wheezy, Debian Squeeze and Fedora 21), I finally managed to build them on Debian Jessie and did a bisect by building and testing the respective commits. (The commits I skipped in the bisect gave me build errors which I did not investigate further - they might have worked after running "make clean").


bisect result:
 ce14342c4292628a641a72d4f63d9c048e030c6a is the first bad commit
commit ce14342c4292628a641a72d4f63d9c048e030c6a
Author: Muhammad Haggag <mhaggag@gmail.com>
Date:   Tue May 22 16:59:37 2012 +0200

    fdo#34772 Add word count to the status bar in writer
    
    This change adds a new status bar control,
    "SwWordCountStatusBarControl". The control shows the number of words
    selected as well as the number of words in the whole
    document. Double-clicking the control launches the modeless word count
    dialog.
    
    Change-Id: I756183ab1aaf4d059e782dfb05508370178cfbe3

:040000 040000 158d826a61bb2046c2c2d5321521e6931ee3a480 8a26fa30b45e6bbd70d429c99812cfb99e29a952 M	sw


--
$ git bisect log
# bad: [c77918bb03974ff9be90c889f77e62ea0755052f] Revert "Make SotStorage and SotStorageStream dtors public"
# good: [877c96a601e6e50d0c7a8f704d57baec22f089c5] copy msms only for ver 9.0, MSVC 2010 doesn't have them
git bisect start 'c77918bb03974ff9be90c889f77e62ea0755052f' '877c96a601e6e50d0c7a8f704d57baec22f089c5'
# skip: [d89fe2764c198df405420447952aac81282e151e] oox: remove duplicate custom makefile from writerfilter10
git bisect skip d89fe2764c198df405420447952aac81282e151e
# skip: [ac6c57e12fb18a8294c57f79ec979128c735ec68] testcases for bnc#652364 and bnc#750255
git bisect skip ac6c57e12fb18a8294c57f79ec979128c735ec68
# skip: [9613a480ceff548ec1f4fedd76e39a2a0c767942] These hacks no longer work.  Remove it and find a better solution.
git bisect skip 9613a480ceff548ec1f4fedd76e39a2a0c767942
# good: [fe7a4aad76c051bc46ae46b175fb182b6e7e3f89] testcases for bnc#652364 and bnc#750255 for .docx too
git bisect good fe7a4aad76c051bc46ae46b175fb182b6e7e3f89
# skip: [427b50c05f18de474dd5b88b705951240335beac] Use the new plain text type detection service for text/csv type.
git bisect skip 427b50c05f18de474dd5b88b705951240335beac
# good: [4490eb8c9c701510a3370c900a6c6ec9e4f8a70d] Convert V_DECL_PTRARR_DEL(SwFlySaveArr) to std::vector
git bisect good 4490eb8c9c701510a3370c900a6c6ec9e4f8a70d
# bad: [d785059238abf7ee28aec1b6555dcd38c5b6c61f] WaE: nPos potentially uninitialized with gcc 4.7.0
git bisect bad d785059238abf7ee28aec1b6555dcd38c5b6c61f
# good: [8b8e24544793f4ec6f61edb7ce8ac10bf6bb0981] Do the real detection work for plain text & forgot to add a makefile.
git bisect good 8b8e24544793f4ec6f61edb7ce8ac10bf6bb0981
# bad: [f4e9f095fc7306651246f648b9caf706652ca8a8] SwFlySaveArr: Apple GCC complains about constructors
git bisect bad f4e9f095fc7306651246f648b9caf706652ca8a8
# good: [89d6c3ef8ea691dbd3383cffe21e75c3200821de] Accidentally committed this...
git bisect good 89d6c3ef8ea691dbd3383cffe21e75c3200821de
# bad: [8ed3a427245a07bb787c521a178cfb421fa46854] Followup to fdo#34772: Add resource strings for word-count messages
git bisect bad 8ed3a427245a07bb787c521a178cfb421fa46854
# bad: [ce14342c4292628a641a72d4f63d9c048e030c6a] fdo#34772 Add word count to the status bar in writer
git bisect bad ce14342c4292628a641a72d4f63d9c048e030c6a
# first bad commit: [ce14342c4292628a641a72d4f63d9c048e030c6a] fdo#34772 Add word count to the status bar in writer
Comment 6 Michael Weghorn 2015-01-30 07:48:22 UTC
Created attachment 112941 [details]
Patch for master to verify bisect result

In order to verify the bisect result, I have created a "patch" for master that reverts some of the changes made by commit ce14342c4292628a641a72d4f63d9c048e030c6a, which was identified as the first one where the problem described here occurs.

This patch is NOT meant for inclusion in LibreOffice as it
probably breaks many other things...

The only intention of the patch is to show what actually causes the behaviour described in this bug report.
Comment 7 Michael Weghorn 2015-01-30 07:52:28 UTC
(In reply to Michael Weghorn from comment #6)

> In order to verify the bisect result, I have created a "patch" for master
> that reverts some of the changes made by commit
> ce14342c4292628a641a72d4f63d9c048e030c6a, which was identified as the first
> one where the problem described here occurs.
> 

In order to clarify my last comment: When this "patch" is applied to master, the problem should no longer occur there and the view should be updated in the right way.
Comment 8 Björn Michaelsen 2015-07-06 16:59:54 UTC
Comment on attachment 112941 [details]
Patch for master to verify bisect result

Marking patch obsolete as it is not intended for merging (see comment 6)
Comment 9 Andras Timar 2015-07-07 21:35:04 UTC
It is fixed in LibreOffice 5.0. The fix is in the range of 65a44185a66450aa5bc0c7bc6cdd1c2f0efdd672..64f45731a7ec8b5220649a387d2c26d27c912dd5 (changed vcl timers to idles). Probably it's hard to backport.
Comment 10 Robinson Tryon (qubit) 2015-12-17 08:26:45 UTC
Migrating Whiteboard tags to Keywords: (bibisected)
[NinjaEdit]