diff options
Diffstat (limited to 'framework/source/uielement/toolbarsmenucontroller.cxx')
-rw-r--r-- | framework/source/uielement/toolbarsmenucontroller.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx index cca476f6796d..5321064ef9d9 100644 --- a/framework/source/uielement/toolbarsmenucontroller.cxx +++ b/framework/source/uielement/toolbarsmenucontroller.cxx @@ -445,9 +445,10 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& r { SolarMutexGuard aGuard; VCLXPopupMenu* pXPopupMenu = (VCLXPopupMenu *)VCLXMenu::GetImplementation( m_xPopupMenu ); - PopupMenu* pVCLPopupMenu = (PopupMenu *)pXPopupMenu->GetMenu(); - - pVCLPopupMenu->SetUserValue( nIndex, sal_uIntPtr( aSortedTbs[i].bContextSensitive ? 1L : 0L )); + PopupMenu* pVCLPopupMenu = pXPopupMenu ? (PopupMenu *)pXPopupMenu->GetMenu() : NULL; + assert(pVCLPopupMenu); + if (pVCLPopupMenu) + pVCLPopupMenu->SetUserValue( nIndex, sal_uIntPtr( aSortedTbs[i].bContextSensitive ? 1L : 0L )); } // use VCL popup menu pointer to set vital information that are not part of the awt implementation |