diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-10-15 09:32:08 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-10-15 12:15:23 +0200 |
commit | d059f89496685bb9d7eff4b989adc18198d350c8 (patch) | |
tree | 6ba9a96973591deffd164d9d91e3e70837b46369 /cui | |
parent | e897fdc46b07f211c4c96de103cfa494b645035a (diff) |
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.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/tipofthedaydlg.cxx | 3 | ||||
-rw-r--r-- | cui/source/inc/tipofthedaydlg.hxx | 1 |
2 files changed, 2 insertions, 2 deletions
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(); |