Bug 87123 - Impossible to create a form with wizard
Summary: Impossible to create a form with wizard
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
4.5.0.0.alpha0+ Master
Hardware: x86-64 (AMD64) All
: highest blocker
Assignee: Julien Nabet
URL:
Whiteboard: target:4.5.0
Keywords: bibisectRequest, regression
: 87899 (view as bug list)
Depends on:
Blocks: 85002 mab5.0
  Show dependency treegraph
 
Reported: 2014-12-08 22:00 UTC by Julien Nabet
Modified: 2015-12-17 08:41 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Nabet 2014-12-08 22:00:10 UTC
On pc Debian x86-64 with master sources updated today (commit b45e1b58700c8303596a0aac9705d8c1577903b3), I can't create a form with wizard.

Steps to reproduce:
 - open attachment 87880 [details]
 - in left pane, click on "Forms"
 - in upper right pane, click on "Use Wizard to Create Form"
 - click on ">>"
 - click on finish

=> Writer opens but then close before displaying any form
Comment 1 Joel Madero 2014-12-12 05:59:38 UTC
Ubuntu 14.04 x64
LibreOffice 4.5 Build ID: 8b65be4740f4349b769a8709867e0cc32d93686d
LibreOffice 4.3.4.1 release

Confirmed:
New
Major - major functionality broken
High - default

Regression (works on 4.3.4.1)

Would be nice to know if 4.4 is broken as well.
Comment 2 Robert Großkopf 2014-12-14 10:45:19 UTC
I have tested this with 
Version: 4.5.0.0.alpha0+
Build ID: f92183833fa569006602ac7e93c906d2094e0d4d
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2014-12-13_23:36:38
Locale: de_DE

The follwing happend:
I coudl go through all steps of the wizard and wanted to save the form, but nothing to see in the database. Then I closed the database and saw the designed form on the LO-desktop. It has been saved in the /tmp-folder. I opend this form and saw the data of my database. So I switched set the design-mode on and had a look at the properties of this form. The data-source of the form was defined as file:///home/.../.../myfile.odb
So the wizard had created an external form for the database and saved this in the systems temporary folder.

Then I tried the wizard in 
Version: 4.4.0.0.beta1+
Build ID: a15a538fb191b1851f366716914822411b583c58
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:libreoffice-4-4, Time: 2014-12-03_06:05:11
Locale: de_DE
The form will be created by the wizard inside the database, but without setting the styles for the form (a new bug ...).
Comment 3 Julien Nabet 2014-12-14 11:05:41 UTC
Robert: thank you for your interesting detailed feedback.

