diff options
author | Rüdiger Timm <rt@openoffice.org> | 2005-01-27 09:19:01 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2005-01-27 09:19:01 +0000 |
commit | 38fb8ca32864fcb06aba9a9cf42b0777ba965cd3 (patch) | |
tree | 79c25dbf02cdbb061693874b1d97e7d40e8670ae /sfx2/source/toolbox/tbxitem.cxx | |
parent | 9a7e3bb552d4c2078353e0e9496c0eaf27d21b82 (diff) |
INTEGRATION: CWS cd04 (1.43.42); FILE MERGED
2005/01/17 16:07:53 cd 1.43.42.1: #i39871# Close popup mode window when the floating window is moved
Diffstat (limited to 'sfx2/source/toolbox/tbxitem.cxx')
-rw-r--r-- | sfx2/source/toolbox/tbxitem.cxx | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index f10597ab676e..cc1b41eefa03 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -2,9 +2,9 @@ * * $RCSfile: tbxitem.cxx,v $ * - * $Revision: 1.45 $ + * $Revision: 1.46 $ * - * last change: $Author: obo $ $Date: 2005-01-25 14:48:05 $ + * last change: $Author: rt $ $Date: 2005-01-27 10:19:01 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -286,8 +286,28 @@ struct SfxToolBoxControl_Impl SfxPopupWindow* mpFloatingWindow; SfxPopupWindow* mpPopupWindow; Reference< XUIElement > mxUIElement; + + DECL_LINK( WindowEventListener, VclSimpleEvent* ); }; +IMPL_LINK( SfxToolBoxControl_Impl, WindowEventListener, VclSimpleEvent*, pEvent ) +{ + if ( pEvent && + pEvent->ISA( VclWindowEvent ) && + (( pEvent->GetId() == VCLEVENT_WINDOW_MOVE ) || + ( pEvent->GetId() == VCLEVENT_WINDOW_ACTIVATE ))) + { + Window* pWindow( ((VclWindowEvent*)pEvent)->GetWindow() ); + if (( pWindow == mpFloatingWindow ) && + ( mpPopupWindow != 0 )) + { + delete mpPopupWindow; + mpPopupWindow = 0; + } + } + + return 1; +} //-------------------------------------------------------------------- @@ -995,6 +1015,9 @@ IMPL_LINK( SfxToolBoxControl, PopupModeEndHdl, void *, EMPTYARG ) delete pImpl->mpFloatingWindow; pImpl->mpFloatingWindow = pImpl->mpPopupWindow; pImpl->mpPopupWindow = 0; + // We also need to know when the user tries to use the + // floating window. + pImpl->mpFloatingWindow->AddEventListener( LINK( pImpl, SfxToolBoxControl_Impl, WindowEventListener )); } else { |