21#include <osl/diagnose.h>
29 return static_cast<sal_uLong>(time(
nullptr));
46 explicit FindByTimeout(
sal_uLong n) : mnTimeout(
n) {}
50struct FindNonZeroTimeout
62 , aTimer(
"ScAutoStyleList Timer")
63 , aInitIdle(
"ScAutoStyleList InitIdle")
78 sal_uLong nTimeout,
const OUString& rStyle2 )
80 aInitials.emplace_back( rRange, rStyle1, nTimeout, rStyle2 );
86 std::vector<ScAutoStyleInitData> aLocalInitials(std::move(aInitials));
87 for (
const auto& rInitial : aLocalInitials)
90 pDocSh->DoAutoStyle(rInitial.aRange, rInitial.aStyle1);
93 if (rInitial.nTimeout)
94 AddEntry(rInitial.nTimeout, rInitial.aRange, rInitial.aStyle2 );
104 std::vector<ScAutoStyleData>::iterator itr =
114 OSL_ENSURE(nNow>
nTimerStart,
"Time is running backwards?");
119 std::vector<ScAutoStyleData>::iterator iter =
134 if (rEntry.nTimeout <= nDiff)
137 rEntry.nTimeout -= nDiff;
145 std::vector<ScAutoStyleData>::iterator itr =
aEntries.begin(), itrEnd =
aEntries.end();
146 for (; itr != itrEnd; ++itr)
171 std::vector<ScAutoStyleData>::iterator iter =
186 AdjustEntries(aTimer.GetTimeout());
static sal_uLong TimeNow()
IMPL_LINK_NOARG(ScAutoStyleList, InitHdl, Timer *, void)
virtual void Start(bool bStartTimer=true) override
void AdjustEntries(sal_uLong nDiff)
void AddInitial(const ScRange &rRange, const OUString &rStyle1, sal_uLong nTimeout, const OUString &rStyle2)
std::vector< ScAutoStyleData > aEntries
void StartTimer(sal_uLong nNow)
void AddEntry(sal_uLong nTimeout, const ScRange &rRange, const OUString &rStyle)
std::vector< ScAutoStyleInitData > aInitials
ScAutoStyleList(ScDocShell *pShell)
void DoAutoStyle(const ScRange &rRange, const OUString &rStyle)
void SetPriority(TaskPriority ePriority)
void SetTimeout(sal_uInt64 nTimeoutMs)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
virtual void Start(bool bStartTimer=true) override
#define LINK(Instance, Class, Member)