From cfe7f8750ce4b63e48a69557c8aed6d8523f8896 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 3 May 2013 17:17:10 +0100 Subject: fdo#62797 fix macro assign dialog Which was empty of contents e.g. from autotext->macro... because of 5d84af7e83404f22d3c9cd0b0bb88fb84d0550e7 "fdo#57553: Picture dialog Macro tab page: lazily init" which was because of bd2c14ec78a7549d4a19738154cdd5ea890f61c4 "we have to have all tabpages in all modes now" which was because we need to create all tabpages in order to determine their size for layout. Change-Id: I01fe03abf3e4582e87927729286a21d0bac7037c Change-Id: Ic662f6a927225b56820ccebf135b82ab1631974d Signed-off-by: Andras Timar --- cui/source/inc/macroass.hxx | 1 + cui/source/tabpages/macroass.cxx | 31 +++++++++++++++++++++++-------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/cui/source/inc/macroass.hxx b/cui/source/inc/macroass.hxx index b7477422687d..11185ddc7180 100644 --- a/cui/source/inc/macroass.hxx +++ b/cui/source/inc/macroass.hxx @@ -69,6 +69,7 @@ public: virtual void PageCreated (SfxAllItemSet aSet); using TabPage::ActivatePage; // FIXME WTF is this nonsense? virtual void ActivatePage( const SfxItemSet& ); + void LaunchFillGroup(); // --------- 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 e91d3fbde5ec..4e2043231558 100644 --- a/cui/source/tabpages/macroass.cxx +++ b/cui/source/tabpages/macroass.cxx @@ -216,6 +216,16 @@ sal_Bool _SfxMacroTabPage::FillItemSet( SfxItemSet& rSet ) return sal_False; } +void _SfxMacroTabPage::LaunchFillGroup() +{ + if (!mpImpl->maFillGroupTimer.GetTimeoutHdl().IsSet()) + { + mpImpl->maFillGroupTimer.SetTimeoutHdl( STATIC_LINK( this, _SfxMacroTabPage, TimeOut_Impl ) ); + mpImpl->maFillGroupTimer.SetTimeout( 0 ); + mpImpl->maFillGroupTimer.Start(); + } +} + void _SfxMacroTabPage::ActivatePage( const SfxItemSet& ) { // fdo#57553 lazily init script providers, because it is annoying if done @@ -223,13 +233,9 @@ void _SfxMacroTabPage::ActivatePage( const SfxItemSet& ) if (!mpImpl->m_bDummyActivated) { mpImpl->m_bDummyActivated = true; + return; } - else if (!mpImpl->maFillGroupTimer.GetTimeoutHdl().IsSet()) - { - mpImpl->maFillGroupTimer.SetTimeoutHdl( STATIC_LINK( this, _SfxMacroTabPage, TimeOut_Impl ) ); - mpImpl->maFillGroupTimer.SetTimeout( 0 ); - mpImpl->maFillGroupTimer.Start(); - } + LaunchFillGroup(); } void _SfxMacroTabPage::PageCreated (SfxAllItemSet aSet) @@ -481,17 +487,26 @@ SfxMacroTabPage::SfxMacroTabPage( Window* pParent, const ResId& rResId, const Re ScriptChanged(); } +namespace +{ + SfxMacroTabPage* CreateSfxMacroTabPage( Window* pParent, const SfxItemSet& rAttrSet ) + { + return new SfxMacroTabPage( pParent, CUI_RES( RID_SVXPAGE_EVENTASSIGN ), NULL, rAttrSet ); + } +} + SfxTabPage* SfxMacroTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet ) { - return new SfxMacroTabPage( pParent, CUI_RES( RID_SVXPAGE_EVENTASSIGN ), NULL, rAttrSet ); + return CreateSfxMacroTabPage(pParent, rAttrSet); } SfxMacroAssignDlg::SfxMacroAssignDlg( Window* pParent, const Reference< XFrame >& rxDocumentFrame, const SfxItemSet& rSet ) : SfxSingleTabDialog( pParent, rSet, 0 ) { - SfxTabPage* pPage = SfxMacroTabPage::Create( this, rSet ); + SfxMacroTabPage* pPage = CreateSfxMacroTabPage(this, rSet); pPage->SetFrame( rxDocumentFrame ); SetTabPage( pPage ); + pPage->LaunchFillGroup(); } SfxMacroAssignDlg::~SfxMacroAssignDlg() -- cgit v1.2.3