Bug 135529 - Can't set value today on Custom Properties by today button.
Summary: Can't set value today on Custom Properties by today button.
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.1.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:7.1.0
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-07 10:47 UTC by sawakaze
Modified: 2020-08-10 08:49 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
ScreenCast (790.19 KB, video/x-matroska)
2020-08-07 10:48 UTC, sawakaze
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sawakaze 2020-08-07 10:47:57 UTC
Description:
On Custom Properties, I want to set today by Today button.
But after press button, not response.
Detail is following steps and screencast.

Steps to Reproduce:
1. open writer 
2. file > properties...
-> open properties window
3. select Custom Properties
4. press Add Property button
5. select a Name (i.e Date Complete)
6. select type to "Date"
-> Value item box transfer to date itembox
7. press Value item
-> popup calendar
8. Once date set other day(i.e. 2020.8.1)
9. press Today Button
--> not response

Actual Results:
after step 9, not response

Expected Results:
after step 9, set Today


Reproducible: Always


User Profile Reset: Yes



Additional Info:
I confirm 

Version: 7.1.0.0.alpha0+
Build ID: <buildversion>
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3
Locale: ja-JP (ja_JP.UTF-8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2020-08-06_17:35:14
Calc: threaded
Comment 1 sawakaze 2020-08-07 10:48:22 UTC
Created attachment 164029 [details]
ScreenCast
Comment 2 Julien Nabet 2020-08-08 08:29:37 UTC
On pc Debian x86-64 with master sources updated today, I could reproduce this.

I found use of today in 2 locations:
svtools/uiconfig/ui/calendar.ui:43:            <property name="label" context="calendar|STR_SVT_CALENDAR_TODAY">Today</property>
svtools/uiconfig/ui/datewindow.ui:48:                <property name="label" context="calendar|STR_SVT_CALENDAR_TODAY">Today</property>

In our case, we use datewindow.ui
This one is used in:
svtools/source/brwbox/ebbcontrols.cxx:429:        , m_xCalendarBuilder(Application::CreateBuilder(m_xMenuButton.get(), "svt/ui/datewindow.ui"))
svtools/source/control/ctrlbox.cxx:1622:    , m_xBuilder(Application::CreateBuilder(m_xControl.get(), "svt/ui/datewindow.ui"))

First one uses DateControl which contains m_xTodayBtn (also m_xNoneBtn)
Second one uses SvtCalendarBox which doesn't contain these.

Custom property uses the second one, that's why "Today" button doesn't work.
#0  SvtCalendarBox::SvtCalendarBox(std::unique_ptr<weld::MenuButton, std::default_delete<weld::MenuButton> >) (this=0x87b1c90, pControl=...) at svtools/source/control/ctrlbox.cxx:1626
#1  0x00007ffff492e43f in CustomPropertyLine::CustomPropertyLine(CustomPropertiesWindow*, weld::Widget*) (this=0x86cf6e0, pParent=0x6ac2150, pContainer=0x86700f8) at sfx2/source/dialog/dinfdlg.cxx:1268
#2  0x00007ffff4932220 in CustomPropertiesWindow::CreateNewLine() (this=0x6ac2150) at sfx2/source/dialog/dinfdlg.cxx:1465
#3  0x00007ffff4932195 in CustomPropertiesWindow::SetVisibleLineCount(unsigned int) (this=0x6ac2150, nCount=6) at sfx2/source/dialog/dinfdlg.cxx:1453
#4  0x00007ffff4933fdd in CustomPropertiesControl::ResizeHdl(Size const&) (this=0x87be0d0, rSize=Size = {...}) at sfx2/source/dialog/dinfdlg.cxx:1819
#5  0x00007ffff4933d58 in CustomPropertiesControl::Init(weld::Builder&) (this=0x87be0d0, rBuilder=...) at sfx2/source/dialog/dinfdlg.cxx:1808
#6  0x00007ffff4934697 in SfxCustomPropertiesPage::SfxCustomPropertiesPage(weld::Container*, weld::DialogController*, SfxItemSet const&)
    (this=0x86f5f20, pPage=0x87be0b8, pController=0x72273e0, rItemSet=SfxItemSet of pool 0x33d8f50 with parent 0x0 and Which ranges: [(5535, 5535), (5590, 5590), (6410, 6410), (6518, 6518)] = {...})
    at sfx2/source/dialog/dinfdlg.cxx:1874

It seems there are 2 similar classes and one seems in unfinished state.

Caolán: thought you might be interested in this one.
Comment 3 Commit Notification 2020-08-10 08:24:38 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

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

tdf#135529 today/none only used by DateControl

It will be available in 7.1.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 4 Caolán McNamara 2020-08-10 08:28:14 UTC
fixed in master, in the sense that today and none weren't meant to be seen and used in custom properties
Comment 5 Julien Nabet 2020-08-10 08:49:06 UTC
(In reply to Caolán McNamara from comment #4)
> fixed in master, in the sense that today and none weren't meant to be seen
> and used in custom properties

Indeed, I don't see them anymore with updated local repo.
Thank you!