Kaydet (Commit) 06d18374 authored tarafından Noel Grandin's avatar Noel Grandin

use SimpleReferenceObject in extensions/update module

to replace hand-rolled version

Change-Id: I4cd74b3e95a61c32d3aa52646d654ce306791fae
üst 183e062e
...@@ -21,6 +21,7 @@ $(eval $(call gb_CppunitTest_use_libraries,extensions_test_update, \ ...@@ -21,6 +21,7 @@ $(eval $(call gb_CppunitTest_use_libraries,extensions_test_update, \
cppu \ cppu \
cppuhelper \ cppuhelper \
sal \ sal \
salhelper \
test \ test \
unotest \ unotest \
$(gb_UWINAPI) \ $(gb_UWINAPI) \
......
...@@ -24,6 +24,7 @@ $(eval $(call gb_Library_use_libraries,updchk,\ ...@@ -24,6 +24,7 @@ $(eval $(call gb_Library_use_libraries,updchk,\
cppuhelper \ cppuhelper \
cppu \ cppu \
sal \ sal \
salhelper \
)) ))
ifeq ($(OS),WNT) ifeq ($(OS),WNT)
......
...@@ -21,8 +21,9 @@ ...@@ -21,8 +21,9 @@
#define INCLUDED_EXTENSIONS_SOURCE_UPDATE_CHECK_ACTIONLISTENER_HXX #define INCLUDED_EXTENSIONS_SOURCE_UPDATE_CHECK_ACTIONLISTENER_HXX
#include <rtl/ref.hxx> #include <rtl/ref.hxx>
#include <salhelper/simplereferenceobject.hxx>
class IActionListener : public rtl::IReference class IActionListener : public virtual salhelper::SimpleReferenceObject
{ {
public: public:
...@@ -34,7 +35,7 @@ class IActionListener : public rtl::IReference ...@@ -34,7 +35,7 @@ class IActionListener : public rtl::IReference
virtual void closeAfterFailure() = 0; virtual void closeAfterFailure() = 0;
protected: protected:
~IActionListener() {} virtual ~IActionListener() {}
}; };
#endif // INCLUDED_EXTENSIONS_SOURCE_UPDATE_CHECK_ACTIONLISTENER_HXX #endif // INCLUDED_EXTENSIONS_SOURCE_UPDATE_CHECK_ACTIONLISTENER_HXX
......
...@@ -26,8 +26,9 @@ ...@@ -26,8 +26,9 @@
#include <rtl/ustring.hxx> #include <rtl/ustring.hxx>
#include <osl/conditn.hxx> #include <osl/conditn.hxx>
#include <osl/file.h> #include <osl/file.h>
#include <salhelper/simplereferenceobject.hxx>
struct DownloadInteractionHandler : public rtl::IReference struct DownloadInteractionHandler : public virtual salhelper::SimpleReferenceObject
{ {
virtual bool checkDownloadDestination(const OUString& rFileName) = 0; virtual bool checkDownloadDestination(const OUString& rFileName) = 0;
...@@ -47,7 +48,7 @@ struct DownloadInteractionHandler : public rtl::IReference ...@@ -47,7 +48,7 @@ struct DownloadInteractionHandler : public rtl::IReference
virtual void downloadFinished(const OUString& rFileName) = 0; virtual void downloadFinished(const OUString& rFileName) = 0;
protected: protected:
~DownloadInteractionHandler() {} virtual ~DownloadInteractionHandler() {}
}; };
......
...@@ -1606,20 +1606,4 @@ UpdateCheck::autoCheckIntervalChanged() ...@@ -1606,20 +1606,4 @@ UpdateCheck::autoCheckIntervalChanged()
m_aCondition.set(); m_aCondition.set();
}; };
oslInterlockedCount SAL_CALL
UpdateCheck::acquire()
{
return ReferenceObject::acquire();
}
oslInterlockedCount SAL_CALL
UpdateCheck::release()
{
return ReferenceObject::release();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -55,7 +55,6 @@ class UpdateCheck : ...@@ -55,7 +55,6 @@ class UpdateCheck :
public UpdateCheckConfigListener, public UpdateCheckConfigListener,
public IActionListener, public IActionListener,
public DownloadInteractionHandler, public DownloadInteractionHandler,
public salhelper::ReferenceObject,
public rtl::StaticWithInit< rtl::Reference< UpdateCheck >, UpdateCheckInitData > public rtl::StaticWithInit< rtl::Reference< UpdateCheck >, UpdateCheckInitData >
{ {
UpdateCheck(); UpdateCheck();
...@@ -120,10 +119,6 @@ public: ...@@ -120,10 +119,6 @@ public:
void resume() SAL_OVERRIDE; void resume() SAL_OVERRIDE;
void closeAfterFailure() SAL_OVERRIDE; void closeAfterFailure() SAL_OVERRIDE;
// rtl::IReference
virtual oslInterlockedCount SAL_CALL acquire() SAL_OVERRIDE;
virtual oslInterlockedCount SAL_CALL release() SAL_OVERRIDE;
private: private:
// Schedules or cancels next automatic check for updates // Schedules or cancels next automatic check for updates
......
...@@ -17,22 +17,23 @@ ...@@ -17,22 +17,23 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <rtl/ref.hxx>
#ifndef INCLUDED_EXTENSIONS_SOURCE_UPDATE_CHECK_UPDATECHECKCONFIGLISTENER_HXX #ifndef INCLUDED_EXTENSIONS_SOURCE_UPDATE_CHECK_UPDATECHECKCONFIGLISTENER_HXX
#define INCLUDED_EXTENSIONS_SOURCE_UPDATE_CHECK_UPDATECHECKCONFIGLISTENER_HXX #define INCLUDED_EXTENSIONS_SOURCE_UPDATE_CHECK_UPDATECHECKCONFIGLISTENER_HXX
#include <rtl/ref.hxx>
#include <salhelper/simplereferenceobject.hxx>
/* This interface should be implemented by classes acting /* This interface should be implemented by classes acting
* as controller (as in the MVC pattern). * as controller (as in the MVC pattern).
*/ */
struct UpdateCheckConfigListener : public rtl::IReference struct UpdateCheckConfigListener : public virtual salhelper::SimpleReferenceObject
{ {
virtual void autoCheckStatusChanged(bool enabled) = 0; virtual void autoCheckStatusChanged(bool enabled) = 0;
virtual void autoCheckIntervalChanged() = 0; virtual void autoCheckIntervalChanged() = 0;
protected: protected:
~UpdateCheckConfigListener() {} virtual ~UpdateCheckConfigListener() {}
}; };
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment