summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wizards/source/sfdocuments/SF_Base.xba25
-rw-r--r--wizards/source/sfdocuments/SF_Form.xba1
2 files changed, 10 insertions, 16 deletions
diff --git a/wizards/source/sfdocuments/SF_Base.xba b/wizards/source/sfdocuments/SF_Base.xba
index e9f9075f4fd7..f0310d0da48a 100644
--- a/wizards/source/sfdocuments/SF_Base.xba
+++ b/wizards/source/sfdocuments/SF_Base.xba
@@ -428,6 +428,7 @@ Public Function OpenFormDocument(Optional ByVal FormDocument As Variant _
Dim bOpen As Boolean ' Return value
Dim vFormNames As Variant ' Array of all document form names present in the document
Dim oContainer As Object ' com.sun.star.awt.XWindow
+Dim oNewForm As Object ' Output of loadComponent()
Const cstThisSub = "SFDocuments.Base.OpenFormDocument"
Const cstSubArgs = "FormDocument, [DesignMode=False]"
@@ -446,22 +447,16 @@ Check:
End If
Try:
- If IsLoaded(FormDocument) Then ' Activate
- Set oContainer = _FormDocuments.getByHierarchicalName(FormDocument).Component.CurrentController.Frame.ContainerWindow
- With oContainer
- If .isVisible() = False Then .setVisible(True)
- .IsMinimized = False
- .setFocus()
- .toFront() ' Force window change in Linux
- Wait 1 ' Bypass desynchro issue in Linux
+ With _Component.CurrentController
+ If Not .IsConnected Then .connect()
+ ' loadComponent activates the form when already loaded
+ Set oNewForm = .loadComponent(com.sun.star.sdb.application.DatabaseObject.FORM, FormDocument, DesignMode)
+ ' When user opened manually the form in design mode and closed it, the next execution in normal mode needs to be confirmed as below
+ With oNewForm.CurrentController
+ If .isFormDesignMode() <> DesignMode Then .setFormDesignMode(DesignMode)
End With
- Else ' Open
- With _Component.CurrentController
- If Not .IsConnected Then .connect()
- .loadComponent(com.sun.star.sdb.application.DatabaseObject.FORM, FormDocument, DesignMode)
- End With
- bOpen = True
- End If
+ End With
+ bOpen = True
Finally:
OpenFormDocument = bOpen
diff --git a/wizards/source/sfdocuments/SF_Form.xba b/wizards/source/sfdocuments/SF_Form.xba
index 197aad194a28..0af834aea4d6 100644
--- a/wizards/source/sfdocuments/SF_Form.xba
+++ b/wizards/source/sfdocuments/SF_Form.xba
@@ -1296,7 +1296,6 @@ Check:
Try:
' At main form termination, all database connections are lost
bAlive = Not IsNull(_Form)
- If bAlive Then bAlive = Not IsNull(_Form.ActiveConnection)
If Not bAlive Then GoTo Catch
Finally: