ScriptForge - fix tdf#156836 Abort on MoveFirst()

The incident occurs when a move (last(),
first(), next()) within the form's resultset
is done from a Basic script immediately
after the opening of the document
containing the form.

The insertion of a
    Wait 1
statement prevents the occurrence of
the incident by interrupting very shortly
the Basic process.

Change-Id: I5e798db6e3f9ffaeeef38fb9badd008cbb190d1f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155897
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
(cherry picked from commit f1412705bed9faad3d9a4e36e7dcea9eb3cb98d0)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155912
diff --git a/wizards/source/sfdatabases/SF_Database.xba b/wizards/source/sfdatabases/SF_Database.xba
index f93cf55..109d4c5 100644
--- a/wizards/source/sfdatabases/SF_Database.xba
+++ b/wizards/source/sfdatabases/SF_Database.xba
@@ -455,6 +455,9 @@ Try:

	Set oOpen = ScriptForge.SF_Services.CreateScriptService(&quot;SFDocuments.FormDocument&quot;, oNewForm)

	&apos;	Prevent desynchonization when using .last(), .next() etc immediately after component loading. Bug #156836
	Wait 1

Finally:
	Set OpenFormDocument = oOpen
	ScriptForge.SF_Utils._ExitFunction(cstThisSub)
diff --git a/wizards/source/sfdocuments/SF_Base.xba b/wizards/source/sfdocuments/SF_Base.xba
index cc5ab48..5c8c909 100644
--- a/wizards/source/sfdocuments/SF_Base.xba
+++ b/wizards/source/sfdocuments/SF_Base.xba
@@ -505,6 +505,9 @@ Try:

	Set oOpen = ScriptForge.SF_Services.CreateScriptService(&quot;SFDocuments.FormDocument&quot;, oNewForm)

	&apos;	Prevent desynchonization when using .last(), .next() etc immediately after component loading. Bug #156836
	Wait 1

Finally:
	Set OpenFormDocument = oOpen
	ScriptForge.SF_Utils._ExitFunction(cstThisSub)