Bug 151970 - Form - Navigationbar: Unexpected row change when message box appears while changing row of the form
Summary: Form - Navigationbar: Unexpected row change when message box appears while ch...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
7.3.0.3 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-09 07:29 UTC by Robert Großkopf
Modified: 2022-11-11 10:04 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Test 'Form' - 'Next Record': Move mouse over navigation bar after record changed (39.09 KB, application/vnd.oasis.opendocument.database)
2022-11-09 07:29 UTC, Robert Großkopf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2022-11-09 07:29:38 UTC
Created attachment 183490 [details]
Test 'Form' - 'Next Record': Move mouse over navigation bar after record changed

Open the attached database, macros enabled.
Open the form 'Form'.
A message box "Test" appears. It will appear every time and is linked to event 'Before record changed'.
Click on navigation bar 'Next Record'. Message box appears again. Next record will be shown.
Now move the mouse over the navigation bar. Suddenly the message box appears again and navigation bar jumps to next record - but 'Next Record' hasn't been clicked.
Move again - nothing more happens.

Do the same now with 'Previous Record'. 
Behavior is the same:
Message box appears.
Previous record will be shown.
Moving mouse over navigation bar, don't click.
Message box appears.
Previous record will be shown.
Move again - nothing more happens.

This behavior will only appear is a message box is bounded to 'Before record changed'. See 'Form_without_messagebox' - same code, only message box is set as comment. Moving mouse won't change the row now.

Detected on 
Version: 7.4.2.3 / LibreOffice Community
Build ID: 382eef1f22670f7f4118c8c2dd222ec7ad009daf
CPU threads: 6; OS: Linux 5.3; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (de_DE.UTF-8); UI: en-US
Calc: threaded

Will test older versions.
Comment 1 Robert Großkopf 2022-11-09 07:31:58 UTC
Bug also appears with LO 6.4.7.2. Could be a very old bug. See https://bugs.documentfoundation.org/show_bug.cgi?id=91879
Comment 2 Alex Thurgood 2022-11-09 11:38:51 UTC
Confirming with

Version: 7.4.1.2 / LibreOffice Community aarch64 macOS Silicon 
Build ID: 3c58a8f3a960df8bc8fd77b461821e42c061c5f0
CPU threads: 8; OS: Mac OS X 13.0; UI render: default; VCL: osx
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Calc: threaded
Comment 3 jcsanz 2022-11-09 11:55:13 UTC
I can confirm the bug.

I've observed that, in the form "Form", when the button is clicked and the message appears, the button doesn't loss the focus (the background continue colored) and when the mouse over, the focus disappears (and then the record moves), while in the "Form_whitout_messagebos" just clicking the button lost the focus.


Tested with:
--------------------------
Version: 7.4.2.3 (x64) / LibreOffice Community
Build ID: 382eef1f22670f7f4118c8c2dd222ec7ad009daf
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: es-ES
Calc: CL
--------------------------
Versión: 6.4.7.2 (x64)
Id. de compilación: 639b8ac485750d5696d7590a72ef1b496725cfb5
Subprocs. CPU: 4; SO: Windows 10.0 Build 19045; Repres. IU: predet.; VCL: win; 
Configuración regional: es-ES (es_ES); Idioma de IU: es-ES
Calc: CL
Comment 4 Robert Großkopf 2022-11-09 14:17:33 UTC
(In reply to jcsanz from comment #3)
> I can confirm the bug.
> 
> I've observed that, in the form "Form", when the button is clicked and the
> message appears, the button doesn't loss the focus (the background continue
> colored)

Can't see this by a colored background, but if I click, after clicked on "OK", on the background of the form, there won't be happen anything when moving mouse over the navigation bar.

Bug will be a little bit different in older versions of LO:
LO 7.1.5.2: 
Click on navigation bar 'Next Record'. 
Message box appears again. 
Next record will be shown.
Message box appears again. 
Next record will be shown.
→ Message box appears tow times and directly, also moved 2 rows 

This changed with first version of LO 7.3.0.3 to the described behavior with moving mouse over navigation bar and changing to 'Next Record'.

@jcsanz: Please don't change Version of the bug to newer version. It has to be the oldest version. So it will be easier to find the reason for the buggy behavior.
Comment 5 jcsanz 2022-11-09 14:56:31 UTC
(In reply to Robert Großkopf from comment #4)

> 
> @jcsanz: Please don't change Version of the bug to newer version. It has to
> be the oldest version. So it will be easier to find the reason for the buggy
> behavior.

I hadn't changed, but then, the version should be 6.4.7.2, shouldn't it?
If so, can you change it, please
Comment 6 Robert Großkopf 2022-11-09 15:31:08 UTC
(In reply to jcsanz from comment #5)
> (In reply to Robert Großkopf from comment #4)
> 
> I hadn't changed, but then, the version should be 6.4.7.2, shouldn't it?
> If so, can you change it, please

Have a look at "Modified" → History. There is reported your account for changing.

See comment 4: The behavior changed here from LO 7.2.5.2 to LO 7.3.0.3. In earlier versions the message box appears two times here. 
Might be it is different in Window, but it is the buggy behavior, which I could confirm for OpenSUSE 15.3 64bit rpm Linux and VCL:kf5 since LO 7.3.0.3
Comment 7 jcsanz 2022-11-09 16:08:00 UTC
(In reply to Robert Großkopf from comment #6)

> Have a look at "Modified" → History. There is reported your account for
> changing.
So, sorry by that, but I've never realized I'd changed ¡three! different fields
Comment 8 Robert Großkopf 2022-11-11 07:37:47 UTC
Have had a problem similar to this. Could solve it by adding 
Wait 500
in macro.
With

Sub Check_rl_term_context(oEvent AS OBJECT)
	oForm = oEvent.Source
	IF hasUnoInterfaces(oForm, "com.sun.star.form.XForm" ) THEN
		Wait 500
		MsgBox("Test")
	END IF
End Sub

I could move the mouse where ever I want. No next or previous row will appear. 

But the bug is still there: A button, which hasn't been pressed, should never execute anything.
Comment 9 Alex Thurgood 2022-11-11 10:04:38 UTC
It is behaving like a mouse-over event trigger. Definitely a bug,  but where? XListener interface ?