diff options
author | Heiko Tietze <tietze.heiko@gmail.com> | 2020-10-13 12:44:24 +0200 |
---|---|---|
committer | Heiko Tietze <heiko.tietze@documentfoundation.org> | 2020-10-14 10:48:48 +0200 |
commit | 2b7ccc1ee083abee812a4e9917c1324179ec97cb (patch) | |
tree | 046ec29a40c5aca736fd9b87a38ba7516844c0eb /cui | |
parent | 231a4e024b85aa0ad06a5632d3f514152babea30 (diff) |
Resolves tdf#137429 - Ensure first tip is shown first
Starting in safe mode (or the first time) shows now
array[0] instead of [1]
Change-Id: I50643c4443705a5137080c6dbdb1ad329151b308
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104230
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/tipofthedaydlg.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cui/source/dialogs/tipofthedaydlg.cxx b/cui/source/dialogs/tipofthedaydlg.cxx index c64362d35c08..ee4a9edebb50 100644 --- a/cui/source/dialogs/tipofthedaydlg.cxx +++ b/cui/source/dialogs/tipofthedaydlg.cxx @@ -76,13 +76,13 @@ static bool file_exists(const OUString& fileName) void TipOfTheDayDialog::UpdateTip() { - if ((nCurrentTip + 1 > nNumberOfTips) || (nCurrentTip < 0)) - nCurrentTip = 0; - m_xDialog->set_title(CuiResId(STR_TITLE) + ": " + OUString::number(nCurrentTip + 1) + "/" + if ((nCurrentTip > nNumberOfTips) || (nCurrentTip < 1)) + nCurrentTip = 1; + m_xDialog->set_title(CuiResId(STR_TITLE) + ": " + OUString::number(nCurrentTip) + "/" + OUString::number(nNumberOfTips)); // text - OUString aText = CuiResId(std::get<0>(TIPOFTHEDAY_STRINGARRAY[nCurrentTip])); + OUString aText = CuiResId(std::get<0>(TIPOFTHEDAY_STRINGARRAY[nCurrentTip - 1])); //replace MOD1 & MOD2 shortcuts depending on platform #ifdef MACOSX const OUString aMOD1 = CuiResId(STR_CMD); @@ -107,7 +107,7 @@ void TipOfTheDayDialog::UpdateTip() m_pText->set_label(aText); // hyperlink - aLink = std::get<1>(TIPOFTHEDAY_STRINGARRAY[nCurrentTip]); + aLink = std::get<1>(TIPOFTHEDAY_STRINGARRAY[nCurrentTip - 1]); if (aLink.isEmpty()) { m_pLink->set_visible(false); @@ -148,7 +148,7 @@ void TipOfTheDayDialog::UpdateTip() // image OUString aURL("$BRAND_BASE_DIR/$BRAND_SHARE_SUBDIR/tipoftheday/"); rtl::Bootstrap::expandMacros(aURL); - OUString aImage = std::get<2>(TIPOFTHEDAY_STRINGARRAY[nCurrentTip]); + OUString aImage = std::get<2>(TIPOFTHEDAY_STRINGARRAY[nCurrentTip - 1]); // use default image if none is available with the number if (aImage.isEmpty() || !file_exists(aURL + aImage)) aImage = "tipoftheday.png"; |