Bug 114790 - In dialogboxes, currency fields value can't be aligned on right
Summary: In dialogboxes, currency fields value can't be aligned on right
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.5.0 target:7.4.1
Keywords:
Depends on:
Blocks: Form-Controls
  Show dependency treegraph
 
Reported: 2018-01-01 10:54 UTC by rkeller
Modified: 2022-08-11 14:31 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
right align (2.34 KB, image/png)
2018-01-03 16:38 UTC, raal
Details
Test case file, with a little dialogbox to check (9.23 KB, application/vnd.oasis.opendocument.spreadsheet)
2018-02-22 15:37 UTC, rkeller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rkeller 2018-01-01 10:54:12 UTC
Description:
When - in a dialogbox - I create a currencyfield, and I configure it to be aligned to the right, the configuration isn't saved. Each time I open the dialogbox, the field's value is aligned on the left.

Steps to Reproduce:
1. Create a dialogbox
2. Create a currencyfield
3. Configure it to be aligned on the right

Actual Results:  
Not aligned on left.

Expected Results:
Being aligned on left.


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:


User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36
Comment 1 raal 2018-01-03 16:38:44 UTC
Created attachment 138858 [details]
right align

Works for me in Version: 6.0.0.0.alpha1+
Build ID: 80af51be1aa85733b9c0b696a93edd8c6520811c
CPU threads: 4; OS: Windows 6.1; UI render: default; 

Please attach test file.
Comment 2 rkeller 2018-02-22 15:37:40 UTC
Created attachment 140059 [details]
Test case file, with a little dialogbox to check

Here is a test case file. And I confirm that it doesn't work.

Important to get the bug:
- the bug happens with dialogboxes, I don't know what happens with forms
- when I save the changes done to my currencyfield, in the first time, it looks like it's saved, but when I open the box from outside the IDE (launched by a macro), the alignment is wrong
- as confirmation of the bug, when I reopen the configuration of the currencyfield, I see that the alignment wasn't saved: it is again on left instead of right
Comment 3 Xisco Faulí 2018-02-23 13:04:35 UTC
Could you please explain the steps to reproduce the issue once the document attached is open ?
Comment 4 rkeller 2018-02-25 12:49:30 UTC
Ok, I'll try to explain it as detailed as possible.

1) I open the executable "localc"; here I open the file TestFile.ods (see previous attachment).
2) I open the Macro editor by following: menu Tools -> Macro -> Edit Macros.
3) In the Macro editor, in the left "Object Catalog", I open my dialogbox by following: TestFile.ods -> Standard -> InsertCash, so I can edit the dialogbox.
4) In the dialogbox, I select the empty currencyfield which is on the right/down part of the dialogbox (labelled as "ChampMontant").
5) Now, at the left of the Macro editor, in the part where I can change the configuration of all the objects, I change the "Alignment" setting of my currencyfield: I change the alignment configuration from "left" to "right". Once done I save (Ctrl+S).
6) Now, at a first sight, everything looks fine. If I open the dialogbox preview (icon: "Preview Dialog"), the alignment is correct: on right. But the problem comes later, from step 7.
7) I close the Macro editor.
8) I reopen the Macro editor, following the steps 2 to 4.
9) I watch again at the configuration of the currencyfield and I see that it is again on "left" and not "right". It looks as if the configuration of the alignment setting has not been saved.

Note: my testfile doesn't include a macro code where I can launch "in real" (and not just preview) the dialogbox, but in the file which I am actively working on, this problem has the consequence that the "real" dialogbox can't align data on right in currencyfields.
Comment 5 Xisco Faulí 2018-02-27 10:20:18 UTC
Confirmed in

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

and

LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 6 QA Administrators 2020-12-13 03:46:18 UTC Comment hidden (obsolete)
Comment 7 Julien Nabet 2022-08-07 11:51:32 UTC
On pc Debian x86-64 with master sources updated today, I can reproduce this.
Also, it's the same for other attributes like "Vert. Alignment" or "Additional 
information"

Weird thing is if I change alignment of the box at the middle, it's ok.

eg of bt when setting property on the middle box:

#0  VCLXWindow::setProperty(rtl::OUString const&, com::sun::star::uno::Any const&) (this=0x55b41b3e9228, PropertyName="Align", Value=uno::Any(void)) at toolkit/source/awt/vclxwindow.cxx:1782
#1  0x00007feecf350cb6 in VCLXEdit::setProperty(rtl::OUString const&, com::sun::star::uno::Any const&) (this=0x55b41b3e9210, PropertyName="Align", Value=uno::Any(void))
    at toolkit/source/awt/vclxwindows.cxx:3989
