summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-12-04 22:43:46 +0100
committerPetr Mladek <pmladek@suse.cz>2012-12-05 09:56:20 +0100
commit4b699f5b6f384529f49c3ffc3ad06d5afe245e76 (patch)
treea8b92cd1e46ec027d4ddf03f7a21970655881af0 /cui/source
parent1b61ab607e01bda6c25dedd252d1555705ac7463 (diff)
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 bd2c14ec78a7549d4a19738154cdd5ea890f61c4 what can you do... Change-Id: I01fe03abf3e4582e87927729286a21d0bac7037c
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/inc/macroass.hxx2
-rw-r--r--cui/source/tabpages/macroass.cxx21
2 files changed, 20 insertions, 3 deletions
diff --git a/cui/source/inc/macroass.hxx b/cui/source/inc/macroass.hxx
index 8172c0d98c84..b7477422687d 100644
--- a/cui/source/inc/macroass.hxx
+++ b/cui/source/inc/macroass.hxx
@@ -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 );
diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx
index f2abc5ae2d74..e91d3fbde5ec 100644
--- a/cui/source/tabpages/macroass.cxx
+++ b/cui/source/tabpages/macroass.cxx
@@ -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()