Kaydet (Commit) 5d84af7e authored tarafından Michael Stahl's avatar Michael Stahl

fdo#57553: Picture dialog Macro tab page: lazily init

... because JVM startup is annoying, so delay it until really activating
Macro tab.  This patch is sort of lame but with the change in
bd2c14ec what can you do...

Change-Id: I01fe03abf3e4582e87927729286a21d0bac7037c
üst 60b0a466
......@@ -67,6 +67,8 @@ public:
virtual void ScriptChanged();
virtual void PageCreated (SfxAllItemSet aSet);
using TabPage::ActivatePage; // FIXME WTF is this nonsense?
virtual void ActivatePage( const SfxItemSet& );
// --------- inherit from the base -------------
virtual sal_Bool FillItemSet( SfxItemSet& rSet );
......
......@@ -64,6 +64,7 @@ public:
sal_Bool bReadOnly;
Timer maFillGroupTimer;
sal_Bool bGotEvents;
bool m_bDummyActivated; ///< has this tab page already been activated
};
_SfxMacroTabPage_Impl::_SfxMacroTabPage_Impl( void ) :
......@@ -79,6 +80,7 @@ _SfxMacroTabPage_Impl::_SfxMacroTabPage_Impl( void ) :
pMacroStr( NULL ),
bReadOnly( sal_False ),
bGotEvents( sal_False )
, m_bDummyActivated(false)
{
}
......@@ -214,6 +216,22 @@ sal_Bool _SfxMacroTabPage::FillItemSet( SfxItemSet& rSet )
return sal_False;
}
void _SfxMacroTabPage::ActivatePage( const SfxItemSet& )
{
// fdo#57553 lazily init script providers, because it is annoying if done
// on dialog open (SfxTabDialog::Start_Impl activates all tab pages once!)
if (!mpImpl->m_bDummyActivated)
{
mpImpl->m_bDummyActivated = true;
}
else if (!mpImpl->maFillGroupTimer.GetTimeoutHdl().IsSet())
{
mpImpl->maFillGroupTimer.SetTimeoutHdl( STATIC_LINK( this, _SfxMacroTabPage, TimeOut_Impl ) );
mpImpl->maFillGroupTimer.SetTimeout( 0 );
mpImpl->maFillGroupTimer.Start();
}
}
void _SfxMacroTabPage::PageCreated (SfxAllItemSet aSet)
{
const SfxPoolItem* pEventsItem;
......@@ -398,9 +416,6 @@ void _SfxMacroTabPage::InitAndSetHandler()
mpImpl->pGroupLB->SetFunctionListBox( mpImpl->pMacroLB );
mpImpl->maFillGroupTimer.SetTimeoutHdl( STATIC_LINK( this, _SfxMacroTabPage, TimeOut_Impl ) );
mpImpl->maFillGroupTimer.SetTimeout( 0 );
mpImpl->maFillGroupTimer.Start();
}
void _SfxMacroTabPage::FillMacroList()
......
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