#2  0x00007feecf353505 in VCLXComboBox::setProperty(rtl::OUString const&, com::sun::star::uno::Any const&) (this=0x55b41b3e9210, PropertyName="Align", Value=uno::Any(void))
    at toolkit/source/awt/vclxwindows.cxx:4350
#3  0x00007feecf54a5ef in UnoControl::ImplSetPeerProperty(rtl::OUString const&, com::sun::star::uno::Any const&) (this=0x55b41b08cca0, rPropName="Align", rVal=uno::Any(void))
    at toolkit/source/controls/unocontrol.cxx:288
#4  0x00007feecf5acf20 in UnoEditControl::ImplSetPeerProperty(rtl::OUString const&, com::sun::star::uno::Any const&) (this=0x55b41b08cca0, rPropName="Align", rVal=uno::Any(void))
    at toolkit/source/controls/unocontrols.cxx:228
#5  0x00007feecf5c4a7d in UnoComboBoxControl::ImplSetPeerProperty(rtl::OUString const&, com::sun::star::uno::Any const&) (this=0x55b41b08cca0, rPropName="Align", rVal=uno::Any(void))
    at toolkit/source/controls/unocontrols.cxx:3053
#6  0x00007feecf54ce98 in UnoControl::ImplModelPropertiesChanged(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyChangeEvent> const&)
    (this=0x55b41b08cca0, rEvents=uno::Sequence of length 54 = {...}) at toolkit/source/controls/unocontrol.cxx:650
#7  0x00007feecf54b6b8 in UnoControl::propertiesChange(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyChangeEvent> const&) (this=0x55b41b08cca0, rEvents=uno::Sequence of length 54 = {...})
    at toolkit/source/controls/unocontrol.cxx:431
#8  0x00007feed4ecff02 in cppu::OPropertySetHelper::firePropertiesChangeEvent(com::sun::star::uno::Sequence<rtl::OUString> const&, com::sun::star::uno::Reference<com::sun::star::beans::XPropertiesChangeListener> const&) (this=0x55b41b0c8890, rPropertyNames=uno::Sequence of length 54 = {...}, rListener=uno::Reference to (UnoComboBoxControl *) 0x55b41b08ccf0) at cppuhelper/source/propshlp.cxx:957
#9  0x00007feecf54a8e9 in UnoControl::updateFromModel() (this=0x55b41b08cca0) at toolkit/source/controls/unocontrol.cxx:320
#10 0x00007feecf5c4856 in UnoComboBoxControl::updateFromModel() (this=0x55b41b08cca0) at toolkit/source/controls/unocontrols.cxx:3037
#11 0x00007feecf552812 in UnoControl::createPeer(com::sun::star::uno::Reference<com::sun::star::awt::XToolkit> const&, com::sun::star::uno::Reference<com::sun::star::awt::XWindowPeer> const&)
    (this=0x55b41b08cca0, rxToolkit=empty uno::Reference, rParentPeer=uno::Reference to (VCLXContainer *) 0x55b41b297850) at toolkit/source/controls/unocontrol.cxx:1305
#12 0x00007feecf5ad0a9 in UnoEditControl::createPeer(com::sun::star::uno::Reference<com::sun::star::awt::XToolkit> const&, com::sun::star::uno::Reference<com::sun::star::awt::XWindowPeer> const&)
    (this=0x55b41b08cca0, rxToolkit=empty uno::Reference, rParentPeer=uno::Reference to (VCLXContainer *) 0x55b41b297850) at toolkit/source/controls/unocontrols.cxx:240
#13 0x00007feecf5c4ac9 in UnoComboBoxControl::createPeer(com::sun::star::uno::Reference<com::sun::star::awt::XToolkit> const&, com::sun::star::uno::Reference<com::sun::star::awt::XWindowPeer> const&)
    (this=0x55b41b08cca0, rxToolkit=empty uno::Reference, rParentPeer=uno::Reference to (VCLXContainer *) 0x55b41b297850) at toolkit/source/controls/unocontrols.cxx:3057
#14 0x00007feecf54cb8f in UnoControl::ImplModelPropertiesChanged(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyChangeEvent> const&)
    (this=0x55b41b08cca0, rEvents=uno::Sequence of length 1 = {...}) at toolkit/source/controls/unocontrol.cxx:626
#15 0x00007feecf54b6b8 in UnoControl::propertiesChange(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyChangeEvent> const&) (this=0x55b41b08cca0, rEvents=uno::Sequence of length 1 = {...})
    at toolkit/source/controls/unocontrol.cxx:431
#16 0x00007feed4ecdea8 in cppu::OPropertySetHelper::fire(int*, com::sun::star::uno::Any const*, com::sun::star::uno::Any const*, int, unsigned char)
    (this=0x55b41b0c8890, pnHandles=0x7feebf6fa084, pNewValues=0x55b41c14cb88, pOldValues=0x55b41c14cb70, nHandles=1, bVetoable=0 '\000') at cppuhelper/source/propshlp.cxx:777
#17 0x00007feed54e9501 in comphelper::OPropertySetAggregationHelper::propertiesChange(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyChangeEvent> const&)
    (this=0x55b41b0c8890, _rEvents=uno::Sequence of length 1 = {...}) at comphelper/source/property/propagg.cxx:400
#18 0x00007feed4ecdea8 in cppu::OPropertySetHelper::fire(int*, com::sun::star::uno::Any const*, com::sun::star::uno::Any const*, int, unsigned char)
    (this=0x55b41b0c8b78, pnHandles=0x7feebf6fb3f4, pNewValues=0x55b41be1a3a8, pOldValues=0x55b41b2db398, nHandles=1, bVetoable=0 '\000') at cppuhelper/source/propshlp.cxx:777
#19 0x00007feed4ece3a7 in cppu::OPropertySetHelper::impl_fireAll(int*, com::sun::star::uno::Any const*, com::sun::star::uno::Any const*, int)
    (this=0x55b41b0c8b78, i_handles=0x7feebf6fb3f4, i_newValues=0x55b41be1a3a8, i_oldValues=0x55b41b2db398, i_count=1) at cppuhelper/source/propshlp.cxx:567
#20 0x00007feed4ecf6e6 in cppu::OPropertySetHelper::setFastPropertyValues(int, int*, com::sun::star::uno::Any const*, int)
    (this=0x55b41b0c8b78, nSeqLen=1, pHandles=0x7feebf6fb3f4, pValues=0x7feebf6fb900, nHitCount=1) at cppuhelper/source/propshlp.cxx:857
#21 0x00007feecf586df0 in UnoControlModel::setFastPropertyValue(int, com::sun::star::uno::Any const&) (this=0x55b41b0c8ae0, nPropId=7, rValue=uno::Any(void)) at toolkit/source/controls/unocontrolmodel.cxx:1276
#22 0x00007feed54ea3a7 in comphelper::OPropertySetAggregationHelper::setFastPropertyValue(int, com::sun::star::uno::Any const&) (this=0x55b41b0c8890, _nHandle=10000, _rValue=uno::Any(void))
    at comphelper/source/property/propagg.cxx:530
#23 0x00007feed4ecb07b in cppu::OPropertySetHelper::setPropertyValue(rtl::OUString const&, com::sun::star::uno::Any const&) (this=0x55b41b0c8890, rPropertyName="Align", rValue=uno::Any(void))
    at cppuhelper/source/propshlp.cxx:264
#24 0x00007feeb053c0e9 in pcr::FormComponentPropertyHandler::setPropertyValue(rtl::OUString const&, com::sun::star::uno::Any const&) (this=0x55b41c149ee0, _rPropertyName="Align", _rValue=uno::Any(void))
    at extensions/source/propctrlr/formcomponenthandler.cxx:464
#25 0x00007feeb05fd696 in pcr::OPropertyBrowserController::Commit(rtl::OUString const&, com::sun::star::uno::Any const&) (this=0x55b41b373bd0, rName="Align", _rValue=uno::Any(void))
    at extensions/source/propctrlr/propcontroller.cxx:1325

Caolán: I don't see anything in the bt concerning vcl and seeing "toolkit" in addition with "extensions", it may be quite broken, is it a part which would need to be "welded"?
Comment 8 Caolán McNamara 2022-08-07 14:20:59 UTC
seems to just be missing from the import/export set of properties

https://gerrit.libreoffice.org/c/core/+/137925

appears to make align/vertalign save/load for currency fields
Comment 9 Commit Notification 2022-08-07 15:05:56 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/cf2a7501fa1848fdccd9717f52f18d0f44db458b

Resolves: tdf#114790 add align and vertalign to currencyfield im/export

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Julien Nabet 2022-08-07 17:53:32 UTC
Great! I confirm it works now with master sources updated today including your patch.
Thank you!

(I had searched in toolkit/source/controls/unocontrols.cxx, toolkit/source/awt/vclxwindow.cxx, thought it was lacking setAlignment/getAlignment)
Comment 11 Commit Notification 2022-08-08 05:25:16 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7b204ecb49563544ee9c811dbcbee998062bf511

Related tdf#114790: add align and vertalign to datefield im/export

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2022-08-08 10:54:11 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/9d9ed8768895b8069ce662809964b7fc694258c0

Resolves: tdf#114790 add align and vertalign to currencyfield im/export

It will be available in 7.4.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 13 Commit Notification 2022-08-11 14:31:31 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/140aa19158eb62957cb5baa520c181de0aa9a0f9

Related tdf#114790: add align and vertalign to datefield im/export

It will be available in 7.4.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.