Kaydet (Commit) 9bb32c66 authored tarafından Jan Holesovsky's avatar Jan Holesovsky Kaydeden (comit) Aron Budea

sc: Get rid of the Idle hack in the Special Filter Dialog.

The problem is that with LOK, the creation of Idle here causes a
deadlock when the dialog is being opened and its first paint is
requested.

No real idea what change now causes the problem (this used to work), but
given that the use of the Idle is a hack in the first place, let's use
the GetFocus/LoseFocus handlers instead, and act accordingly only when
the focus of the interesting controls changes.

Change-Id: Ib6c0267a064cb31438544e47fe3e0869b575ef7c
Reviewed-on: https://gerrit.libreoffice.org/70917Reviewed-by: 's avatarAron Budea <aron.budea@collabora.com>
Tested-by: 's avatarAron Budea <aron.budea@collabora.com>
üst ec742cca
......@@ -57,8 +57,7 @@ ScSpecialFilterDlg::ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, vc
pViewData ( nullptr ),
pDoc ( nullptr ),
pRefInputEdit ( nullptr ),
bRefInputMode ( false ),
pIdle ( nullptr )
bRefInputMode ( false )
{
get(pLbFilterArea,"lbfilterarea");
get(pEdFilterArea,"edfilterarea");
......@@ -83,14 +82,18 @@ ScSpecialFilterDlg::ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, vc
get(pExpander,"more");
Init( rArgSet );
pEdFilterArea->GrabFocus();
// hack: control of RefInput
pIdle = new Idle("Special Filter Dialog");
// FIXME: this is an abomination
pIdle->SetPriority( TaskPriority::LOWEST );
pIdle->SetInvokeHandler( LINK( this, ScSpecialFilterDlg, TimeOutHdl ) );
pIdle->Start();
Link<Control&, void> aLink = LINK(this, ScSpecialFilterDlg, RefInputControlHdl);
pEdCopyArea->SetGetFocusHdl(aLink);
pRbCopyArea->SetGetFocusHdl(aLink);
pEdFilterArea->SetGetFocusHdl(aLink);
pRbFilterArea->SetGetFocusHdl(aLink);
pEdCopyArea->SetLoseFocusHdl(aLink);
pRbCopyArea->SetLoseFocusHdl(aLink);
pEdFilterArea->SetLoseFocusHdl(aLink);
pRbFilterArea->SetLoseFocusHdl(aLink);
pEdFilterArea->GrabFocus();
}
ScSpecialFilterDlg::~ScSpecialFilterDlg()
......@@ -109,10 +112,6 @@ void ScSpecialFilterDlg::dispose()
delete pOutItem;
// hack: control of RefInput
pIdle->Stop();
delete pIdle;
pLbFilterArea.clear();
pEdFilterArea.clear();
pRbFilterArea.clear();
......@@ -389,11 +388,9 @@ IMPL_LINK( ScSpecialFilterDlg, EndDlgHdl, Button*, pBtn, void )
}
}
IMPL_LINK( ScSpecialFilterDlg, TimeOutHdl, Timer*, _pIdle, void )
IMPL_LINK_NOARG(ScSpecialFilterDlg, RefInputControlHdl, Control&, void)
{
// every 50ms check whether RefInputMode is still true
if( (_pIdle == pIdle) && IsActive() )
if (IsActive())
{
if( pEdCopyArea->HasFocus() || pRbCopyArea->HasFocus() )
{
......@@ -411,8 +408,6 @@ IMPL_LINK( ScSpecialFilterDlg, TimeOutHdl, Timer*, _pIdle, void )
bRefInputMode = false;
}
}
pIdle->Start();
}
IMPL_LINK( ScSpecialFilterDlg, FilterAreaSelHdl, ListBox&, rLb, void )
......
......@@ -206,9 +206,6 @@ private:
VclPtr<formula::RefEdit> pRefInputEdit;
bool bRefInputMode;
// Hack: RefInput control
Idle* pIdle;
private:
void Init( const SfxItemSet& rArgSet );
ScQueryItem* GetOutputItem( const ScQueryParam& rParam,
......@@ -219,8 +216,8 @@ private:
DECL_LINK( FilterAreaModHdl, Edit&, void );
DECL_LINK( EndDlgHdl, Button*, void );
// Hack: RefInput control
DECL_LINK( TimeOutHdl, Timer*, void );
// RefInput control
DECL_LINK( RefInputControlHdl, Control&, void );
};
#endif // INCLUDED_SC_SOURCE_UI_INC_FILTDLG_HXX
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment