cui/source/dialogs/tipofthedaydlg.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
New commits: commit 1b6b2eff9ac386fd994e3ae120882f646268a80b Author: Heiko Tietze <tietze.he...@gmail.com> AuthorDate: Thu Oct 7 11:13:49 2021 +0200 Commit: Heiko Tietze <heiko.tie...@documentfoundation.org> CommitDate: Thu Oct 7 13:46:19 2021 +0200 Resolves tdf#144693 - TipOfTheDay does not progress Follow-up to I94cd34aa031e133d8c229a0de78582fda1dbdf4a Change-Id: I29a91a188fb9783074491271c37b49a1f2cf13ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123206 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org> diff --git a/cui/source/dialogs/tipofthedaydlg.cxx b/cui/source/dialogs/tipofthedaydlg.cxx index ed528d3042de..34193bff90de 100644 --- a/cui/source/dialogs/tipofthedaydlg.cxx +++ b/cui/source/dialogs/tipofthedaydlg.cxx @@ -74,6 +74,9 @@ TipOfTheDayDialog::TipOfTheDayDialog(weld::Window* pParent) const auto t0 = std::chrono::system_clock::now().time_since_epoch(); sal_Int32 nDay = std::chrono::duration_cast<std::chrono::hours>(t0).count() / 24; + //show next tip after one day + if (nDay > officecfg::Office::Common::Misc::LastTipOfTheDayShown::get()) + m_nCurrentTip++; // save this time to the config now instead of in the dtor otherwise we // end up with multiple copies of this dialog every time we open a new @@ -83,9 +86,6 @@ TipOfTheDayDialog::TipOfTheDayDialog(weld::Window* pParent) officecfg::Office::Common::Misc::LastTipOfTheDayShown::set(nDay, xChanges); xChanges->commit(); - if (nDay > officecfg::Office::Common::Misc::LastTipOfTheDayShown::get()) - m_nCurrentTip++; - UpdateTip(); }