cui/source/dialogs/tipofthedaydlg.cxx | 3 ++- cui/source/inc/tipofthedaydlg.hxx | 1 - 2 files changed, 2 insertions(+), 2 deletions(-)
New commits: commit d059f89496685bb9d7eff4b989adc18198d350c8 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Thu Oct 15 09:32:08 2020 +0300 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Thu Oct 15 12:15:23 2020 +0200 This field only holds a compile-time constant Change-Id: I9796f97af5d45211b67070fc020547e2b63ef411 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104348 Tested-by: Mike Kaganski <mike.kagan...@collabora.com> Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/cui/source/dialogs/tipofthedaydlg.cxx b/cui/source/dialogs/tipofthedaydlg.cxx index d4f7d8f1c860..005584027547 100644 --- a/cui/source/dialogs/tipofthedaydlg.cxx +++ b/cui/source/dialogs/tipofthedaydlg.cxx @@ -47,7 +47,6 @@ TipOfTheDayDialog::TipOfTheDayDialog(weld::Window* pParent) m_pShowTip->set_active(officecfg::Office::Common::Misc::ShowTipOfTheDay::get()); m_pNext->connect_clicked(LINK(this, TipOfTheDayDialog, OnNextClick)); - nNumberOfTips = SAL_N_ELEMENTS(TIPOFTHEDAY_STRINGARRAY); nCurrentTip = officecfg::Office::Common::Misc::LastTipOfTheDayID::get(); const auto t0 = std::chrono::system_clock::now().time_since_epoch(); @@ -76,6 +75,8 @@ static bool file_exists(const OUString& fileName) void TipOfTheDayDialog::UpdateTip() { + constexpr sal_Int32 nNumberOfTips = SAL_N_ELEMENTS(TIPOFTHEDAY_STRINGARRAY); + if ((nCurrentTip >= nNumberOfTips) || (nCurrentTip < 0)) nCurrentTip = 0; diff --git a/cui/source/inc/tipofthedaydlg.hxx b/cui/source/inc/tipofthedaydlg.hxx index 62a8033e3e8c..c89694c1c15d 100644 --- a/cui/source/inc/tipofthedaydlg.hxx +++ b/cui/source/inc/tipofthedaydlg.hxx @@ -30,7 +30,6 @@ private: std::unique_ptr<weld::LinkButton> m_pLink; sal_Int32 nCurrentTip; - sal_Int32 nNumberOfTips; sal_Int32 nDay; OUString aLink; void UpdateTip(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits