Resolves: tdf#100619 vclptr assert with menu set to menubutton

Change-Id: I2e621567e3bbc01d6f52844014dba9e46fe79f41
This commit is contained in:
Caolán McNamara
2016-06-26 21:01:36 +01:00
parent d1051a203a
commit 2184b08dd1
2 changed files with 14 additions and 8 deletions

View File

@@ -3090,6 +3090,8 @@ bool SvxConfigEntry::IsRenamable()
SvxToolbarConfigPage::SvxToolbarConfigPage(vcl::Window *pParent, const SfxItemSet& rSet)
: SvxConfigPage(pParent, rSet)
, m_pMenu(CUI_RES(MODIFY_TOOLBAR))
, m_pEntry(CUI_RES(MODIFY_TOOLBAR_CONTENT))
{
SetHelpId( HID_SVX_CONFIG_TOOLBAR );
@@ -3134,19 +3136,17 @@ SvxToolbarConfigPage::SvxToolbarConfigPage(vcl::Window *pParent, const SfxItemSe
m_pMoveDownButton->Enable();
m_pMoveUpButton->Enable();
VclPtrInstance<PopupMenu> pMenu( CUI_RES( MODIFY_TOOLBAR ) );
pMenu->SetMenuFlags(
pMenu->GetMenuFlags() | MenuFlags::AlwaysShowDisabledEntries );
m_pMenu->SetMenuFlags(
m_pMenu->GetMenuFlags() | MenuFlags::AlwaysShowDisabledEntries );
m_pModifyTopLevelButton->SetPopupMenu( pMenu );
m_pModifyTopLevelButton->SetPopupMenu( m_pMenu );
m_pModifyTopLevelButton->SetSelectHdl(
LINK( this, SvxToolbarConfigPage, ToolbarSelectHdl ) );
VclPtrInstance<PopupMenu> pEntry( CUI_RES( MODIFY_TOOLBAR_CONTENT ) );
pEntry->SetMenuFlags(
pEntry->GetMenuFlags() | MenuFlags::AlwaysShowDisabledEntries );
m_pEntry->SetMenuFlags(
m_pEntry->GetMenuFlags() | MenuFlags::AlwaysShowDisabledEntries );
m_pModifyCommandButton->SetPopupMenu( pEntry );
m_pModifyCommandButton->SetPopupMenu(m_pEntry);
m_pModifyCommandButton->SetSelectHdl(
LINK( this, SvxToolbarConfigPage, EntrySelectHdl ) );
@@ -3184,6 +3184,9 @@ void SvxToolbarConfigPage::dispose()
}
m_pSaveInListBox->Clear();
m_pEntry.disposeAndClear();
m_pMenu.disposeAndClear();
SvxConfigPage::dispose();
}

View File

@@ -575,6 +575,9 @@ private:
void DeleteSelectedContent() override;
void DeleteSelectedTopLevel() override;
VclPtrInstance<PopupMenu> m_pMenu;
VclPtrInstance<PopupMenu> m_pEntry;
public:
SvxToolbarConfigPage( vcl::Window *pParent, const SfxItemSet& rItemSet );
virtual ~SvxToolbarConfigPage();