Kaydet (Commit) d92d7e49 authored tarafından Caolán McNamara's avatar Caolán McNamara

crash on toggling "empty" menu in basic's language toolbar

tools->macros->organize->basic->edit

drag language toolbar to undock, click down arrow in pseudo-title bar to get
"no selection possible" entry. click down arrow again to dismiss it.

get debug stl iterator error

the mpSalMenu goes out of sync with its owner

Change-Id: If82aac004e623787389dd415c2006b99778f710d
üst d9da9b44
......@@ -185,6 +185,10 @@ protected:
SAL_DLLPRIVATE void ImplAddDel( ImplMenuDelData &rDel );
SAL_DLLPRIVATE void ImplRemoveDel( ImplMenuDelData &rDel );
SAL_DLLPRIVATE MenuItemData* NbcInsertItem(sal_uInt16 nId, MenuItemBits nBits,
const OUString& rStr, Menu* pMenu,
size_t nPos, const OString &rIdent);
/// Close the 'pStartedFrom' menu window.
virtual void ClosePopup(Menu* pMenu) = 0;
......
......@@ -366,6 +366,21 @@ void Menu::RemoveEventListener( const Link& rEventListener )
maEventListeners.removeListener( rEventListener );
}
MenuItemData* Menu::NbcInsertItem(sal_uInt16 nId, MenuItemBits nBits,
const OUString& rStr, Menu* pMenu,
size_t nPos, const OString &rIdent)
{
// put Item in MenuItemList
MenuItemData* pData = pItemList->Insert(nId, MenuItemType::STRING,
nBits, rStr, Image(), pMenu, nPos, rIdent);
// update native menu
if (ImplGetSalMenu() && pData->pSalMenuItem)
ImplGetSalMenu()->InsertItem(pData->pSalMenuItem, nPos);
return pData;
}
void Menu::InsertItem(sal_uInt16 nItemId, const OUString& rStr, MenuItemBits nItemBits,
const OString &rIdent, sal_uInt16 nPos)
{
......@@ -378,12 +393,7 @@ void Menu::InsertItem(sal_uInt16 nItemId, const OUString& rStr, MenuItemBits nIt
nPos = MENU_APPEND;
// put Item in MenuItemList
MenuItemData* pData = pItemList->Insert(nItemId, MenuItemType::STRING,
nItemBits, rStr, Image(), this, nPos, rIdent);
// update native menu
if( ImplGetSalMenu() && pData->pSalMenuItem )
ImplGetSalMenu()->InsertItem( pData->pSalMenuItem, nPos );
NbcInsertItem(nItemId, nItemBits, rStr, this, nPos, rIdent);
vcl::Window* pWin = ImplGetWindow();
delete mpLayoutData, mpLayoutData = NULL;
......@@ -2877,8 +2887,8 @@ sal_uInt16 PopupMenu::ImplExecute( vcl::Window* pW, const Rectangle& rRect, sal_
if( pResMgr )
{
OUString aTmpEntryText( ResId( SV_RESID_STRING_NOSELECTIONPOSSIBLE, *pResMgr ) );
MenuItemData* pData = pItemList->Insert(
0xFFFF, MenuItemType::STRING, MenuItemBits::NONE, aTmpEntryText, Image(), NULL, 0xFFFF, OString() );
MenuItemData* pData = NbcInsertItem(0xFFFF, MenuItemBits::NONE, aTmpEntryText, NULL, 0xFFFF, OString());
size_t nPos = 0;
pData = pItemList->GetData( pData->nId, nPos );
assert(pData);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment