Bug 111998 - BASIC-Laufzeitfehler. Eigenschaft oder Methode nicht gefunden: isFormDesignMode.
Summary: BASIC-Laufzeitfehler. Eigenschaft oder Methode nicht gefunden: isFormDesignMode.
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
5.3.5.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-24 06:50 UTC by Martin
Modified: 2020-07-20 07:00 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Test database that fails (11.81 KB, application/vnd.sun.xml.base)
2017-08-24 10:30 UTC, Luis
Details
Test database that don't fails (11.82 KB, application/vnd.sun.xml.base)
2017-08-24 10:31 UTC, Luis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin 2017-08-24 06:50:43 UTC
Description:
Wehen I use this code:
 Dim xLayoutManager as Object
' If Design mode, just exit the routine and display standard menu and toolbars'
   xCurrentController = thisComponent.CurrentController
   If xCurrentController.isFormDesignMode Then
       Exit Sub
   End If
I get an error message that the method ".isFormDesignMode" cant be found.
This happens with Version LO 5.3 and 5.4, It works with LO 5.1.6.2 perfectly on Windows 7. 
Also I can say that the same behaviour happens on Linux Mint 18.1.
Can anybody let me know what library is missing this method ?
Thanks Martin

Steps to Reproduce:
1. Install LO Version 5.1.6.2 => this works
2. Install LO Version 5.3 or greater it does not work
3. Important is not to use the same file, always create with the version installed. Call this code with a simple form1 button:
Sub OnOpenDocument()
Dim oController
oController = ThisDatabaseDocument.CurrentController
If not ( oController.isConnected() ) Then oController.connect() ' Connect to the database, if necessary
oController.loadComponent( com.sun.star.sdb.application.DatabaseObject.FORM, _
"Formular1", FALSE ) ' Parameters: ObjectType, Parameter ObjectName, ForEditing

Dim xCurrentController as Object
   Dim xLayoutManager as Object
' If Design mode, just exit the routine and display standard menu and toolbars'
   xCurrentController = thisComponent.CurrentController
   If xCurrentController.isFormDesignMode Then
       Exit Sub
   End If
   xLayoutManager = thisComponent.CurrentController.Frame.LayoutManager
   xLayoutManager.visible = false   
end sub


Actual Results:  
Just install Version 5.3 or 5.4 and create a new form

Expected Results:
I works with Version 5.1.6.2 on both Linux and Window system.


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:55.0) Gecko/20100101 Firefox/55.0
Comment 1 Luis 2017-08-24 09:21:59 UTC
Macro is not correct as ThisComponent is not bound to Form when loaded.

Test that:

Sub OnOpenDocument()
Dim oController

Dim xDoc as object

oController = ThisDatabaseDocument.CurrentController
If not ( oController.isConnected() ) Then oController.connect() ' Connect to the database, if necessary

xDoc=oController.loadComponent( com.sun.star.sdb.application.DatabaseObject.FORM, _
"Formular1", FALSE ) ' Parameters: ObjectType, Parameter ObjectName, ForEditing

Dim xCurrentController as Object
   Dim xLayoutManager as Object
' If Design mode, just exit the routine and display standard menu and toolbars'
   xCurrentController = xDoc.CurrentController
   If xCurrentController.isFormDesignMode Then
       Exit Sub
   End If
   xLayoutManager = thisComponent.CurrentController.Frame.LayoutManager
   xLayoutManager.visible = false   
end sub
Comment 2 Luis 2017-08-24 10:30:01 UTC
Maybe in LO versions < 5.3 ThisComponent is bound to Form after loading with function loadComponent() and behaviour has changed.

I have attacched two test files:

Test database bad.odb has bad macro and fails with LO version 5.3.2.2

Test database good.odb has changed macro and don't fails with LO version 5.3.2.2
Comment 3 Luis 2017-08-24 10:30:47 UTC
Created attachment 135760 [details]
Test database that fails
Comment 4 Luis 2017-08-24 10:31:57 UTC
Created attachment 135761 [details]
Test database that don't fails
Comment 5 Alex Thurgood 2017-08-25 06:40:26 UTC
Unfortunately, none of the forms will open for me when testing with 

Version: 5.4.0.3
Build ID: 7556cbc6811c9d992f4064ab9287069087d7f62c
CPU threads: 4; OS: Mac OS X 10.12.6; UI render: default; 
Locale: fr-FR (fr_FR.UTF-8); Calc: group

so I can't even see if there is an error here.
Comment 6 Alex Thurgood 2017-08-25 06:44:09 UTC
OK, so it turns out that the form window is hidden, doesn't receive the focus and only gets drawn when I close the main ODB window - this is a separate problem to the one being explored here, but exacerbated by it I guess.
Comment 7 Alex Thurgood 2017-08-25 07:06:57 UTC
(In reply to Alex Thurgood from comment #6)
> OK, so it turns out that the form window is hidden, doesn't receive the
> focus and only gets drawn when I close the main ODB window - this is a
> separate problem to the one being explored here, but exacerbated by it I
> guess.

Indeed, the behaviour I describe is bug 95191
Comment 8 Luis 2017-08-25 10:24:14 UTC
Tested with LO 4.4.7.2 and  5.1.6.2 and 5.3.2.2
The behaviour is the same in all versions:

When the macro OnOpenDocument is called from the main window of base ThisComponent is bound to the database document and this variable is not changed after call to loadComponent. The controller of this document has no method isFormDesignMode.

If then form is opened and the macro is called from the form window then ThisComponent is bound to the form document and the controller has method isFormDesignMode.

Changed status.
Comment 9 violetero 2020-07-20 07:00:52 UTC
Bugzilla fixes the bug that appears during some extensions that have been applied by developers using certain types of code every time differently. The basic function is to create a crash report of bug https://bestwritingservicecanada.com/papersowl-canada-review/ which describes the speciality or importance of that report.