Description: When writing macros in LO Basic, the method thisComponent.getCurrentController.getViewCursor.goUp() used to return false when it reached the top of the document. Now it always returns true, which makes it impossible to use its return value to detect when you get to the start of the document. In effect, it breaks macros that used to work in LO 6.4. Steps to Reproduce: 1. open the attached file with macros enabled 2. go to the macro editor and run the main macro 3. watch what happens Actual Results: the loop never ends Expected Results: the loop should end once the cursor gets to the top of the document Reproducible: Always User Profile Reset: Yes Additional Info: The macro in the attachment looks like this: Sub Main Dim canMove Dim oCurs Dim oDoc oDoc = ThisComponent oCur = oDoc.getCurrentController.getViewCursor() canMove = oCur.goUp(1,false) While canMove canMove = oCur.goUp(1,false) Wend End Sub
Created attachment 159438 [details] document with a macro that shows the bug
reproducible with: Version: 7.0.0.0.alpha0+ (x64) Build ID: 5fb793d9d3d6f7bbeb16eb2857ee396405d94b6d CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win; Locale: de-DE (de_DE); UI-Language: en-US Calc: threaded but *not* reproducible with: Version: 6.4.3.2 (x64) Build-ID: 747b5d0ebf89f41c860ec2a39efd7cb15b54f2d8 CPU-Threads: 4; BS: Windows 10.0 Build 18363; UI-Render: Standard; VCL: win; Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE Calc:
This seems to have begun at the below commit. Adding Cc: to Canberk TURAN ; Could you possibly take a look at this one? Thanks 0d58aebadfc69bc1037865a6a61968edf8a90da4 is the first bad commit commit 0d58aebadfc69bc1037865a6a61968edf8a90da4 Author: Jenkins Build User <tdf@pollux.tdf> Date: Thu Feb 27 08:25:31 2020 +0100 source 0aa0fda64057647219954480ac1bab86b0f0e433 author Canberk TURAN <canberkkturann@gmail.com> 2020-02-25 23:55:50 +0300 committer Gülşah Köse <gulsah.kose@collabora.com> 2020-02-27 08:06:16 +0100 commit 0aa0fda64057647219954480ac1bab86b0f0e433 (patch) tree eaadcfc57045b5021d9ca18e1c6a4aaad7590b08 parent b11293297e581b87fba7e995d350ba59ecb820f2 (diff) tdf#81226: Cursor jumping fixed
I'd hate this bug to stay in the official 7.0. Could someone raise its importance to major or critical, please? I mean, it's probably going to break all macros that move the cursor between lines, which I think is pretty serious.
Ok, I'm gonna take a look. It looks like my bad. bRet variable must be set false before return when the cursor reachs to start or end of the document. Thanks for your warning. I'll send a patch today.
Canberk TURAN committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/1e5cf1b3ebf39aee01ed2a3bfd5be7ee6f44d18e tdf#131990 MACROS: fixes return value of UpDown Method It will be available in 7.1.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.
Verified in Version: 7.1.0.0.alpha0+ Build ID: 8bbd8324282e7890de29ede5912d24c6e1c7ce7f CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US Calc: @0Canberk TURAN, thanks for fixing this issue!. Should this issue be closed as RESOLVED FIXED ?
Yes, I tested that macro after patch. Everything looks like expected.
Canberk TURAN committed a patch related to this issue. It has been pushed to "libreoffice-7-0": https://git.libreoffice.org/core/commit/402f36efb215338ad545caa65d39fb8a39685ea1 tdf#131990 MACROS: fixes return value of UpDown Method It will be available in 7.0.0.1. 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.
I tested it in 1.0 beta 1 and it works. Thank you!
(In reply to Eltomito from comment #10) > I tested it in 1.0 beta 1 and it works. Thank you! Obviously, I meant 7.0 beta 1 :)
Xisco Fauli committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/61d07657caab5e0fb8ec4446f67a7044e14dae4b tdf#131990: sw_uiwriter: Add unittest It will be available in 7.2.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.