Bug 94856 - createStatusIndicator() not functioning correctly (Python)
Summary: createStatusIndicator() not functioning correctly (Python)
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
5.0.2.2 release
Hardware: x86 (IA32) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
: 99403 (view as bug list)
Depends on:
Blocks: RenderContext
  Show dependency treegraph
 
Reported: 2015-10-07 11:44 UTC by kiloran.public+bugzilla
Modified: 2019-05-30 09:48 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Demo of problem with status bar using Python on LO 5.0 (17.74 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-10-10 10:01 UTC, kiloran.public+bugzilla
Details
Demo of workaround (19.25 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-11-02 10:24 UTC, kiloran.public+bugzilla
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kiloran.public+bugzilla 2015-10-07 11:44:38 UTC
I have some Python scripts which make use of the status bar. The scripts work correctly in all versions of OpenOffice, and LibreOffice prior to 5.0. With version 5.0, it no longer works correctly.

A python script to demonstrate this problem follows. This should set the status indicator to 20%, pause for 2s, set the status indicator to 70%, pause 2s, and then reset the status bar back to normal.

=======================================================

import time
	
def test1():	
	oDoc = XSCRIPTCONTEXT.getDocument()

	Controller = oDoc.getCurrentController()
	DocFrame = Controller.getFrame()
	oStatusIndicator = DocFrame.createStatusIndicator() 
	oStatusIndicator.start( "Test", 10 )	# establish label, and maximum value of 10
	oStatusIndicator.setValue(2)			# set status to 20%
	
	time.sleep(2)							# wait 2 seconds
	oStatusIndicator.setValue(7)			# set status to 70%
	
	time.sleep(2)
	
	# reset the status bar back to normal
	oStatusIndicator.reset()
	oLayout = oDoc.getCurrentController().getFrame().LayoutManager
	StatusURL = "private:resource/statusbar/statusbar"
	oLayout.destroyElement(StatusURL)
	oLayout.createElement(StatusURL)
Comment 1 kiloran.public+bugzilla 2015-10-10 10:01:27 UTC
Created attachment 119478 [details]
Demo of problem with status bar using Python on LO 5.0

The attachment StatusBarProblem.ods contains a Basic script and a Python script which should do the same thing, setting the status bar to 20%, 50% and 100% at 2 second intervals, followed by a reset.
The Python script shows 0% when it should show 20%, 20% when it should show 50%, and the 100% displays only for a brief fraction of a second, when using LibreOffice 5.0.
The scripts work perfectly on all versions of OpenOffice, and versions of LibreOffice prior to 5.0
Comment 2 kiloran.public+bugzilla 2015-10-10 10:02:05 UTC
Attachment added 10Oct15 to demonstrate the problem
Comment 3 raal 2015-10-10 20:42:08 UTC
I can confirm with Version: 5.1.0.0.alpha1+
Build ID: 8273350ff48f198efc9dc9c5de5519b8cbdc0cb3
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2015-10-07_05:54:26

Works correct in 4.4.2.2, regression.
Comment 4 kiloran.public+bugzilla 2015-11-02 10:24:13 UTC
Created attachment 120200 [details]
Demo of workaround

File StatusBarProblem_1.ods shows a workaround using threading
Comment 5 kiloran.public+bugzilla 2015-11-02 10:26:35 UTC
I've added a new attachment StatusBarProblem_1.ods which shows a workaround. It uses threading to run the status bar with a new version of the desktop. This appears to work with all versions of LibreOffice and OpenOffice
Comment 6 raal 2015-11-11 06:17:37 UTC
This seems to have begun at the below commit.
Adding Cc: to Tomaž Vajngerl ; Could you possibly take a look at this one?
Thanks
 0ce133b8275531dbf0c15a34f09e525567a142b2 is the first bad commit
commit 0ce133b8275531dbf0c15a34f09e525567a142b2
Author: Norbert Thiebaud <nthiebaud@gmail.com>
Date:   Thu Jun 4 02:49:21 2015 -0500
    source 56a45fcfd0a881a31f94aa102fe5f03af32a00e1
    source 56a45fcfd0a881a31f94aa102fe5f03af32a00e1
	
	author	Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>	2015-05-07 08:08:54 (GMT)
committer	Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>	2015-05-11 01:03:28 (GMT)
commit 56a45fcfd0a881a31f94aa102fe5f03af32a00e1 (patch)
refactor StatusBar to use RenderContex

/bibisect-win32-5.0
$ git bisect log
# bad: [575cd25f0560684895018d8fcfb1818dd4dd1c9b] source ab465b90f6c6da5595393a0ba73f33a1e71a2b65
# good: [f449493ae11ac76cc7396bddeaa624a60c565936] source 57d6b92b69a31260dea0d84fcd1fc5866ada7adb
git bisect start 'libreoffice-5-0-branch-point' 'oldest'
# good: [da12357c491a0dce5acc0bd1f00c26f89d8f20e6] source c1b9402d49a7cd4bec383f28d397d9d89541f0e0
git bisect good da12357c491a0dce5acc0bd1f00c26f89d8f20e6
# good: [da12357c491a0dce5acc0bd1f00c26f89d8f20e6] source c1b9402d49a7cd4bec383f28d397d9d89541f0e0
git bisect good da12357c491a0dce5acc0bd1f00c26f89d8f20e6
# good: [2783cac5d1f18f44ce31f52eb7ae2f0ea17d0c96] source 5d7a203bdae1940e4846c4c42f5d733e4ffa4160
git bisect good 2783cac5d1f18f44ce31f52eb7ae2f0ea17d0c96
# good: [2783cac5d1f18f44ce31f52eb7ae2f0ea17d0c96] source 5d7a203bdae1940e4846c4c42f5d733e4ffa4160
git bisect good 2783cac5d1f18f44ce31f52eb7ae2f0ea17d0c96
# good: [c6b55917df3df447007dbb29dd84f24d1203cfb3] source 5b8acf459e4a6728ea656e7abd5dfb08ad2ae345
git bisect good c6b55917df3df447007dbb29dd84f24d1203cfb3
# good: [c6b55917df3df447007dbb29dd84f24d1203cfb3] source 5b8acf459e4a6728ea656e7abd5dfb08ad2ae345
git bisect good c6b55917df3df447007dbb29dd84f24d1203cfb3
# bad: [ac46cb21db25e4b49f28bbe57f5846dbca57e486] source dbf1e124c7fef7cae5392959ab6a697a3a89c609
git bisect bad ac46cb21db25e4b49f28bbe57f5846dbca57e486
# bad: [ac46cb21db25e4b49f28bbe57f5846dbca57e486] source dbf1e124c7fef7cae5392959ab6a697a3a89c609
git bisect bad ac46cb21db25e4b49f28bbe57f5846dbca57e486
# good: [d6a38c4ea76c2485cebb84f4414de2cac1862ced] source a6b9d9a19fb8c5c9f166682f52941aee25b89c94
git bisect good d6a38c4ea76c2485cebb84f4414de2cac1862ced
# good: [d6a38c4ea76c2485cebb84f4414de2cac1862ced] source a6b9d9a19fb8c5c9f166682f52941aee25b89c94
git bisect good d6a38c4ea76c2485cebb84f4414de2cac1862ced
# good: [b1fd1d1e65c90294913a258c6d091495c2272eb0] source 442701de0c110ca58ff41abe6bf7ec4496f8457d
git bisect good b1fd1d1e65c90294913a258c6d091495c2272eb0
# bad: [4a163fabd00ad1cbe4d6f162cdae81cc4c62db5c] source 279c665ac1ecb60cb1450691ce3449590041b307
git bisect bad 4a163fabd00ad1cbe4d6f162cdae81cc4c62db5c
# good: [f034a9cabb336313256e379796ae69c61b5ac886] source 336bc33a5a46e89ea35cefa75997edde2363c8fc
git bisect good f034a9cabb336313256e379796ae69c61b5ac886
# good: [3d5c1633f6b1cc733da91fda4afa564fe08ab8ad] source 4f864949a9484bbf21911859398743bfe2b1430f
git bisect good 3d5c1633f6b1cc733da91fda4afa564fe08ab8ad
# good: [f57b3209ad8792df0e1bc09016e7f7bc4563f2ba] source cba2ced9cf5e72bf596915ddf5e951e0c9ddb356
git bisect good f57b3209ad8792df0e1bc09016e7f7bc4563f2ba
# bad: [93450dea9f2a6ef9742195fff3621f8ea11945d0] source bebe347c53dcc3b86eefb29af1a1a57d982274d6
git bisect bad 93450dea9f2a6ef9742195fff3621f8ea11945d0
# bad: [d6b65e7c473413609f9aeafe5e9b38e63687ddd2] source 9ae37b8e018bf690016287db805953df8119124e
git bisect bad d6b65e7c473413609f9aeafe5e9b38e63687ddd2
# bad: [0ce133b8275531dbf0c15a34f09e525567a142b2] source 56a45fcfd0a881a31f94aa102fe5f03af32a00e1
git bisect bad 0ce133b8275531dbf0c15a34f09e525567a142b2
# first bad commit: [0ce133b8275531dbf0c15a34f09e525567a142b2] source 56a45fcfd0a881a31f94aa102fe5f03af32a00e1
Comment 7 Robinson Tryon (qubit) 2015-12-13 11:14:24 UTC Comment hidden (obsolete)
Comment 8 Buovjaga 2018-05-22 17:39:14 UTC
*** Bug 99403 has been marked as a duplicate of this bug. ***
Comment 9 QA Administrators 2019-05-23 02:50:09 UTC Comment hidden (obsolete)
Comment 10 kiloran.public+bugzilla 2019-05-30 09:48:38 UTC
Bug is no longer present using LibreOffice 6.2.4.2

Version: 6.2.4.2 (x64)
Build ID: 2412653d852ce75f65fbfa83fb7e7b669a126d64
CPU threads: 8; OS: Windows 10.0; UI render: default; VCL: win; 
Locale: en-GB (en_GB); UI-Language: en-GB
Calc: CL