diff options
author | Heiko Tietze <tietze.heiko@gmail.com> | 2021-10-07 11:13:49 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2021-10-08 10:20:25 +0200 |
commit | 9108fc6fe0b21ba06f155942f556275219f4eac0 (patch) | |
tree | be04abfa8893682412409c481d63407a5865e639 /cui | |
parent | bc3571887f5fa3abc6655400560fd0c0fd530528 (diff) |
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.tietze@documentfoundation.org>
(cherry picked from commit 1b6b2eff9ac386fd994e3ae120882f646268a80b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123158
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/tipofthedaydlg.cxx | 10 | ||||
-rw-r--r-- | cui/source/inc/tipofthedaydlg.hxx | 1 |
2 files changed, 5 insertions, 6 deletions
diff --git a/cui/source/dialogs/tipofthedaydlg.cxx b/cui/source/dialogs/tipofthedaydlg.cxx index c4d1f876f935..34193bff90de 100644 --- a/cui/source/dialogs/tipofthedaydlg.cxx +++ b/cui/source/dialogs/tipofthedaydlg.cxx @@ -73,19 +73,19 @@ TipOfTheDayDialog::TipOfTheDayDialog(weld::Window* pParent) } const auto t0 = std::chrono::system_clock::now().time_since_epoch(); - m_nDay = std::chrono::duration_cast<std::chrono::hours>(t0).count() / 24; + 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 // document if the first one isn't closed std::shared_ptr<comphelper::ConfigurationChanges> xChanges( comphelper::ConfigurationChanges::create()); - officecfg::Office::Common::Misc::LastTipOfTheDayShown::set(m_nDay, xChanges); + officecfg::Office::Common::Misc::LastTipOfTheDayShown::set(nDay, xChanges); xChanges->commit(); - if (m_nDay > officecfg::Office::Common::Misc::LastTipOfTheDayShown::get()) - m_nCurrentTip++; - UpdateTip(); } diff --git a/cui/source/inc/tipofthedaydlg.hxx b/cui/source/inc/tipofthedaydlg.hxx index f5f0ef999420..69af1996e454 100644 --- a/cui/source/inc/tipofthedaydlg.hxx +++ b/cui/source/inc/tipofthedaydlg.hxx @@ -36,7 +36,6 @@ private: std::unique_ptr<weld::CustomWeld> m_pPreview; sal_Int32 m_nCurrentTip; - sal_Int32 m_nDay; void UpdateTip(); DECL_LINK(OnNextClick, weld::Button&, void); DECL_LINK(OnLinkClick, weld::LinkButton&, bool); |