summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-07-16 11:34:05 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-07-16 20:30:58 +0200
commit8536d63dc3a65bdf0121a000210a4f92379ce2a0 (patch)
treeeafcc7a3446beaa739ab0a933da2f44684811e4c /cui
parent9bd7e2cdf7d2b247ae99a2ce71449d9f265032d1 (diff)
cid#1448481 Calling risky rand
Change-Id: I07c9956d034a1b78c77608da57dea299572fea85 Reviewed-on: https://gerrit.libreoffice.org/75711 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/tipofthedaydlg.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/cui/source/dialogs/tipofthedaydlg.cxx b/cui/source/dialogs/tipofthedaydlg.cxx
index 894768f5de99..1495d83f163b 100644
--- a/cui/source/dialogs/tipofthedaydlg.cxx
+++ b/cui/source/dialogs/tipofthedaydlg.cxx
@@ -29,6 +29,7 @@
#include <vcl/virdev.hxx>
#include <sfx2/sfxhelp.hxx>
#include <vcl/svapp.hxx>
+#include <comphelper/random.hxx>
TipOfTheDayDialog::TipOfTheDayDialog(weld::Window* pParent)
: GenericDialogController(pParent, "cui/ui/tipofthedaydialog.ui", "TipOfTheDayDialog")
@@ -42,8 +43,7 @@ TipOfTheDayDialog::TipOfTheDayDialog(weld::Window* pParent)
m_pNext->connect_clicked(LINK(this, TipOfTheDayDialog, OnNextClick));
nNumberOfTips = SAL_N_ELEMENTS(TIPOFTHEDAY_STRINGARRAY);
- srand(time(nullptr));
- nCurrentTip = rand() % nNumberOfTips;
+ nCurrentTip = comphelper::rng::uniform_int_distribution(0, nNumberOfTips - 1);
UpdateTip();
}