Bug 107037 - online: Poco::Time* replacement with std::chrono
Summary: online: Poco::Time* replacement with std::chrono
Status: RESOLVED DUPLICATE of bug 107038
Alias: None
Product: LibreOffice Online
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium trivial
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-08 20:30 UTC by Michael Meeks
Modified: 2019-05-06 13:56 UTC (History)
1 user (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 Michael Meeks 2017-04-08 20:30:51 UTC
LibreOffice Online uses a rather frankensteinish mix of Poco::Timestamp and std::chrono - we should move to using the latter consistently.

It would be good to move wsd/* first - since it doesn't use much Poco API anymore - although it would be good to consider whether we need some convenience wrappers around std::chrono to make it somewhat less verbose - particularly the cast to milliseconds is very ugly.

Thanks !
Comment 1 Michael Meeks 2017-04-08 20:31:27 UTC

*** This bug has been marked as a duplicate of bug 107038 ***
Comment 2 Shivansh 2019-05-04 11:41:22 UTC
I would like to work on this bug.

(In reply to Michael Meeks from comment #0)
> LibreOffice Online uses a rather frankensteinish mix of Poco::Timestamp and
> std::chrono - we should move to using the latter consistently.
> 
> It would be good to move wsd/* first - since it doesn't use much Poco API
> anymore
I think I found most of the instances of Poco::Timestamp in wsd/* only. It might make my work harder;).

> although it would be good to consider whether we need some
> convenience wrappers around std::chrono to make it somewhat less verbose -
> particularly the cast to milliseconds is very ugly.
Can you please elaborate. What do you mean by convinience wrapper here?

I think moving to std::chrono will take a lot of work. For e.g to move this [1], we have std::chrono::time_point::time_since_epoch whose return type is std::chrono::system_clock::duration, while the data type already being used is std::time_t. So we will have to typecast or something.
Do we have to move all the present instances of Poco::Timestamp or are there some restrictions?

Thank You.

[1] https://opengrok.libreoffice.org/xref/online/wsd/Auth.cpp#140
Comment 3 Michael Meeks 2019-05-06 13:56:42 UTC
Please discuss in 107038.