diff options
author | Noel Grandin <noel@peralex.com> | 2014-07-07 11:26:58 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-07-08 15:16:47 +0200 |
commit | 482f97926e1090c50ef05eed6badf311a7aa02f9 (patch) | |
tree | f2c8534cd0d3446b36f7d9d49c4cbc17ac6ac92a /include/svtools | |
parent | 4861e4961f7dc4f28a14c5f9d9b969456bfec720 (diff) |
use SimpleReferenceObject in svtools module
to replace hand-rolled version
Change-Id: I7a1048ff1ea335c3934fe7e91a09489a4d7aeb96
Diffstat (limited to 'include/svtools')
-rw-r--r-- | include/svtools/accessiblefactory.hxx | 5 | ||||
-rw-r--r-- | include/svtools/toolpanel/decklayouter.hxx | 3 | ||||
-rw-r--r-- | include/svtools/toolpanel/drawerlayouter.hxx | 7 | ||||
-rw-r--r-- | include/svtools/toolpanel/refbase.hxx | 75 | ||||
-rw-r--r-- | include/svtools/toolpanel/tablayouter.hxx | 8 | ||||
-rw-r--r-- | include/svtools/toolpanel/toolpanel.hxx | 9 |
6 files changed, 11 insertions, 96 deletions
diff --git a/include/svtools/accessiblefactory.hxx b/include/svtools/accessiblefactory.hxx index b13dabde0b08..21ba910b8d94 100644 --- a/include/svtools/accessiblefactory.hxx +++ b/include/svtools/accessiblefactory.hxx @@ -26,6 +26,7 @@ #include <com/sun/star/uno/Reference.hxx> #include <rtl/ref.hxx> +#include <salhelper/simplereferenceobject.hxx> namespace com { namespace sun { namespace star { namespace accessibility { @@ -70,7 +71,7 @@ namespace svt //= IAccessibleFactory - class IAccessibleFactory : public ::rtl::IReference + class IAccessibleFactory : public virtual ::salhelper::SimpleReferenceObject { public: virtual IAccessibleTabListBox* @@ -172,7 +173,7 @@ namespace svt ) = 0; protected: - ~IAccessibleFactory() {} + virtual ~IAccessibleFactory() {} }; diff --git a/include/svtools/toolpanel/decklayouter.hxx b/include/svtools/toolpanel/decklayouter.hxx index 11345e7106a3..e5b9e9319b28 100644 --- a/include/svtools/toolpanel/decklayouter.hxx +++ b/include/svtools/toolpanel/decklayouter.hxx @@ -23,6 +23,7 @@ #include <com/sun/star/uno/Reference.hxx> #include <rtl/ref.hxx> +#include <salhelper/simplereferenceobject.hxx> #include <boost/optional.hpp> @@ -40,7 +41,7 @@ namespace svt //= IDeckLayouter - class IDeckLayouter : public ::rtl::IReference + class IDeckLayouter : public salhelper::SimpleReferenceObject { public: /** re-arranges the elements of the tool deck, taking into account the diff --git a/include/svtools/toolpanel/drawerlayouter.hxx b/include/svtools/toolpanel/drawerlayouter.hxx index 4ee46ae2a065..2cef5d718d68 100644 --- a/include/svtools/toolpanel/drawerlayouter.hxx +++ b/include/svtools/toolpanel/drawerlayouter.hxx @@ -21,7 +21,6 @@ #define INCLUDED_SVTOOLS_TOOLPANEL_DRAWERLAYOUTER_HXX #include <svtools/svtdllapi.h> -#include <svtools/toolpanel/refbase.hxx> #include <svtools/toolpanel/toolpaneldeck.hxx> #include <svtools/toolpanel/decklayouter.hxx> @@ -41,8 +40,7 @@ namespace svt /** a class which implements a tool panel selector in the form of the classical drawers */ - class SVT_DLLPUBLIC DrawerDeckLayouter :public RefBase - ,public IDeckLayouter + class SVT_DLLPUBLIC DrawerDeckLayouter :public IDeckLayouter ,public IToolPanelDeckListener { public: @@ -52,9 +50,6 @@ namespace svt ); virtual ~DrawerDeckLayouter(); - // IReference - DECLARE_IREFERENCE() - // IDeckLayouter virtual Rectangle Layout( const Rectangle& i_rDeckPlayground ) SAL_OVERRIDE; virtual void Destroy() SAL_OVERRIDE; diff --git a/include/svtools/toolpanel/refbase.hxx b/include/svtools/toolpanel/refbase.hxx deleted file mode 100644 index 15fda1805fb1..000000000000 --- a/include/svtools/toolpanel/refbase.hxx +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVTOOLS_TOOLPANEL_REFBASE_HXX -#define INCLUDED_SVTOOLS_TOOLPANEL_REFBASE_HXX - -#include <svtools/svtdllapi.h> - -#include <rtl/ref.hxx> - - -namespace svt -{ - - - - //= RefBase - - class SVT_DLLPUBLIC RefBase : public ::rtl::IReference - { - protected: - RefBase() - :m_refCount( 0 ) - { - } - - virtual ~RefBase() - { - } - - virtual oslInterlockedCount SAL_CALL acquire() SAL_OVERRIDE; - virtual oslInterlockedCount SAL_CALL release() SAL_OVERRIDE; - - private: - oslInterlockedCount m_refCount; - }; - -#define DECLARE_IREFERENCE() \ - virtual oslInterlockedCount SAL_CALL acquire() SAL_OVERRIDE; \ - virtual oslInterlockedCount SAL_CALL release() SAL_OVERRIDE; - - -#define IMPLEMENT_IREFERENCE( classname ) \ - oslInterlockedCount classname::acquire() \ - { \ - return RefBase::acquire(); \ - } \ - oslInterlockedCount classname::release() \ - { \ - return RefBase::release(); \ - } - - -} // namespace svt - - -#endif // INCLUDED_SVTOOLS_TOOLPANEL_REFBASE_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/toolpanel/tablayouter.hxx b/include/svtools/toolpanel/tablayouter.hxx index 17b5c4fa6429..db89736db832 100644 --- a/include/svtools/toolpanel/tablayouter.hxx +++ b/include/svtools/toolpanel/tablayouter.hxx @@ -24,7 +24,7 @@ #include <svtools/toolpanel/decklayouter.hxx> #include <svtools/toolpanel/tabalignment.hxx> #include <svtools/toolpanel/tabitemcontent.hxx> -#include <svtools/toolpanel/refbase.hxx> +#include <salhelper/simplereferenceobject.hxx> #include <memory> @@ -44,8 +44,7 @@ namespace svt //= TabDeckLayouter - class SVT_DLLPUBLIC TabDeckLayouter :public RefBase - ,public IDeckLayouter + class SVT_DLLPUBLIC TabDeckLayouter :public IDeckLayouter ,public ::boost::noncopyable { public: @@ -83,9 +82,6 @@ namespace svt const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible ) SAL_OVERRIDE; - // IReference - DECLARE_IREFERENCE() - private: ::std::auto_ptr< TabDeckLayouter_Data > m_pData; }; diff --git a/include/svtools/toolpanel/toolpanel.hxx b/include/svtools/toolpanel/toolpanel.hxx index 7fea98826098..27084d8bd460 100644 --- a/include/svtools/toolpanel/toolpanel.hxx +++ b/include/svtools/toolpanel/toolpanel.hxx @@ -21,8 +21,9 @@ #define INCLUDED_SVTOOLS_TOOLPANEL_TOOLPANEL_HXX #include <svtools/svtdllapi.h> -#include <svtools/toolpanel/refbase.hxx> +#include <salhelper/simplereferenceobject.hxx> +#include <rtl/ref.hxx> #include <rtl/ustring.hxx> #include <vcl/image.hxx> @@ -44,7 +45,7 @@ namespace svt /** abstract interface for a single tool panel */ - class SVT_DLLPUBLIC IToolPanel : public ::rtl::IReference + class SVT_DLLPUBLIC IToolPanel : public salhelper::SimpleReferenceObject { public: /// retrieves the display name of the panel @@ -118,15 +119,11 @@ namespace svt but still being abstract */ class SVT_DLLPUBLIC ToolPanelBase :public IToolPanel - ,public RefBase ,public ::boost::noncopyable { protected: ToolPanelBase(); virtual ~ToolPanelBase(); - - public: - DECLARE_IREFERENCE() }; |