summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-07-10 14:22:25 +0200
committerMichael Stahl <mstahl@redhat.com>2015-07-10 23:27:40 +0200
commit20bd0a2ee9ed899ea542c2de08efda243dbef446 (patch)
tree6b91afd982d11bec1e4e48b67a38bee3c6109ea6 /vcl
parentece8699f8f22f6bae137c601bc29b83b75dc3bf3 (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
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 ce1d9bb8b73c..43ba36c26f1e 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 );
@@ -1639,12 +1650,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 );
}
}
@@ -1739,12 +1750,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 );
}
}
}
@@ -2103,12 +2114,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 );
}
}
}
@@ -2720,7 +2731,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);
}
}
@@ -3047,4 +3058,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 4ce6f75aee82..d11e52056b89 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