Bug 97601 - Accessing chart data through API results in infinite redraw loop
Summary: Accessing chart data through API results in infinite redraw loop
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.5.0.0.alpha0+ Master
Hardware: x86-64 (AMD64) Windows (All)
: medium major
Assignee: Miklos Vajna
URL:
Whiteboard: target:5.2.0 target:5.1.3 target:5.0.6
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2016-02-05 18:54 UTC by Jan Rheinländer
Modified: 2016-10-25 19:08 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Writer file with chart and macro (20.75 KB, application/vnd.oasis.opendocument.text)
2016-02-05 18:54 UTC, Jan Rheinländer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Rheinländer 2016-02-05 18:54:09 UTC
Created attachment 122412 [details]
Writer file with chart and macro

On Windows 7 LO 5.0.4, after changing the data in a chart through the API, an infinite chart redraw loop results.

To reproduce:
Open the attached document and run the macro.
The line

  oChart.ExtendedControlOverEmbeddedObject.changeState(1)

triggers the redraw loop. But without this line the diagram will not show the changed data.

The bug is NOT present on Ubuntu 14.04 LO 4.2 and Apache OO 4.1.2.

The bug is also present when executing the following code from a C++ extension after changing the chart data:

  Reference < XEmbeddedObjectSupplier > xEOS(xChart, UNO_QUERY_THROW);
  Reference < ::com::sun::star::chart::XChartDocument > cDoc(xEOS->getEmbeddedObject(), UNO_QUERY_THROW);

  Reference< XPropertySet > dProperties(cDoc->getDiagram(), UNO_QUERY_THROW);
  Any type = dProperties->getPropertyValue(OU("SplineType"));
  dProperties->setPropertyValue(OU("SplineType"), makeAny(sal_uInt32(0)));
  dProperties->setPropertyValue(OU("SplineType"), makeAny(sal_uInt32(1)));
  dProperties->setPropertyValue(OU("SplineType"), type);

Here changing the SplineType triggers the redraw loop.

Note: This bug was found as a result of trying to get the chart to update when the data was changed. The line of code given above seems to be the only way to achieve this.
Comment 1 Buovjaga 2016-02-11 08:35:20 UTC
Repro.

Works ok in 4.3

Win 7 Pro 64-bit Version: 5.2.0.0.alpha0+
Build ID: a6f876d45bd4e41a7143594a6cb11b6893a0f620
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
TinderBox: Win-x86@39, Branch:master, Time: 2016-02-11_00:07:38
Locale: fi-FI (fi_FI)

4.3.0.1
Comment 2 raal 2016-02-18 14:25:52 UTC
bibisect-win32-5.0, oldest version contains bug too.
git checkout oldest: Version: 4.5.0.0.alpha0+
Build ID: 57d6b92b69a31260dea0d84fcd1fc5866ada7adb
Comment 3 raal 2016-02-18 21:02:34 UTC
This seems to have begun at the below commit.
Adding Cc: to Miklos Vajna ; Could you possibly take a look at this one?
Thanks

4c13bb774851dcbf148fb625c88a307cde710f55 is the first bad commit
commit 4c13bb774851dcbf148fb625c88a307cde710f55
Author: Matthew Francis <mjay.francis@gmail.com>
Date:   Sat Mar 14 20:55:22 2015 +0800

    source-hash-e2b260fc98e833d4e64426b90992094f2da0498c
    
    commit e2b260fc98e833d4e64426b90992094f2da0498c
    Author:     Miklos Vajna <vmiklos@collabora.co.uk>
    AuthorDate: Tue Jun 3 12:44:37 2014 +0200
    Commit:     Miklos Vajna <vmiklos@collabora.co.uk>
    CommitDate: Tue Jun 3 13:10:36 2014 +0200
    
        sw: let layout not mark embedded object as modified
    
        The problem was that right after the import, the document wasn't marked
        as modified, but as layout settled, it got marked as modified.
    
        Given that we already have code to avoid modification when updating the
        replacement image, do something similar here: when setting the view
        area, make sure the embedded object's component is not marked as
        modified.
    
        Change-Id: I88a42829ec48db54178553661863a571cd2a268b

:040000 040000 42998b78fbd5ea1b21c0ca161f235a2d765b6154 31aca97a24ffd3533d0c299c5fd7109fffb09394 M	opt
Comment 4 Markus Mohrhard 2016-02-24 16:35:45 UTC
Based on the bibisect result this is a pure writer issue.
Comment 5 Commit Notification 2016-03-08 09:03:10 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=078c00e3a3c971ac83154948d5f08462532b9dc6

tdf#97601 sw: don't mark an already modified chart as modified

It will be available in 5.2.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 2016-03-30 12:01:34 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

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

tdf#97601 sw: don't mark an already modified chart as modified

It will be available in 5.1.3.

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 Commit Notification 2016-04-05 06:52:36 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-5-0":

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

tdf#97601 sw: don't mark an already modified chart as modified

It will be available in 5.0.6.

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.