diff options
-rw-r--r-- | starmath/source/edit.cxx | 28 | ||||
-rw-r--r-- | starmath/source/view.cxx | 15 | ||||
-rw-r--r-- | starmath/util/makefile.mk | 5 |
3 files changed, 39 insertions, 9 deletions
diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx index d5f2695c3bbb..f1c025bc230c 100644 --- a/starmath/source/edit.cxx +++ b/starmath/source/edit.cxx @@ -2,9 +2,9 @@ * * $RCSfile: edit.cxx,v $ * - * $Revision: 1.22 $ + * $Revision: 1.23 $ * - * last change: $Author: tl $ $Date: 2002-06-13 14:41:41 $ + * last change: $Author: tl $ $Date: 2002-07-22 13:21:44 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -74,6 +74,11 @@ #include <drafts/com/sun/star/accessibility/AccessibleStateType.hpp> #endif +#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ +#include <toolkit/helper/vclunohelper.hxx> +#endif + + #include "starmath.hrc" #define ITEMID_FONT 1 #define ITEMID_FONTHEIGHT 2 @@ -398,10 +403,27 @@ void SmEditWindow::Command(const CommandEvent& rCEvt) { GetParent()->ToTop(); + Point aPoint = rCEvt.GetMousePosPixel(); PopupMenu* pPopupMenu = new PopupMenu(SmResId(RID_COMMANDMENU)); + + // added for replaceability of context menus #96085, #93782 + Menu* pMenu = NULL; + ::com::sun::star::ui::ContextMenuExecuteEvent aEvent; + aEvent.SourceWindow = VCLUnoHelper::GetInterface( this ); + aEvent.ExecutePosition.X = aPoint.X(); + aEvent.ExecutePosition.Y = aPoint.Y(); + if ( GetView()->TryContextMenuInterception( *pPopupMenu, pMenu, aEvent ) ) + { + if ( pMenu ) + { + delete pPopupMenu; + pPopupMenu = (PopupMenu*) pMenu; + } + } + pPopupMenu->SetSelectHdl(LINK(this, SmEditWindow, MenuSelectHdl)); - pPopupMenu->Execute( this, rCEvt.GetMousePosPixel() ); + pPopupMenu->Execute( this, aPoint ); delete pPopupMenu; } else if (pEditView) diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 1f530a10bb21..5b1c7b362275 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -2,9 +2,9 @@ * * $RCSfile: view.cxx,v $ * - * $Revision: 1.21 $ + * $Revision: 1.22 $ * - * last change: $Author: tl $ $Date: 2002-06-13 14:41:41 $ + * last change: $Author: tl $ $Date: 2002-07-22 13:22:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -429,12 +429,19 @@ void SmGraphicWindow::Command(const CommandEvent& rCEvt) case COMMAND_CONTEXTMENU: { GetParent()->ToTop(); - PopupMenu* pPopupMenu = new PopupMenu(SmResId(RID_VIEWMENU)); + SmResId aResId( RID_VIEWMENU ); + PopupMenu* pPopupMenu = new PopupMenu(aResId); pPopupMenu->SetSelectHdl(LINK(this, SmGraphicWindow, MenuSelectHdl)); Point aPos(5, 5); if (rCEvt.IsMouseEvent()) aPos = rCEvt.GetMousePosPixel(); - pPopupMenu->Execute( this, aPos ); + DBG_ASSERT( pViewShell, "view shell missing" ); + + // added for replaceability of context menus #96085, #93782 + pViewShell->GetViewFrame()->GetBindings().GetDispatcher() + ->ExecutePopup( aResId, this, &aPos ); + //pPopupMenu->Execute( this, aPos ); + delete pPopupMenu; bCallBase = FALSE; } diff --git a/starmath/util/makefile.mk b/starmath/util/makefile.mk index fcb50c7ee81b..c9c078b0ab53 100644 --- a/starmath/util/makefile.mk +++ b/starmath/util/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.6 $ +# $Revision: 1.7 $ # -# last change: $Author: kz $ $Date: 2002-01-10 09:44:53 $ +# last change: $Author: tl $ $Date: 2002-07-22 13:21:05 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -93,6 +93,7 @@ SHL1IMPLIB= smimp SHL1LIBS= $(SLB)$/starmath.lib SHL1STDLIBS= \ $(TOOLSLIB) \ + $(TKLIB) \ $(SVTOOLLIB) \ $(SVLLIB) \ $(SVMEMLIB) \ |