2010-10-12 15:51:52 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2005-10-11 07:28:34 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 23:25:24 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2005-10-11 07:28:34 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2005-10-11 07:28:34 +00:00
|
|
|
*
|
2008-04-10 23:25:24 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2005-10-11 07:28:34 +00:00
|
|
|
*
|
2008-04-10 23:25:24 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2005-10-11 07:28:34 +00:00
|
|
|
*
|
2008-04-10 23:25:24 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2005-10-11 07:28:34 +00:00
|
|
|
*
|
2008-04-10 23:25:24 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2005-10-11 07:28:34 +00:00
|
|
|
*
|
2008-04-10 23:25:24 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2005-10-11 07:28:34 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-17 07:24:01 +00:00
|
|
|
|
2006-12-13 14:13:39 +00:00
|
|
|
#include <osl/diagnose.h>
|
2005-10-11 07:28:34 +00:00
|
|
|
#include "delayevent.hxx"
|
|
|
|
|
2006-12-13 14:13:39 +00:00
|
|
|
namespace slideshow {
|
2005-10-11 07:28:34 +00:00
|
|
|
namespace internal {
|
|
|
|
|
|
|
|
bool Delay::fire()
|
|
|
|
{
|
|
|
|
OSL_ASSERT( isCharged() );
|
|
|
|
if (isCharged()) {
|
|
|
|
mbWasFired = true;
|
|
|
|
maFunc();
|
|
|
|
maFunc.clear(); // early release of payload
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Delay::isCharged() const
|
|
|
|
{
|
|
|
|
return !mbWasFired;
|
|
|
|
}
|
|
|
|
|
|
|
|
double Delay::getActivationTime( double nCurrentTime ) const
|
|
|
|
{
|
|
|
|
return nCurrentTime + mnTimeout;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Delay::dispose()
|
|
|
|
{
|
2006-07-26 06:23:10 +00:00
|
|
|
// don't clear unconditionally, because it may currently be executed:
|
|
|
|
if (isCharged()) {
|
|
|
|
mbWasFired = true;
|
|
|
|
maFunc.clear(); // release of payload
|
|
|
|
}
|
2005-10-11 07:28:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace internal
|
|
|
|
} // namespace presentation
|
|
|
|
|
2010-10-12 15:51:52 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|