diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-06-26 21:01:36 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-06-26 21:03:09 +0100 |
commit | 2184b08dd185f3f20d8b2098d3f652aed629b51f (patch) | |
tree | a735246cdc92b0d69d819b06c47994d9ce1a7aac /cui/source | |
parent | d1051a203a7f89997128313f6a4f065f51f6c00d (diff) |
Resolves: tdf#100619 vclptr assert with menu set to menubutton
Change-Id: I2e621567e3bbc01d6f52844014dba9e46fe79f41
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/customize/cfg.cxx | 19 | ||||
-rw-r--r-- | cui/source/inc/cfg.hxx | 3 |
2 files changed, 14 insertions, 8 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 1b08c29ebeea..346a2cf457d9 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -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(); } diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx index 9ca82b462158..b9ca0d55b7cd 100644 --- a/cui/source/inc/cfg.hxx +++ b/cui/source/inc/cfg.hxx @@ -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(); |