Bug 117282 - WRITER: Can't create group box using the wizard
Summary: WRITER: Can't create group box using the wizard
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Armin Le Grand
URL:
Whiteboard: target:6.1.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Regressions-AW080
  Show dependency treegraph
 
Reported: 2018-04-27 09:58 UTC by Marina Latini (SUSE)
Modified: 2018-05-29 13:48 UTC (History)
2 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 Marina Latini (SUSE) 2018-04-27 09:58:24 UTC
Description:
The wizard for creating a group box doesn't work.

Steps to Reproduce:
1. Form -> Design mode
2. Form -> Control wizards
3. Form -> Group box
4. in the first dialog "table element" add two elements. For example "pippo" and "pluto"
4. click "next"
5. in the next step select one element as default (the error occurs also without a default)
6. Click next without modifying anything
7. Click finish

Actual Results:  
At the end of the wizard only the frame of the group box is created

Expected Results:
The frame of the group box and the elements are created in the document


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Version: 6.1.0.0.alpha1
Build ID: cb47f0d320994e001bc38dc2ee9b7d957b15e6ab
CPU threads: 4; OS: Linux 4.16; UI render: default; VCL: gtk2; 
Locale: it-IT (it_IT.UTF-8); Calc: group


User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0
Comment 1 Xisco Faulí 2018-04-27 11:00:06 UTC Comment hidden (obsolete)
Comment 2 Xisco Faulí 2018-04-27 11:10:23 UTC
the bisection in comment 1 is incorrect...
Comment 3 impreza233 2018-04-27 11:18:53 UTC
Same behaviour on macOS El Capitan

Versión: 6.1.0.0.alpha1
Id. de compilación: cb47f0d320994e001bc38dc2ee9b7d957b15e6ab
Subprocs. CPU: 4; SO: Mac OS X 10.11.5; Repres. IU: predet.; 
Configuración regional: es-ES (es.UTF-8); Calc: group
Comment 4 Xisco Faulí 2018-04-27 11:21:47 UTC
Regression introduced by:

author	Armin Le Grand <Armin.Le.Grand@cib.de (CIB)>	2018-03-01 15:54:32 +0100
committer	Armin Le Grand <Armin.Le.Grand@cib.de>	2018-04-06 22:29:02 +0200
commit 6c14c27c75a03e2363f2b363ddf0a6f2f46cfa91 (patch)
tree e66f50adb222dbc1490b4df2d3c63541dad999ac
parent e1b247a843c5eb850fe0079819239d9883412d38 (diff)
SOSAW080: Added first bunch of basic changes to helpers

Bisected with: bibisect-linux64-6.1
Comment 5 Xisco Faulí 2018-05-07 16:47:05 UTC
Adding Cc: to Armin Le Grand
Comment 6 Armin Le Grand 2018-05-09 17:53:12 UTC
Re-checked in lo-6-0, indeed buttons are created there. Will need to take a look...
Comment 7 Armin Le Grand 2018-05-11 15:24:35 UTC
An Exception is created, starting from OOptionGroupLayouter::doLayout when

            if (xShapeProperties.is())
                xShapeProperties->setPropertyValue("Name", makeAny(sElementsName));

is done. The exception is correct, it is a SvxShapeControl and has no property 'Name' at all.
It works in lo-6-0 since there is already a SdrObject, but 'mpModel' is ZERO. In that case - see SvxShape::_setPropertyValue - pMap is also ZERO - setting the property is just silently ignored - which is WRONG.
There is a comment:

            // FIXME: We should throw a UnknownPropertyException here.
            //        But since this class is aggregated from classes that
            //        support additional properties that we don't know here we
            //        silently store *all* properties, even if they may be not
            //        supported after creation.

Thiat is true, but is when pMap is set. If pMap is ZERO (as it is here), always an exception would have needed to be thrown.
Comment 8 Armin Le Grand 2018-05-11 15:30:50 UTC
That SvxShapeControl has no property 'Name' can be seen by following "SVXMAP_CONTROL" that is used at contruction (SvxShapeControl::SvxShapeControl). This leads to ImplGetSvxControlShapePropertyMap which has

        { OUString(UNO_NAME_MISC_OBJ_TITLE),        OWN_ATTR_MISC_OBJ_TITLE         , cppu::UnoType<OUString>::get(),    0,  0},
        { OUString(UNO_NAME_MISC_OBJ_DESCRIPTION),  OWN_ATTR_MISC_OBJ_DESCRIPTION   , cppu::UnoType<OUString>::get(),    0,  0},

but no

        { OUString(UNO_NAME_MISC_OBJ_NAME),         SDRATTR_OBJECTNAME, cppu::UnoType<rtl::OUString>::get(),    0,      0},

which is using

#define UNO_NAME_MISC_OBJ_NAME                  "Name"

Thus the situation is:
Something worked in the past because it did not throw an exception by convenience.

What to do? In principle OOptionGroupLayouter::doLayout should call xShapeProperties->setPropertyValue("Name", makeAny(sElementsName)) *only* when the Shape  comes from supports this...
Comment 9 Armin Le Grand 2018-05-11 15:44:57 UTC
In lo-6-0 mpModel local member in SvxShape gets set when the XShape gets added to the page:

            // add to the page
            xPageShapes->add(xRadioShape.get());

This is directly after

            // the name of the shape
            if (xShapeProperties.is())
                xShapeProperties->setPropertyValue("Name", makeAny(sElementsName));

That means I could reproduce the old behaviour in SvxShape::_setPropertyValue by not checking for '!mpModel' as in lo-6-0, but check if the Shape is already added to the page.
But do I want to do that? It was an error in the past that no exception was thrown. Maybe I will try to just fix this single call in OOptionGroupLayouter::doLayout.
This again may leave other places that worked before my change just because - by error - no exception was thrown in the past.

Hmmmm...
Comment 10 Armin Le Grand 2018-05-11 16:22:47 UTC
Fix on gerrit (see https://gerrit.libreoffice.org/#/c/54145/)
Comment 11 Commit Notification 2018-05-14 08:20:17 UTC
Armin Le Grand committed a patch related to this issue.
It has been pushed to "master":

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

tdf#117282 Do not set property 'Name' at ControlShape

It will be available in 6.1.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 12 Armin Le Grand 2018-05-18 11:38:34 UTC
Checked in current version
Comment 13 Xisco Faulí 2018-05-29 13:48:27 UTC
Verified in

Version: 6.1.0.0.beta1+
Build ID: da49f4aeb8d5e9a7d2cba8855d911e7cc1d2f1e2
CPU threads: 4; OS: Linux 4.13; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group

@Armin, Thanks for fixing this!!