wizards/source/sfdatabases/script.xlb  |    8 ++++----
 wizards/source/sfdocuments/SF_Form.xba |    7 ++++++-
 wizards/source/sfdocuments/script.xlb  |   20 ++++++++++----------
 3 files changed, 20 insertions(+), 15 deletions(-)

New commits:
commit 69087b1c05a005f49f714cdc7be7df89e37458d9
Author:     Jean-Pierre Ledure <j...@ledure.be>
AuthorDate: Mon Jul 14 11:38:07 2025 +0200
Commit:     Jean-Pierre Ledure <j...@ledure.be>
CommitDate: Tue Jul 15 15:04:52 2025 +0200

    ScriptForge (Form) Fix missing attributes
    
    When a FormControl instance is created
    triggered by an event with
       fc = CreateScriptService("FormEvent", event)
    a number of attributes are not
    (re)-initialized in the parent Form instance.
    
    They concern references to the form document
    container and to the database connection.
    
    The absences prevent from scripting easily
    (workarounds exist) operations on the form
    document (close, print, ...) or towards the
    database (read, sql, ...). In particular,
    this limits the reusability of scripts
    across >1 form documents.
    
    This is a bug. It is fixed with the actual change.
    
    Documentation may be left unchanged.
    Basic and Python scripts are impacted alike.
    
    Change-Id: I285148917174d5a046c11b15ea2a2581a23d4277
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187854
    Tested-by: Jenkins
    Reviewed-by: Jean-Pierre Ledure <j...@ledure.be>
    (cherry picked from commit c2a5e575e5b1a317e30365d63f8b396d770e5d57)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187892

diff --git a/wizards/source/sfdatabases/script.xlb 
b/wizards/source/sfdatabases/script.xlb
index 38571cfa0512..8e12f56515d5 100644
--- a/wizards/source/sfdatabases/script.xlb
+++ b/wizards/source/sfdatabases/script.xlb
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 
1.0//EN" "library.dtd">
 <library:library xmlns:library="http://openoffice.org/2000/library"; 
library:name="SFDatabases" library:readonly="false" 
library:passwordprotected="false">
- <library:element library:name="SF_Dataset"/>
- <library:element library:name="SF_Datasheet"/>
- <library:element library:name="SF_Database"/>
- <library:element library:name="__License"/>
  <library:element library:name="SF_Register"/>
+ <library:element library:name="__License"/>
+ <library:element library:name="SF_Database"/>
+ <library:element library:name="SF_Datasheet"/>
+ <library:element library:name="SF_Dataset"/>
 </library:library>
\ No newline at end of file
diff --git a/wizards/source/sfdocuments/SF_Form.xba 
b/wizards/source/sfdocuments/SF_Form.xba
index ef5907a8d723..8a9126d3bc8e 100644
--- a/wizards/source/sfdocuments/SF_Form.xba
+++ b/wizards/source/sfdocuments/SF_Form.xba
@@ -1263,7 +1263,12 @@ Try:
                                        _FormType = ISBASEFORM
                                        &apos;  Make a new SF_FormDocument 
instance
                                        Set [_Parent] = 
ScriptForge.SF_Services.CreateScriptService(&quot;SFDocuments.FormDocument&quot;,
 oParent)
-                                       Set _FormDocument = 
[_Parent]._FormDocument
+                                       With [_Parent]
+                                               Set _FormDocument = 
._FormDocument
+                                               _FormDocumentName = 
._HierarchicalName
+                                               Set _BaseComponent = 
._BaseComponent
+                                               Set _Component = ._Component
+                                       End With
                                ElseIf oParent.Identifier = 
&quot;com.sun.star.text.TextDocument&quot; Then
                                        _FormType = ISDOCFORM
                                        Set [_Parent] = 
ScriptForge.SF_Services.CreateScriptService(&quot;SFDocuments.Document&quot;, 
oParent)
diff --git a/wizards/source/sfdocuments/script.xlb 
b/wizards/source/sfdocuments/script.xlb
index 3d2264bd3f6d..8188fd53bb1f 100644
--- a/wizards/source/sfdocuments/script.xlb
+++ b/wizards/source/sfdocuments/script.xlb
@@ -1,15 +1,15 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 
1.0//EN" "library.dtd">
 <library:library xmlns:library="http://openoffice.org/2000/library"; 
library:name="SFDocuments" library:readonly="false" 
library:passwordprotected="false">
- <library:element library:name="__License"/>
- <library:element library:name="SF_Form"/>
- <library:element library:name="SF_DocumentListener"/>
- <library:element library:name="SF_Document"/>
- <library:element library:name="SF_Calc"/>
- <library:element library:name="SF_Writer"/>
- <library:element library:name="SF_Register"/>
- <library:element library:name="SF_Base"/>
- <library:element library:name="SF_FormControl"/>
- <library:element library:name="SF_FormDocument"/>
  <library:element library:name="SF_Chart"/>
+ <library:element library:name="SF_FormDocument"/>
+ <library:element library:name="SF_FormControl"/>
+ <library:element library:name="SF_Base"/>
+ <library:element library:name="SF_Register"/>
+ <library:element library:name="SF_Writer"/>
+ <library:element library:name="SF_Calc"/>
+ <library:element library:name="SF_Document"/>
+ <library:element library:name="SF_DocumentListener"/>
+ <library:element library:name="SF_Form"/>
+ <library:element library:name="__License"/>
 </library:library>
\ No newline at end of file

Reply via email to