Lionel: one for you?
Comment 4 Lionel Elie Mamane 2014-12-29 08:01:04 UTC
Didn't I fix this one with my recent forms wizard work?
Comment 5 Robert Großkopf 2014-12-29 08:36:36 UTC
(In reply to Lionel Elie Mamane from comment #4)
> Didn't I fix this one with my recent forms wizard work?

Have tested with Version: 4.5.0.0.alpha0+
Build ID: 0c24686c3970bac7e9a4e214fccfdfffd742149e
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2014-12-29_05:28:52
Locale: de_DE

The form is created as an external form in the temporary folder with LO 4.5 at this moment.
Comment 6 Julien Nabet 2014-12-31 11:05:22 UTC
*** Bug 87899 has been marked as a duplicate of this bug. ***
Comment 7 Alex Thurgood 2014-12-31 11:12:32 UTC
Still present in master with my osx build of today, which is why I just filed the duplicate that Julien correctly spotted.
Comment 8 Julien Nabet 2014-12-31 11:13:27 UTC
Reproduced by Alex too who uses MacOs (see fdo#87899).
So blocker here.
Comment 9 Alex Thurgood 2014-12-31 11:14:51 UTC
The funny thing is that the form appears in the document preview of the start center
Comment 10 Alex Thurgood 2014-12-31 11:43:35 UTC
The form created also lacks a tuple navigation toolbar, similar to bug 85002 - normal ?
Comment 11 Julien Nabet 2015-01-02 08:57:55 UTC
Noel: thought you might be interested in this one, since form query wizard is managed by files located here:
wizards/com/sun/star/wizards/form
Comment 12 Julien Nabet 2015-01-02 10:50:10 UTC
I noticed that if we comment this block
    464             // add a window listener, to know
    465             // if the user used "escape" key to
    466             // close the dialog.
    467             xWindow.addWindowListener(new XWindowListenerAdapter() {
    468                 @Override
    469                 public void windowHidden(EventObject event) {
    470                     cancelWizard_1();
    471                 }   
    472             });

(see http://opengrok.libreoffice.org/xref/core/wizards/com/sun/star/wizards/ui/WizardDialog.java#464)
it seems ok.
Comment 13 Julien Nabet 2015-01-02 11:46:28 UTC
(In reply to Julien Nabet from comment #12)
> I noticed that if we comment this block
>     464             // add a window listener, to know
>     465             // if the user used "escape" key to
>     466             // close the dialog.
>     467             xWindow.addWindowListener(new XWindowListenerAdapter() {
>     468                 @Override
>     469                 public void windowHidden(EventObject event) {
>     470                     cancelWizard_1();
>     471                 }   
>     472             });
> 
> (see
> http://opengrok.libreoffice.org/xref/core/wizards/com/sun/star/wizards/ui/
> WizardDialog.java#464)
> it seems ok.

This specific part comes from:
http://cgit.freedesktop.org/libreoffice/core/commit/?id=74c6c6151cab078a6e31c66819c0609ef9637e6e
Noel: any thoughts?
Comment 14 Noel Grandin 2015-01-02 12:00:00 UTC
The original block of code looked like this before my changes:

MethodInvocation windowHidden = new MethodInvocation("windowHidden", this);
xWindow.addWindowListener((CommonListener) getGuiEventListener());
String dialogName = (String) Helper.getUnoPropertyValue(xDialogModel, PropertyNames.PROPERTY_NAME);
getGuiEventListener().add(dialogName, EVENT_ACTION_PERFORMED, windowHidden);

which is clearly bogus, since "actionPerformed" is not an event on the XWindowListener interface.

So I agree with Julien that this block can just be deleted.

If he hasn't gotten to it by next week, I'll take care of it.
Comment 15 Julien Nabet 2015-01-02 12:15:01 UTC
Thank you Noel for your feedback.
I wanted to compare with Table wizard but it fails to open with this console log:
warn:legacy.osl:15896:1:dbaccess/source/ui/misc/linkeddocuments.cxx:208: caught an exception!
in function:void dbaui::OLinkedDocumentsAccess::impl_newWithPilot(const char*, sal_Int32, const rtl::OUString&)
type: com.sun.star.uno.RuntimeException
message: there is no member variable: Command
java stack trace:
com.sun.star.uno.RuntimeException: there is no member variable: Command
	at com.sun.star.lib.uno.helper.PropertySet.registerProperty(PropertySet.java:170)
	at com.sun.star.lib.uno.helper.PropertySet.registerProperty(PropertySet.java:192)
	at com.sun.star.wizards.table.CallTableWizard$TableWizardImplementation.<init>(CallTableWizard.java:66)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
	at com.sun.star.comp.loader.FactoryHelper$Factory.createInstanceWithArgumentsAndContext(Factory...
 :-(
Comment 16 Commit Notification 2015-01-02 12:48:18 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c7531408b3ef4b2d284edf35ed983c23e7585231

Resolves fdo#87123: Impossible to create a form with wizard

It will be available in 4.5.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 17 Julien Nabet 2015-01-02 12:49:32 UTC
Thank you Noel.

Now let's take a look to the Table creation wizard :-)
Comment 18 Noel Grandin 2015-01-02 12:55:50 UTC
CallTableWizard and CallQueryWizard both need a couple of lines added back that I deleted by accident.

CallTableWizard needs this:

    public static class TableWizardImplementation extends com.sun.star.lib.uno.helper.PropertySet implements com.sun.star.lang.XInitialization, com.sun.star.lang.XServiceInfo, com.sun.star.task.XJobExecutor
    {
        private PropertyValue[] m_wizardContext;
        // the next two fields are accessed by reflection, do not delete!
        public String           Command;
        public final Integer    CommandType = com.sun.star.sdb.CommandType.TABLE;


CallQueryWizard needs this:

    public static class QueryWizardImplementation extends com.sun.star.lib.uno.helper.PropertySet implements com.sun.star.lang.XInitialization, com.sun.star.lang.XServiceInfo, com.sun.star.task.XJobExecutor
    {
        private PropertyValue[] m_wizardContext;
        // the next two fields are accessed by reflection, do not delete!
        public String           Command;
        public final Integer    CommandType = com.sun.star.sdb.CommandType.QUERY;
Comment 19 Commit Notification 2015-01-02 17:41:37 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f3edc18b4006b712725cbe530f064798607b2beb

Following fdo#87123: Impossible to create table or query with wizard

It will be available in 4.5.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 20 Julien Nabet 2015-01-02 17:42:36 UTC
(In reply to Noel Grandin from comment #18)
> CallTableWizard and CallQueryWizard both need a couple of lines added back
> that I deleted by accident.
> 
> CallTableWizard needs this:
>... 
> CallQueryWizard needs this:
> 
>...
Thank you Noel, fix pushed on master now!
Comment 21 Robinson Tryon (qubit) 2015-12-17 08:41:29 UTC
Migrating Whiteboard tags to Keywords: (bibisectRequest)
[NinjaEdit]