embeddedobj/source/commonembedding/xfactory.hxx | 2 - include/vcl/menu.hxx | 4 +++ vcl/source/window/menu.cxx | 26 ++++++++++++++++-------- 3 files changed, 23 insertions(+), 9 deletions(-)
New commits: commit d92d7e4919311a1cf18b34dbb3d03bbc4f962f43 Author: Caolán McNamara <caol...@redhat.com> Date: Mon Feb 2 16:18:08 2015 +0000 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 diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx index a5a1ec4..9466443 100644 --- a/include/vcl/menu.hxx +++ b/include/vcl/menu.hxx @@ -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; diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 30b8cdc..078e1bb 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -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); commit d9da9b441185a730f2677da6aa6393468b4cf3ff Author: Caolán McNamara <caol...@redhat.com> Date: Mon Feb 2 15:15:39 2015 +0000 add an explicit virtual keyword here, like the other ones Change-Id: I4c5acf42d5ec33df1dd18dc3a70be7de838c9ff3 diff --git a/embeddedobj/source/commonembedding/xfactory.hxx b/embeddedobj/source/commonembedding/xfactory.hxx index 672eb6c..bd0eaf24 100644 --- a/embeddedobj/source/commonembedding/xfactory.hxx +++ b/embeddedobj/source/commonembedding/xfactory.hxx @@ -66,7 +66,7 @@ public: virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceLink( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const OUString& sEntName, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aMediaDescr, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; // XLinkFactory - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceLinkUserInit( const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID, const OUString& aClassName, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const OUString& sEntName, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE; + virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceLinkUserInit( const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID, const OUString& aClassName, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const OUString& sEntName, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE; // XServiceInfo virtual OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits