From ef9757605619c6bcbdde61c93c834a0467453d67 Mon Sep 17 00:00:00 2001 From: Jochen Nitschke Date: Wed, 30 Mar 2016 22:29:16 +0200 Subject: tdf#97525 vcl: make DeletionListener internal move include/vcl/impdel.hxx to vcl/inc/ include impdel.hxx in salframe.hxx remove vcl/impdel.hxx includes in pch add missing includes Change-Id: Id146363b2e20ce0238542929c26a83efb1e8c4bd Reviewed-on: https://gerrit.libreoffice.org/23664 Tested-by: Jenkins Reviewed-by: Noel Grandin --- accessibility/inc/pch/precompiled_acc.hxx | 1 - basctl/inc/pch/precompiled_basctl.hxx | 1 - chart2/inc/pch/precompiled_chartcontroller.hxx | 1 - chart2/source/view/inc/GL3DBarChart.hxx | 1 + cppcanvas/inc/pch/precompiled_cppcanvas.hxx | 1 - cui/inc/pch/precompiled_cui.hxx | 1 - dbaccess/inc/pch/precompiled_dbmm.hxx | 1 - desktop/inc/pch/precompiled_sofficeapp.hxx | 1 - editeng/inc/pch/precompiled_editeng.hxx | 1 - framework/inc/pch/precompiled_fwe.hxx | 1 - framework/inc/pch/precompiled_fwl.hxx | 1 - include/vcl/impdel.hxx | 81 ------------------------- include/vcl/menu.hxx | 1 + include/vcl/vclevent.hxx | 1 - reportdesign/inc/pch/precompiled_rpt.hxx | 1 - reportdesign/inc/pch/precompiled_rptui.hxx | 1 - sc/inc/pch/precompiled_sc.hxx | 1 - sc/source/core/inc/addinlis.hxx | 1 + sd/inc/pch/precompiled_sdui.hxx | 1 - slideshow/inc/pch/precompiled_slideshow.hxx | 1 - svtools/inc/pch/precompiled_svt.hxx | 1 - svx/inc/pch/precompiled_svxcore.hxx | 1 - sw/inc/pch/precompiled_msword.hxx | 1 - sw/inc/pch/precompiled_swui.hxx | 1 - sw/inc/pch/precompiled_vbaswobj.hxx | 1 - vbahelper/inc/pch/precompiled_msforms.hxx | 1 - vcl/inc/impdel.hxx | 81 +++++++++++++++++++++++++ vcl/inc/salframe.hxx | 1 + vcl/inc/window.h | 1 + xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx | 1 - 30 files changed, 86 insertions(+), 104 deletions(-) delete mode 100644 include/vcl/impdel.hxx create mode 100644 vcl/inc/impdel.hxx diff --git a/accessibility/inc/pch/precompiled_acc.hxx b/accessibility/inc/pch/precompiled_acc.hxx index ab8663a90ade..32ef6ba708ad 100644 --- a/accessibility/inc/pch/precompiled_acc.hxx +++ b/accessibility/inc/pch/precompiled_acc.hxx @@ -126,7 +126,6 @@ #include #include #include -#include #include #include #include diff --git a/basctl/inc/pch/precompiled_basctl.hxx b/basctl/inc/pch/precompiled_basctl.hxx index 184274a4182e..cdc9245df3ea 100644 --- a/basctl/inc/pch/precompiled_basctl.hxx +++ b/basctl/inc/pch/precompiled_basctl.hxx @@ -141,7 +141,6 @@ #include #include #include -#include #include #include #include diff --git a/chart2/inc/pch/precompiled_chartcontroller.hxx b/chart2/inc/pch/precompiled_chartcontroller.hxx index 360fa32722b9..7aa7fdd55a2b 100644 --- a/chart2/inc/pch/precompiled_chartcontroller.hxx +++ b/chart2/inc/pch/precompiled_chartcontroller.hxx @@ -130,7 +130,6 @@ #include #include #include -#include #include #include #include diff --git a/chart2/source/view/inc/GL3DBarChart.hxx b/chart2/source/view/inc/GL3DBarChart.hxx index 6cf7ee356a52..e7ae9ac4c1d5 100644 --- a/chart2/source/view/inc/GL3DBarChart.hxx +++ b/chart2/source/view/inc/GL3DBarChart.hxx @@ -12,6 +12,7 @@ #include +#include #include #include "VDataSeries.hxx" diff --git a/cppcanvas/inc/pch/precompiled_cppcanvas.hxx b/cppcanvas/inc/pch/precompiled_cppcanvas.hxx index 41fcc7ba2c45..fa5fc4a69e5a 100644 --- a/cppcanvas/inc/pch/precompiled_cppcanvas.hxx +++ b/cppcanvas/inc/pch/precompiled_cppcanvas.hxx @@ -104,7 +104,6 @@ #include #include #include -#include #include #include #include diff --git a/cui/inc/pch/precompiled_cui.hxx b/cui/inc/pch/precompiled_cui.hxx index f1a218e879e3..81841ceea124 100644 --- a/cui/inc/pch/precompiled_cui.hxx +++ b/cui/inc/pch/precompiled_cui.hxx @@ -139,7 +139,6 @@ #include #include #include -#include #include #include #include diff --git a/dbaccess/inc/pch/precompiled_dbmm.hxx b/dbaccess/inc/pch/precompiled_dbmm.hxx index ee91956ed240..4601561b47cd 100644 --- a/dbaccess/inc/pch/precompiled_dbmm.hxx +++ b/dbaccess/inc/pch/precompiled_dbmm.hxx @@ -107,7 +107,6 @@ #include #include #include -#include #include #include #include diff --git a/desktop/inc/pch/precompiled_sofficeapp.hxx b/desktop/inc/pch/precompiled_sofficeapp.hxx index a1cce467846d..5fdb0c3159ff 100644 --- a/desktop/inc/pch/precompiled_sofficeapp.hxx +++ b/desktop/inc/pch/precompiled_sofficeapp.hxx @@ -129,7 +129,6 @@ #include #include #include -#include #include #include #include diff --git a/editeng/inc/pch/precompiled_editeng.hxx b/editeng/inc/pch/precompiled_editeng.hxx index ee69b6b25a71..bd2786be5443 100644 --- a/editeng/inc/pch/precompiled_editeng.hxx +++ b/editeng/inc/pch/precompiled_editeng.hxx @@ -104,7 +104,6 @@ #include #include #include -#include #include #include #include diff --git a/framework/inc/pch/precompiled_fwe.hxx b/framework/inc/pch/precompiled_fwe.hxx index 65de7a840785..e2e00f42ccb2 100644 --- a/framework/inc/pch/precompiled_fwe.hxx +++ b/framework/inc/pch/precompiled_fwe.hxx @@ -111,7 +111,6 @@ #include #include #include -#include #include #include #include diff --git a/framework/inc/pch/precompiled_fwl.hxx b/framework/inc/pch/precompiled_fwl.hxx index 0e749989f595..296fed69f495 100644 --- a/framework/inc/pch/precompiled_fwl.hxx +++ b/framework/inc/pch/precompiled_fwl.hxx @@ -130,7 +130,6 @@ #include #include #include -#include #include #include #include diff --git a/include/vcl/impdel.hxx b/include/vcl/impdel.hxx deleted file mode 100644 index 95f373b1dcb9..000000000000 --- a/include/vcl/impdel.hxx +++ /dev/null @@ -1,81 +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_VCL_IMPDEL_HXX -#define INCLUDED_VCL_IMPDEL_HXX - -#include - -namespace vcl -{ - -class DeletionListener; - -class DeletionNotifier -{ - std::list< DeletionListener* > m_aListeners; - protected: - DeletionNotifier() {} - - ~DeletionNotifier() - { notifyDelete(); } - - inline void notifyDelete(); - - public: - void addDel( DeletionListener* pListener ) - { m_aListeners.push_back( pListener ); } - - void removeDel( DeletionListener* pListener ) - { m_aListeners.remove( pListener ); } -}; - -class DeletionListener -{ - DeletionNotifier* m_pNotifier; - public: - DeletionListener( DeletionNotifier* pNotifier ) - : m_pNotifier( pNotifier ) - { - if( m_pNotifier ) - m_pNotifier->addDel( this ); - } - ~DeletionListener() - { - if( m_pNotifier ) - m_pNotifier->removeDel( this ); - } - void deleted() { m_pNotifier = nullptr; } - bool isDeleted() const { return (m_pNotifier == nullptr); } -}; - -inline void DeletionNotifier::notifyDelete() -{ - for( std::list< DeletionListener* >::const_iterator it = - m_aListeners.begin(); it != m_aListeners.end(); ++it ) - (*it)->deleted(); - - m_aListeners.clear(); -} - -} // namespace vcl - -#endif // INCLUDED_VCL_IMPDEL_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx index 2846fa78cf03..e88bf463fd8c 100644 --- a/include/vcl/menu.hxx +++ b/include/vcl/menu.hxx @@ -32,6 +32,7 @@ #include #include #include +#include struct ImplSVEvent; struct MenuItemData; diff --git a/include/vcl/vclevent.hxx b/include/vcl/vclevent.hxx index c7f59dba9aee..4d15991c011b 100644 --- a/include/vcl/vclevent.hxx +++ b/include/vcl/vclevent.hxx @@ -22,7 +22,6 @@ #include #include -#include #include #include diff --git a/reportdesign/inc/pch/precompiled_rpt.hxx b/reportdesign/inc/pch/precompiled_rpt.hxx index 56d491a4e705..b6735fa4f488 100644 --- a/reportdesign/inc/pch/precompiled_rpt.hxx +++ b/reportdesign/inc/pch/precompiled_rpt.hxx @@ -129,7 +129,6 @@ #include #include #include -#include #include #include #include diff --git a/reportdesign/inc/pch/precompiled_rptui.hxx b/reportdesign/inc/pch/precompiled_rptui.hxx index 9e043ce55cd8..c6562fc7e43f 100644 --- a/reportdesign/inc/pch/precompiled_rptui.hxx +++ b/reportdesign/inc/pch/precompiled_rptui.hxx @@ -140,7 +140,6 @@ #include #include #include -#include #include #include #include diff --git a/sc/inc/pch/precompiled_sc.hxx b/sc/inc/pch/precompiled_sc.hxx index 36c82178ec62..8d4deaac5e99 100644 --- a/sc/inc/pch/precompiled_sc.hxx +++ b/sc/inc/pch/precompiled_sc.hxx @@ -140,7 +140,6 @@ #include #include #include -#include #include #include #include diff --git a/sc/source/core/inc/addinlis.hxx b/sc/source/core/inc/addinlis.hxx index 7442da923a23..6ab8ed649c17 100644 --- a/sc/source/core/inc/addinlis.hxx +++ b/sc/source/core/inc/addinlis.hxx @@ -25,6 +25,7 @@ #include #include #include +#include class ScDocument; diff --git a/sd/inc/pch/precompiled_sdui.hxx b/sd/inc/pch/precompiled_sdui.hxx index f638477a79b6..664d6941127e 100644 --- a/sd/inc/pch/precompiled_sdui.hxx +++ b/sd/inc/pch/precompiled_sdui.hxx @@ -137,7 +137,6 @@ #include #include #include -#include #include #include #include diff --git a/slideshow/inc/pch/precompiled_slideshow.hxx b/slideshow/inc/pch/precompiled_slideshow.hxx index bf9f9d08a36b..d4e156e72fd8 100644 --- a/slideshow/inc/pch/precompiled_slideshow.hxx +++ b/slideshow/inc/pch/precompiled_slideshow.hxx @@ -114,7 +114,6 @@ #include #include #include -#include #include #include #include diff --git a/svtools/inc/pch/precompiled_svt.hxx b/svtools/inc/pch/precompiled_svt.hxx index 93d558711003..ac017481a69e 100644 --- a/svtools/inc/pch/precompiled_svt.hxx +++ b/svtools/inc/pch/precompiled_svt.hxx @@ -121,7 +121,6 @@ #include #include #include -#include #include #include #include diff --git a/svx/inc/pch/precompiled_svxcore.hxx b/svx/inc/pch/precompiled_svxcore.hxx index fb36cd544a91..176cf84268cb 100644 --- a/svx/inc/pch/precompiled_svxcore.hxx +++ b/svx/inc/pch/precompiled_svxcore.hxx @@ -127,7 +127,6 @@ #include #include #include -#include #include #include #include diff --git a/sw/inc/pch/precompiled_msword.hxx b/sw/inc/pch/precompiled_msword.hxx index 4dac044d055c..7986563c5f29 100644 --- a/sw/inc/pch/precompiled_msword.hxx +++ b/sw/inc/pch/precompiled_msword.hxx @@ -140,7 +140,6 @@ #include #include #include -#include #include #include #include diff --git a/sw/inc/pch/precompiled_swui.hxx b/sw/inc/pch/precompiled_swui.hxx index c50184bc9d01..f49478c40a83 100644 --- a/sw/inc/pch/precompiled_swui.hxx +++ b/sw/inc/pch/precompiled_swui.hxx @@ -142,7 +142,6 @@ #include #include #include -#include #include #include #include diff --git a/sw/inc/pch/precompiled_vbaswobj.hxx b/sw/inc/pch/precompiled_vbaswobj.hxx index 611bfe694e4b..47753563c157 100644 --- a/sw/inc/pch/precompiled_vbaswobj.hxx +++ b/sw/inc/pch/precompiled_vbaswobj.hxx @@ -135,7 +135,6 @@ #include #include #include -#include #include #include #include diff --git a/vbahelper/inc/pch/precompiled_msforms.hxx b/vbahelper/inc/pch/precompiled_msforms.hxx index 306af94e5c26..51c918632ec3 100644 --- a/vbahelper/inc/pch/precompiled_msforms.hxx +++ b/vbahelper/inc/pch/precompiled_msforms.hxx @@ -118,7 +118,6 @@ #include #include #include -#include #include #include #include diff --git a/vcl/inc/impdel.hxx b/vcl/inc/impdel.hxx new file mode 100644 index 000000000000..95f373b1dcb9 --- /dev/null +++ b/vcl/inc/impdel.hxx @@ -0,0 +1,81 @@ +/* -*- 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_VCL_IMPDEL_HXX +#define INCLUDED_VCL_IMPDEL_HXX + +#include + +namespace vcl +{ + +class DeletionListener; + +class DeletionNotifier +{ + std::list< DeletionListener* > m_aListeners; + protected: + DeletionNotifier() {} + + ~DeletionNotifier() + { notifyDelete(); } + + inline void notifyDelete(); + + public: + void addDel( DeletionListener* pListener ) + { m_aListeners.push_back( pListener ); } + + void removeDel( DeletionListener* pListener ) + { m_aListeners.remove( pListener ); } +}; + +class DeletionListener +{ + DeletionNotifier* m_pNotifier; + public: + DeletionListener( DeletionNotifier* pNotifier ) + : m_pNotifier( pNotifier ) + { + if( m_pNotifier ) + m_pNotifier->addDel( this ); + } + ~DeletionListener() + { + if( m_pNotifier ) + m_pNotifier->removeDel( this ); + } + void deleted() { m_pNotifier = nullptr; } + bool isDeleted() const { return (m_pNotifier == nullptr); } +}; + +inline void DeletionNotifier::notifyDelete() +{ + for( std::list< DeletionListener* >::const_iterator it = + m_aListeners.begin(); it != m_aListeners.end(); ++it ) + (*it)->deleted(); + + m_aListeners.clear(); +} + +} // namespace vcl + +#endif // INCLUDED_VCL_IMPDEL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx index 11d95e825d70..134a6d6ecd32 100644 --- a/vcl/inc/salframe.hxx +++ b/vcl/inc/salframe.hxx @@ -20,6 +20,7 @@ #ifndef INCLUDED_VCL_INC_SALFRAME_HXX #define INCLUDED_VCL_INC_SALFRAME_HXX +#include "impdel.hxx" #include "salwtype.hxx" #include "salgeom.hxx" diff --git a/vcl/inc/window.h b/vcl/inc/window.h index db8bdfb0b6d1..e06a6b1d07c9 100644 --- a/vcl/inc/window.h +++ b/vcl/inc/window.h @@ -25,6 +25,7 @@ #include #include +#include #include #include diff --git a/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx b/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx index 38e0e10aacac..3c566596ea91 100644 --- a/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx +++ b/xmlsecurity/inc/pch/precompiled_xmlsecurity.hxx @@ -128,7 +128,6 @@ #include #include #include -#include #include #include #include -- cgit