diff options
author | Kai Ahrens <ka@openoffice.org> | 2002-06-20 08:52:54 +0000 |
---|---|---|
committer | Kai Ahrens <ka@openoffice.org> | 2002-06-20 08:52:54 +0000 |
commit | 8126280b1f9387566ba04b5a7d4ade6d8594cf10 (patch) | |
tree | 6a220fca2c8fee87670da9548090357ac1806ccb /svx/source/gallery2/galctrl.cxx | |
parent | 7dc74b823818ea0b0658c303df9f313905db3647 (diff) |
#100248#: show popup menu's at the correct position
Diffstat (limited to 'svx/source/gallery2/galctrl.cxx')
-rw-r--r-- | svx/source/gallery2/galctrl.cxx | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx index 623957e6d252..479d39fc2e3a 100644 --- a/svx/source/gallery2/galctrl.cxx +++ b/svx/source/gallery2/galctrl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: galctrl.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: oj $ $Date: 2002-04-09 07:36:55 $ + * last change: $Author: ka $ $Date: 2002-06-20 09:52:54 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -390,7 +390,10 @@ void GalleryIconView::Command( const CommandEvent& rCEvt ) ValueSet::Command( rCEvt ); if( rCEvt.GetCommand() == COMMAND_CONTEXTMENU ) - ( (GalleryBrowser2*) GetParent() )->ShowContextMenu( this, &rCEvt.GetMousePosPixel() ); + { + ( (GalleryBrowser2*) GetParent() )->ShowContextMenu( this, + ( rCEvt.IsMouseEvent() ? &rCEvt.GetMousePosPixel() : NULL ) ); + } } // ------------------------------------------------------------------------ @@ -465,7 +468,7 @@ BOOL GalleryListView::SeekRow( long nRow ) String GalleryListView::GetCellText(long _nRow, USHORT nColumnId) const { String sRet; - if( mpTheme && ( _nRow < mpTheme->GetObjectCount() ) ) + if( mpTheme && ( _nRow < static_cast< long >( mpTheme->GetObjectCount() ) ) ) { SgaObject* pObj = mpTheme->AcquireObject( _nRow ); @@ -557,8 +560,15 @@ void GalleryListView::Command( const CommandEvent& rCEvt ) { BrowseBox::Command( rCEvt ); - if( ( GetRowAtYPosPixel( rCEvt.GetMousePosPixel().Y() ) != BROWSER_ENDOFSELECTION ) && ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU ) ) - ( (GalleryBrowser2*) GetParent() )->ShowContextMenu( this, &rCEvt.GetMousePosPixel() ); + if( rCEvt.GetCommand() == COMMAND_CONTEXTMENU ) + { + const Point* pPos = NULL; + + if( rCEvt.IsMouseEvent() && ( GetRowAtYPosPixel( rCEvt.GetMousePosPixel().Y() ) != BROWSER_ENDOFSELECTION ) ) + pPos = &rCEvt.GetMousePosPixel(); + + ( (GalleryBrowser2*) GetParent() )->ShowContextMenu( this, pPos ); + } } // ------------------------------------------------------------------------ |