cui/source/inc/macroass.hxx      |    2 ++
 cui/source/tabpages/macroass.cxx |   21 ++++++++++++++++++---
 2 files changed, 20 insertions(+), 3 deletions(-)

New commits:
commit 4b699f5b6f384529f49c3ffc3ad06d5afe245e76
Author: Michael Stahl <[email protected]>
Date:   Tue Dec 4 22:43:46 2012 +0100

    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

diff --git a/cui/source/inc/macroass.hxx b/cui/source/inc/macroass.hxx
index 8172c0d..b747742 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 f2abc5a..e91d3fb 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()
_______________________________________________
Libreoffice-commits mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to