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
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
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
Created attachment 135760 [details] Test database that fails
Created attachment 135761 [details] Test database that don't fails
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.
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.
(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
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.
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.