diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2014-09-14 15:45:02 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2014-09-14 22:07:17 +0200 |
commit | 051b29e1025253f35f87a04e297760aa8b40611f (patch) | |
tree | f836152e4e5db963740760d05d1d5358776493e3 /vcl/source/control/edit.cxx | |
parent | d6a83d3f91336e23b51bfc3b3d58da799760829f (diff) |
convert Edit autocomplete Hdl to boost signals2
Here it also keep track of the connection, as it needs to be explicitly
disconnected in one place.
Change-Id: Id3e2882106ae55c2d880898956a36f84d3ce70ef
Diffstat (limited to 'vcl/source/control/edit.cxx')
-rw-r--r-- | vcl/source/control/edit.cxx | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 287339c33b65..404a0a00d2de 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -1615,12 +1615,12 @@ bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt ) ImplCopyToSelectionClipboard(); } - if ( bGoEnd && maAutocompleteHdl.IsSet() && !rKEvt.GetKeyCode().GetModifier() ) + if ( bGoEnd && !autocompleteSignal.empty() && !rKEvt.GetKeyCode().GetModifier() ) { if ( (maSelection.Min() == maSelection.Max()) && (maSelection.Min() == maText.getLength()) ) { meAutocompleteAction = AUTOCOMPLETE_KEYINPUT; - maAutocompleteHdl.Call( this ); + autocompleteSignal( this ); } } @@ -1686,7 +1686,7 @@ bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt ) not suddenly to cycle the autocompletion case KEY_TAB: { - if ( !mbReadOnly && maAutocompleteHdl.IsSet() && + if ( !mbReadOnly && !autocompleteSignal.empty() && maSelection.Min() && (maSelection.Min() == maText.Len()) && !rKEvt.GetKeyCode().IsMod1() && !rKEvt.GetKeyCode().IsMod2() ) { @@ -1697,7 +1697,7 @@ bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt ) else meAutocompleteAction = AUTOCOMPLETE_TABFORWARD; - maAutocompleteHdl.Call( this ); + autocompleteSignal( this ); // Wurde nichts veraendert, dann TAB fuer DialogControl if ( GetSelection().Len() ) @@ -1715,12 +1715,12 @@ bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt ) if ( !mbReadOnly ) { ImplInsertText(OUString(rKEvt.GetCharCode()), 0, true); - if ( maAutocompleteHdl.IsSet() ) + if ( !autocompleteSignal.empty() ) { if ( (maSelection.Min() == maSelection.Max()) && (maSelection.Min() == maText.getLength()) ) { meAutocompleteAction = AUTOCOMPLETE_KEYINPUT; - maAutocompleteHdl.Call( this ); + autocompleteSignal( this ); } } } @@ -2080,12 +2080,12 @@ void Edit::Command( const CommandEvent& rCEvt ) ImplModified(); // #i25161# call auto complete handler for ext text commit also - if ( maAutocompleteHdl.IsSet() ) + if ( autocompleteSignal.empty() ) { if ( (maSelection.Min() == maSelection.Max()) && (maSelection.Min() == maText.getLength()) ) { meAutocompleteAction = AUTOCOMPLETE_KEYINPUT; - maAutocompleteHdl.Call( this ); + autocompleteSignal( this ); } } } @@ -2446,13 +2446,6 @@ void Edit::SetReadOnly( bool bReadOnly ) } } -void Edit::SetAutocompleteHdl( const Link& rHdl ) -{ - maAutocompleteHdl = rHdl; - if ( mpSubEdit ) - mpSubEdit->SetAutocompleteHdl( rHdl ); -} - void Edit::SetInsertMode( bool bInsert ) { if ( bInsert != mbInsertMode ) @@ -2709,6 +2702,7 @@ void Edit::SetSubEdit( Edit* pEdit ) mpSubEdit->mbIsSubEdit = true; mpSubEdit->SetReadOnly( mbReadOnly ); + mpSubEdit->autocompleteSignal.connect( autocompleteSignal ); } } |