Kaydet (Commit) c01a6f4f authored tarafından Ariel Constenla-Haile's avatar Ariel Constenla-Haile

i121542 - css::awt::XPopupMenu::execute() needs a css::awt::Rectangle

üst da189840
...@@ -925,7 +925,7 @@ void OImageControlControl::mousePressed(const ::com::sun::star::awt::MouseEvent& ...@@ -925,7 +925,7 @@ void OImageControlControl::mousePressed(const ::com::sun::star::awt::MouseEvent&
if ( impl_isEmptyGraphics_nothrow() ) if ( impl_isEmptyGraphics_nothrow() )
xMenu->enableItem( ID_CLEAR_GRAPHICS, sal_False ); xMenu->enableItem( ID_CLEAR_GRAPHICS, sal_False );
awt::Point aPos( e.X, e.Y ); awt::Rectangle aRect( e.X, e.Y, 0, 0 );
if ( ( e.X < 0 ) || ( e.Y < 0 ) ) if ( ( e.X < 0 ) || ( e.Y < 0 ) )
{ // context menu triggered by keyboard { // context menu triggered by keyboard
// position it in the center of the control // position it in the center of the control
...@@ -935,12 +935,12 @@ void OImageControlControl::mousePressed(const ::com::sun::star::awt::MouseEvent& ...@@ -935,12 +935,12 @@ void OImageControlControl::mousePressed(const ::com::sun::star::awt::MouseEvent&
if ( xWindow.is() ) if ( xWindow.is() )
{ {
awt::Rectangle aPosSize = xWindow->getPosSize(); awt::Rectangle aPosSize = xWindow->getPosSize();
aPos.X = aPosSize.Width / 2; aRect.X = aPosSize.Width / 2;
aPos.Y = aPosSize.Height / 2; aRect.Y = aPosSize.Height / 2;
} }
} }
const sal_Int16 nResult = xMenu->execute( xWindowPeer, aPos, PopupMenuDirection::EXECUTE_DEFAULT ); const sal_Int16 nResult = xMenu->execute( xWindowPeer, aRect, PopupMenuDirection::EXECUTE_DEFAULT );
switch ( nResult ) switch ( nResult )
{ {
......
...@@ -203,7 +203,8 @@ throw (::com::sun::star::uno::RuntimeException) ...@@ -203,7 +203,8 @@ throw (::com::sun::star::uno::RuntimeException)
// //
Reference< awt::XWindowPeer > xParent( m_xParentWindow, UNO_QUERY ); Reference< awt::XWindowPeer > xParent( m_xParentWindow, UNO_QUERY );
sal_Int16 nId = xPopupMenu->execute( xParent, aPos, com::sun::star::awt::PopupMenuDirection::EXECUTE_UP+16 ); com::sun::star::awt::Rectangle aRect( aPos.X, aPos.Y, 0, 0 );
sal_Int16 nId = xPopupMenu->execute( xParent, aRect, com::sun::star::awt::PopupMenuDirection::EXECUTE_UP+16 );
//click "More..." //click "More..."
if ( nId && m_xFrame.is() ) if ( nId && m_xFrame.is() )
{ {
......
...@@ -66,7 +66,7 @@ class PopupMenuControllerImpl ...@@ -66,7 +66,7 @@ class PopupMenuControllerImpl
}; };
//======================================================================== //========================================================================
// class PopupMenuController // class PopupMenuController REMOVE REMOVE REMOVE
//======================================================================== //========================================================================
PopupMenuController::PopupMenuController( const Reference< lang::XMultiServiceFactory >& rServiceManager ) PopupMenuController::PopupMenuController( const Reference< lang::XMultiServiceFactory >& rServiceManager )
...@@ -221,7 +221,7 @@ Reference< awt::XWindow > SAL_CALL PopupMenuController::createPopupWindow() thro ...@@ -221,7 +221,7 @@ Reference< awt::XWindow > SAL_CALL PopupMenuController::createPopupWindow() thro
} }
pToolBox->SetItemDown( nItemId, sal_True ); pToolBox->SetItemDown( nItemId, sal_True );
Reference< awt::XWindowPeer > xPeer( getParent(), UNO_QUERY_THROW ); Reference< awt::XWindowPeer > xPeer( getParent(), UNO_QUERY_THROW );
mxPopupMenu->execute( xPeer, awt::Point( aRect.getX(), aRect.getY() ), 0 ); mxPopupMenu->execute( xPeer, VCLUnoHelper::ConvertToAWTRect( aRect ), 0 );
pToolBox->SetItemDown( nItemId, sal_False ); pToolBox->SetItemDown( nItemId, sal_False );
} }
catch( Exception& ) catch( Exception& )
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
*************************************************************/ *************************************************************/
import com.sun.star.awt.MouseEvent; import com.sun.star.awt.MouseEvent;
import com.sun.star.awt.Point; import com.sun.star.awt.Rectangle;
import com.sun.star.awt.XControl; import com.sun.star.awt.XControl;
import com.sun.star.awt.XMouseListener; import com.sun.star.awt.XMouseListener;
import com.sun.star.awt.XTopWindow; import com.sun.star.awt.XTopWindow;
...@@ -99,7 +99,7 @@ public UnoMenu2(XComponentContext _xContext, XMultiComponentFactory _xMCF) { ...@@ -99,7 +99,7 @@ public UnoMenu2(XComponentContext _xContext, XMultiComponentFactory _xMCF) {
public void mousePressed(MouseEvent mouseEvent) { public void mousePressed(MouseEvent mouseEvent) {
if (mouseEvent.PopupTrigger){ if (mouseEvent.PopupTrigger){
Point aPos = new Point(mouseEvent.X, mouseEvent.Y); Rectangle aPos = new Rectangle(mouseEvent.X, mouseEvent.Y, 0, 0);
XControl xControl = (XControl) UnoRuntime.queryInterface(XControl.class, mouseEvent.Source); XControl xControl = (XControl) UnoRuntime.queryInterface(XControl.class, mouseEvent.Source);
getPopupMenu().execute( xControl.getPeer(), aPos, com.sun.star.awt.PopupMenuDirection.EXECUTE_DEFAULT); getPopupMenu().execute( xControl.getPeer(), aPos, com.sun.star.awt.PopupMenuDirection.EXECUTE_DEFAULT);
} }
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#define __com_sun_star_awt_XPopupMenu_idl__ #define __com_sun_star_awt_XPopupMenu_idl__
#include <com/sun/star/awt/KeyEvent.idl> #include <com/sun/star/awt/KeyEvent.idl>
#include <com/sun/star/awt/Point.idl> #include <com/sun/star/awt/Rectangle.idl>
#include <com/sun/star/awt/XMenu.idl> #include <com/sun/star/awt/XMenu.idl>
#include <com/sun/star/graphic/XGraphic.idl> #include <com/sun/star/graphic/XGraphic.idl>
...@@ -84,7 +84,8 @@ published interface XPopupMenu: XMenu ...@@ -84,7 +84,8 @@ published interface XPopupMenu: XMenu
the parent window. the parent window.
@param Position @param Position
the coordinates where the popup menu should be executed. a <type>Rectangle</type> representing the coordinates system
where the popup menu should be executed.
@param Direction @param Direction
the direction in which a popup menu will grow, as specified the direction in which a popup menu will grow, as specified
...@@ -94,7 +95,7 @@ published interface XPopupMenu: XMenu ...@@ -94,7 +95,7 @@ published interface XPopupMenu: XMenu
returns the selected item or <code>0</code>, if cancelled. returns the selected item or <code>0</code>, if cancelled.
*/ */
short execute( [in] XWindowPeer Parent, short execute( [in] XWindowPeer Parent,
[in] Point Position, [in] Rectangle Position,
[in] short Direction ); [in] short Direction );
/** queries if the <type>PopupMenu</type> is being. /** queries if the <type>PopupMenu</type> is being.
......
...@@ -61,7 +61,7 @@ public class _XPopupMenuController extends MultiMethodTest { ...@@ -61,7 +61,7 @@ public class _XPopupMenuController extends MultiMethodTest {
System.out.println("enableItem called."); System.out.println("enableItem called.");
} }
public short execute(com.sun.star.awt.XWindowPeer xWindowPeer, com.sun.star.awt.Point pos, short param) { public short execute(com.sun.star.awt.XWindowPeer xWindowPeer, com.sun.star.awt.Rectangle pos, short param) {
System.out.println("execute called."); System.out.println("execute called.");
return 0; return 0;
} }
......
...@@ -120,7 +120,7 @@ public: ...@@ -120,7 +120,7 @@ public:
virtual ::sal_Int16 SAL_CALL getDefaultItem( ) throw (css::uno::RuntimeException); virtual ::sal_Int16 SAL_CALL getDefaultItem( ) throw (css::uno::RuntimeException);
virtual void SAL_CALL checkItem( ::sal_Int16 nItemId, ::sal_Bool bCheck ) throw (css::uno::RuntimeException); virtual void SAL_CALL checkItem( ::sal_Int16 nItemId, ::sal_Bool bCheck ) throw (css::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL isItemChecked( ::sal_Int16 nItemId ) throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL isItemChecked( ::sal_Int16 nItemId ) throw (css::uno::RuntimeException);
virtual ::sal_Int16 SAL_CALL execute( const css::uno::Reference< css::awt::XWindowPeer >& Parent, const css::awt::Point& Position, ::sal_Int16 Direction ) throw (css::uno::RuntimeException); virtual ::sal_Int16 SAL_CALL execute( const css::uno::Reference< css::awt::XWindowPeer >& Parent, const css::awt::Rectangle& Position, ::sal_Int16 Direction ) throw (css::uno::RuntimeException);
virtual ::sal_Bool SAL_CALL isInExecute( ) throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL isInExecute( ) throw (css::uno::RuntimeException);
virtual void SAL_CALL endExecute( ) throw (css::uno::RuntimeException); virtual void SAL_CALL endExecute( ) throw (css::uno::RuntimeException);
virtual void SAL_CALL setAcceleratorKeyEvent( ::sal_Int16 nItemId, const css::awt::KeyEvent& aKeyEvent ) throw (css::uno::RuntimeException); virtual void SAL_CALL setAcceleratorKeyEvent( ::sal_Int16 nItemId, const css::awt::KeyEvent& aKeyEvent ) throw (css::uno::RuntimeException);
......
...@@ -578,7 +578,7 @@ throw(css::uno::RuntimeException) ...@@ -578,7 +578,7 @@ throw(css::uno::RuntimeException)
sal_Int16 VCLXMenu::execute( sal_Int16 VCLXMenu::execute(
const css::uno::Reference< css::awt::XWindowPeer >& rxWindowPeer, const css::uno::Reference< css::awt::XWindowPeer >& rxWindowPeer,
const css::awt::Point& rPos, const css::awt::Rectangle& rPos,
sal_Int16 nFlags ) sal_Int16 nFlags )
throw(css::uno::RuntimeException) throw(css::uno::RuntimeException)
{ {
...@@ -588,9 +588,8 @@ throw(css::uno::RuntimeException) ...@@ -588,9 +588,8 @@ throw(css::uno::RuntimeException)
sal_Int16 nRet = 0; sal_Int16 nRet = 0;
if ( mpMenu && IsPopupMenu() ) if ( mpMenu && IsPopupMenu() )
{ {
const ::Point aPoint = VCLPoint( rPos );
nRet = ((PopupMenu*)mpMenu)->Execute( VCLUnoHelper::GetWindow( rxWindowPeer ), nRet = ((PopupMenu*)mpMenu)->Execute( VCLUnoHelper::GetWindow( rxWindowPeer ),
::Rectangle(aPoint,aPoint), VCLRectangle( rPos ),
nFlags | POPUPMENU_NOMOUSEUPCLOSE ); nFlags | POPUPMENU_NOMOUSEUPCLOSE );
} }
return nRet; return nRet;
......
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