summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-12-04 22:43:46 +0100
committerMichael Stahl <mstahl@redhat.com>2012-12-04 23:52:17 +0100
commit5d84af7e83404f22d3c9cd0b0bb88fb84d0550e7 (patch)
tree5b2f0771334525525bd17c8d9bf28bca3be0720b /cui
parent60b0a466ec6df97df14e7341228b8f8c2c48f8dc (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')
-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()