summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-07-10 14:22:25 +0200
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-02-06 17:24:23 -0500
commitdddfa4432fa341a68638ecaaa1320fc73e2e0e34 (patch)
tree366732b5eeee84c30b866e7bedc2e2a32fa32fd4 /vcl
parent572d932792173d8e5e775f063cae5e5345ba4cf9 (diff)
vcl: remove boost/signal2/signal.hpp from header
The most relevant signal member function appears to be connect(), so let's create a wrapper function for that now, without the more esoteric ordering features for now. Move the signal member itself to a new pImpl. The benefits are worth it: preprocessor input reduced by 2.8GB, that's 9% of the total (excluding system headers which are not counted because they don't generate dependencies). Change-Id: I0aaeda51a5630a348bb12c81a83f67afbd508a14 (cherry picked from commit 20bd0a2ee9ed899ea542c2de08efda243dbef446)
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/control/combobox.cxx8
-rw-r--r--vcl/source/control/edit.cxx47
-rw-r--r--vcl/source/filter/wmf/wmf.cxx2
-rw-r--r--vcl/unx/generic/window/salframe.cxx2
4 files changed, 44 insertions, 15 deletions
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 15a3c0986588..9249acb8d616 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -284,8 +284,12 @@ void ComboBox::EnableAutocomplete( bool bEnable, bool bMatchCase )
if ( bEnable )
{
if( !m_pImpl->m_AutocompleteConnection.connected())
- m_pImpl->m_AutocompleteConnection = m_pImpl->m_pSubEdit->autocompleteSignal.connect(
- boost::bind( &ComboBox::Impl::ImplAutocompleteHandler, m_pImpl.get(), _1 ) );
+ {
+ m_pImpl->m_pSubEdit->SignalConnectAutocomplete(
+ &m_pImpl->m_AutocompleteConnection,
+ [this] (Edit *const pEdit) { m_pImpl->ImplAutocompleteHandler(pEdit); }
+ );
+ }
}
else
m_pImpl->m_AutocompleteConnection.disconnect();
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index ec786c054c23..75666df9aa0f 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -65,6 +65,9 @@
#include <vcl/unohelp2.hxx>
#include <officecfg/Office/Common.hxx>
+
+#include <boost/signals2/signal.hpp>
+
#include <memory>
using namespace ::com::sun::star;
@@ -154,21 +157,29 @@ void Impl_IMEInfos::DestroyAttribs()
nLen = 0;
}
-Edit::Edit( WindowType nType ) :
- Control( nType )
+struct Edit::Impl
+{
+ boost::signals2::signal< void (Edit *) > m_AutocompleteSignal;
+};
+
+Edit::Edit( WindowType nType )
+ : Control( nType )
+ , m_pImpl(new Impl)
{
ImplInitEditData();
}
-Edit::Edit( vcl::Window* pParent, WinBits nStyle ) :
- Control( WINDOW_EDIT )
+Edit::Edit( vcl::Window* pParent, WinBits nStyle )
+ : Control( WINDOW_EDIT )
+ , m_pImpl(new Impl)
{
ImplInitEditData();
ImplInit( pParent, nStyle );
}
-Edit::Edit( vcl::Window* pParent, const ResId& rResId ) :
- Control( WINDOW_EDIT )
+Edit::Edit( vcl::Window* pParent, const ResId& rResId )
+ : Control( WINDOW_EDIT )
+ , m_pImpl(new Impl)
{
rResId.SetRT( RSC_EDIT );
WinBits nStyle = ImplInitRes( rResId );
@@ -1648,12 +1659,12 @@ bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
ImplCopyToSelectionClipboard();
}
- if ( bGoEnd && !autocompleteSignal.empty() && !rKEvt.GetKeyCode().GetModifier() )
+ if (bGoEnd && !m_pImpl->m_AutocompleteSignal.empty() && !rKEvt.GetKeyCode().GetModifier())
{
if ( (maSelection.Min() == maSelection.Max()) && (maSelection.Min() == maText.getLength()) )
{
meAutocompleteAction = AUTOCOMPLETE_KEYINPUT;
- autocompleteSignal( this );
+ m_pImpl->m_AutocompleteSignal( this );
}
}
@@ -1748,12 +1759,12 @@ bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
if ( !mbReadOnly )
{
ImplInsertText(OUString(rKEvt.GetCharCode()), 0, true);
- if ( !autocompleteSignal.empty() )
+ if (!m_pImpl->m_AutocompleteSignal.empty())
{
if ( (maSelection.Min() == maSelection.Max()) && (maSelection.Min() == maText.getLength()) )
{
meAutocompleteAction = AUTOCOMPLETE_KEYINPUT;
- autocompleteSignal( this );
+ m_pImpl->m_AutocompleteSignal( this );
}
}
}
@@ -2114,12 +2125,12 @@ void Edit::Command( const CommandEvent& rCEvt )
Invalidate();
// #i25161# call auto complete handler for ext text commit also
- if ( autocompleteSignal.empty() )
+ if (m_pImpl->m_AutocompleteSignal.empty())
{
if ( (maSelection.Min() == maSelection.Max()) && (maSelection.Min() == maText.getLength()) )
{
meAutocompleteAction = AUTOCOMPLETE_KEYINPUT;
- autocompleteSignal( this );
+ m_pImpl->m_AutocompleteSignal( this );
}
}
}
@@ -2731,7 +2742,7 @@ void Edit::SetSubEdit(Edit* pEdit)
mpSubEdit->mbIsSubEdit = true;
mpSubEdit->SetReadOnly(mbReadOnly);
- mpSubEdit->autocompleteSignal.connect(autocompleteSignal);
+ mpSubEdit->m_pImpl->m_AutocompleteSignal.connect(m_pImpl->m_AutocompleteSignal);
}
}
@@ -3058,4 +3069,14 @@ Selection Edit::GetSurroundingTextSelection() const
return GetSelection();
}
+void Edit::SignalConnectAutocomplete(
+ boost::signals2::connection *const pConnection,
+ std::function<void (Edit *)> slot)
+{
+ boost::signals2::connection const& rConnection(
+ m_pImpl->m_AutocompleteSignal.connect(slot));
+ if (pConnection)
+ *pConnection = rConnection;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/filter/wmf/wmf.cxx b/vcl/source/filter/wmf/wmf.cxx
index 21ab4a46c8be..c566bc3e7b04 100644
--- a/vcl/source/filter/wmf/wmf.cxx
+++ b/vcl/source/filter/wmf/wmf.cxx
@@ -24,6 +24,8 @@
#include <vcl/gdimetafiletools.hxx>
#include <comphelper/scopeguard.hxx>
+#include <boost/bind.hpp>
+
bool ConvertWMFToGDIMetaFile( SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile, FilterConfigItem* pConfigItem, WMF_EXTERNALHEADER *pExtHeader )
{
sal_uInt32 nMetaType;
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index 7c6000c5e5a7..756f42e1b49e 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -70,6 +70,8 @@
#include "svids.hrc"
#include "impbmp.hxx"
+#include <boost/optional.hpp>
+
#include <algorithm>
#ifndef Button6