Bug 86199 - Inserted macro in Writer is not evaluated
Summary: Inserted macro in Writer is not evaluated
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
4.3.0.0.alpha1
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Macro-UI
  Show dependency treegraph
 
Reported: 2014-11-12 14:11 UTC by Jez
Modified: 2019-10-07 12:53 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example macro to reproduce behaviour (444 bytes, text/plain)
2014-11-12 14:11 UTC, Jez
Details
test file (9.40 KB, application/vnd.oasis.opendocument.text)
2014-11-19 22:16 UTC, raal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jez 2014-11-12 14:11:54 UTC
Created attachment 109339 [details]
Example macro to reproduce behaviour

See attachment for example macro to reproduce this behaviour.

When you try to insert a conditional text field through a LibreOffice basic macro, it isn't evaluated the first time you do it (just after starting LibreOffice Writer) - although the second and subsequent times the macro is run, all the fields are evaluated.

The field should be evaluated the first time the macro is run, instead of just staying blank.
Comment 1 Buovjaga 2014-11-16 19:47:06 UTC
For me, it is inserting "My true text" the first time and no matter how many times I run it.
What LibO version and OS are you running?
Set to NEEDINFO.
Change back to UNCONFIRMED after you have provided the information.

Win 7 64-bit Version: 4.4.0.0.alpha2+
Build ID: b021b5983c62e266b82d9f0c5c6d8d8900553827
TinderBox: Win-x86@39, Branch:master, Time: 2014-11-12_01:10:08
Comment 2 Jez 2014-11-16 20:33:19 UTC
I'm using Windows 7 64 bit, and this version of LibreOffice Writer:

Version: 4.3.3.2
Build ID: 9bb7eadab57b6755b1265afa86e04bf45fbfc644

Would this rather bizarre bug have been fixed in the recent alpha?
Comment 3 Buovjaga 2014-11-17 07:35:57 UTC
(In reply to Jez from comment #2)
> I'm using Windows 7 64 bit, and this version of LibreOffice Writer:
> 
> Version: 4.3.3.2
> Build ID: 9bb7eadab57b6755b1265afa86e04bf45fbfc644
> 
> Would this rather bizarre bug have been fixed in the recent alpha?

You can test by installing an alpha build alongside your stable:
http://dev-builds.libreoffice.org/daily/master/Win-x86@39/2014-11-12_01.10.08/

It installs to a different folder and doesn't mess with your stable install. Please report your findings here.
Comment 4 Jez 2014-11-17 15:02:36 UTC
OK I tried it in LibreOfficeDev Writer:

Version: 4.4.0.0.alpha2+
Build ID: b021b5983c62e266b82d9f0c5c6d8d8900553827
TinderBox: Win-x86@39, Branch:master, Time: 2014-11-12_01:10:08

I get exactly the same behaviour.  The inserted field does not show any text until I run the macro again, and then both the inserted fields are evaluated and show text.
Comment 5 Buovjaga 2014-11-17 15:11:39 UTC
Thanks for testing, let's set back to unconfirmed then and wait for other testers.
Comment 6 raal 2014-11-19 22:16:07 UTC
I can confirm with Version: 4.4.0.0.alpha2+
Build ID: 2f342c61616418c6ad7303d7f5efa27a28378681
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2014-11-16_00:33:40

I can reproduce with Version: 4.3.0.0.alpha1+
Build ID: c15927f20d4727c3b8de68497b6949e72f9e6e9e, setting older version
Comment 7 raal 2014-11-19 22:16:27 UTC
Created attachment 109743 [details]
test file
Comment 8 Buovjaga 2014-11-20 06:07:32 UTC
(In reply to raal from comment #7)
> Created attachment 109743 [details]
> test file

Hmh, with this file I could repro.

Win 7 64-bit Version: 4.4.0.0.alpha2+
Build ID: b021b5983c62e266b82d9f0c5c6d8d8900553827
TinderBox: Win-x86@39, Branch:master, Time: 2014-11-12_01:10:08
Comment 9 Oliver Specht (CIB) 2015-12-18 08:19:09 UTC
To update fields you should call
 doc.textfields.refresh
Comment 10 Jez 2015-12-18 11:03:49 UTC
(In reply to Oliver Specht from comment #9)
> To update fields you should call
>  doc.textfields.refresh

I can confirm that this does indeed work.  Don't think it's a fix for this bug, but it is a workaround...
Comment 11 QA Administrators 2017-01-03 19:47:25 UTC Comment hidden (obsolete)
Comment 12 Buovjaga 2019-08-11 11:33:10 UTC
(In reply to raal from comment #7)
> Created attachment 109743 [details]
> test file

Still confirmed

Arch Linux 64-bit
Version: 6.4.0.0.alpha0+
Build ID: 37fc9f51a8de11d40632e8cda17ccf1fa4b1f503
CPU threads: 8; OS: Linux 5.2; UI render: default; VCL: gtk3; 
Locale: fi-FI (fi_FI.UTF-8); UI-Language: en-US
Calc: threaded
Built on 6 August 2019