Description: It is impossible to assign macro to an autotext. Steps to Reproduce: 1.Write a macro in Standard Library like Sub PrintBefore Print "Before" End Sub 2. Write and Select "Toto" in Writer. 3. Type Ctrl+F3 to create an autotext witch return "Toto" when you type to + F3 4. Try to assign the PrintBefore macro to. Actual Results: If I type to+F3, I get only "Toto" Expected Results: First run the macro (Print "Before") and then get "Toto" Reproducible: Always User Profile Reset: No Additional Info: It works fine with LO 6.2.4.2 and OpenOffice, but same problem with LO 7.3 So it's a regression.
Confirm with dev version. Seems to be a problem in Assign macro dialog - assignment is not saved.
Bisected to eba51f6eb336ff271fbade0e5fe108c8cb525f8c is the first bad commit commit eba51f6eb336ff271fbade0e5fe108c8cb525f8c Author: Jenkins Build User <tdf@pollux.tdf> Date: Sat Dec 18 07:03:33 2021 +0100 source 1addd8c104f6ad390bdd0ca61cd5ce97b55ce218 https://git.libreoffice.org/core/+/1addd8c104f6ad390bdd0ca61cd5ce97b55ce218 Noel, Justin, is the bisect relevant? Thank you
Please detail more clearly exactly how you are getting the macro to run? I tried in 6.3 and get nothing. I did: -type "Toto" in writer. Select it, and press Ctrl-F3 -select MyAutoText category, enter a name (jl) and a shortcut (jl) -select AutoText - New dropdown. -select MyAutoText - jl -select AutoText - Macro... - My Macros - Standard - Modules1 - Main -select AutoText - replace -Tools - Macros - Edit and put msgbox "hello" in Sub Main - in Writer, type jl <F3> I get the autotext (Toto), but no macro running. So what am I doing wrong in trying to assign the macro? How can you tell if there is a macro assigned?
Oh - I kept missing the "assign" button. I found it now.
I confirmed with bibisect 7.2 that you got the right commit. It doesn't make much sense though since it is just a revert. And yet all these are autotext related commits, so somehow the macro bits must have adapted to the change made in 7.0. (I bibisected around the change made in 7.0, and it was working before Noel's commit too - so it wasn't something he "fixed".)
If we look at Noel's https://gerrit.libreoffice.org/c/core/+/86477, we can see in the relation chain that there is also "convert XMLAutoTextEventImport to FastParser APIs" which is the next commit made. I tried to compile LO 7.0 at this commit, but had general compile errors (although I was able to compile last70onmaster). So I couldn't confirm that this is the dependent change, but it is quite likely. I attempted to revert b8f932e1df1efb230230ab1f1b9c8cfc822a0f4c also, but it is not trivial to do, and I don't understand this code, so I didn't spend much time on it. Likely the best thing to do is to revert my revert and find a proper fix for bug 144364. (I see an exception when running my unit test, so that is probably a good place to start for fixing that bug. make CppunitTest_sw_uiwriter8 CPPUNIT_TEST_NAME=testTdf144364)
fix is here: https://gerrit.libreoffice.org/c/core/+/147399
Noel Grandin committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/4d020dfe1439e963f0b2367ba984c2eb6eb153a5 tdf#153728 Can't assign macro to autotext It will be available in 7.6.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Thanks for your work. The patch will not be pushed in LO 7.5.1 ? Best regards.
Hello, I tried with LO Dev 7.6 : it works fine. Thanks. Why not in LO 7.5.1 ?