https://bugs.documentfoundation.org/show_bug.cgi?id=147287

Mike Kaganski <mikekagan...@hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |NOTABUG

--- Comment #4 from Mike Kaganski <mikekagan...@hotmail.com> ---
This is not a bug.

The approveRowChange action is configured to call ControleSaisie. The latter
starts with:

> Function ControleSaisie(oEvt As object)
> Dim oForm As Object , oControl As Object 
> 
> 'appellé depuis l'évènement de formulaire ' AVANT enregistrment '
>                       
> If oEvt.Source.ImplementationName <>  
> "org.openoffice.comp.svx.FormController" Then Exit Function
> ...
> ControleSaisie = True

It means that for every oEvt.Source.ImplementationName that is not
"org.openoffice.comp.svx.FormController", it returns a default value. Basic
language defines that for Variant (a default return value type), the default
value is empty, which, when converted to Boolean, gives False.

Pressing "Enregistrer" triggers two calls to ControleSaisie: first with
oEvt.Source.ImplementationName equal to
"org.openoffice.comp.svx.FormController", which returns True (set later in the
function), and then with "com.sun.star.comp.forms.ODatabaseForm". The second
one returns early, exactly in this test. According to language rules, it must
be equal to returning False, which for approveRowChange action is equal to "do
not approve the change".

The "correct" (actually not) behavior in 7.2 was a side effect of the fixed bug
143582, which didn't clear the result of previous call of the function, so the
next time it got executed, without explicit assignment of its value, it
returned not the default value, but the previous result. And based on
*accidental* order of events (first org.openoffice.comp.svx.FormController,
returning True, and then com.sun.star.comp.forms.ODatabaseForm, not defining
the return value and returning not cleared previous result), that happened to
work as user expected.

The correct variant of ControleSaisie should start like this:

> Function ControleSaisie(oEvt As object)
> ControleSaisie = True ' Approve by default
> Dim oForm As Object , oControl As Object 
> 
> 'appellé depuis l'évènement de formulaire ' AVANT enregistrment '
>                       
> If oEvt.Source.ImplementationName <>  
> "org.openoffice.comp.svx.FormController" Then Exit Function
> ...

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to