ImageControl.cxx (24acc546) ImageControl.cxx (d026be40)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 911 unchanged lines hidden (view full) ---

920 {
921 xMenu->insertItem( ID_OPEN_GRAPHICS, FRM_RES_STRING( RID_STR_OPEN_GRAPHICS ), 0, 0 );
922 xMenu->insertItem( ID_CLEAR_GRAPHICS, FRM_RES_STRING( RID_STR_CLEAR_GRAPHICS ), 0, 1 );
923
924 // check if the ImageURL is empty
925 if ( impl_isEmptyGraphics_nothrow() )
926 xMenu->enableItem( ID_CLEAR_GRAPHICS, sal_False );
927
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 911 unchanged lines hidden (view full) ---

920 {
921 xMenu->insertItem( ID_OPEN_GRAPHICS, FRM_RES_STRING( RID_STR_OPEN_GRAPHICS ), 0, 0 );
922 xMenu->insertItem( ID_CLEAR_GRAPHICS, FRM_RES_STRING( RID_STR_CLEAR_GRAPHICS ), 0, 1 );
923
924 // check if the ImageURL is empty
925 if ( impl_isEmptyGraphics_nothrow() )
926 xMenu->enableItem( ID_CLEAR_GRAPHICS, sal_False );
927
928 awt::Rectangle aRect( e.X, e.Y, 0, 0 );
928 awt::Point aPos( e.X, e.Y );
929 if ( ( e.X < 0 ) || ( e.Y < 0 ) )
930 { // context menu triggered by keyboard
931 // position it in the center of the control
932 // 102205 - 16.08.2002 - fs@openoffice.org
933 Reference< XWindow > xWindow( static_cast< ::cppu::OWeakObject* >( this ), UNO_QUERY );
934 OSL_ENSURE( xWindow.is(), "OImageControlControl::mousePressed: me not a window? How this?" );
935 if ( xWindow.is() )
936 {
937 awt::Rectangle aPosSize = xWindow->getPosSize();
929 if ( ( e.X < 0 ) || ( e.Y < 0 ) )
930 { // context menu triggered by keyboard
931 // position it in the center of the control
932 // 102205 - 16.08.2002 - fs@openoffice.org
933 Reference< XWindow > xWindow( static_cast< ::cppu::OWeakObject* >( this ), UNO_QUERY );
934 OSL_ENSURE( xWindow.is(), "OImageControlControl::mousePressed: me not a window? How this?" );
935 if ( xWindow.is() )
936 {
937 awt::Rectangle aPosSize = xWindow->getPosSize();
938 aRect.X = aPosSize.Width / 2;
939 aRect.Y = aPosSize.Height / 2;
938 aPos.X = aPosSize.Width / 2;
939 aPos.Y = aPosSize.Height / 2;
940 }
941 }
942
940 }
941 }
942
943 const sal_Int16 nResult = xMenu->execute( xWindowPeer, aRect, PopupMenuDirection::EXECUTE_DEFAULT );
943 const sal_Int16 nResult = xMenu->execute( xWindowPeer, aPos, PopupMenuDirection::EXECUTE_DEFAULT );
944
945 switch ( nResult )
946 {
947 case ID_OPEN_GRAPHICS:
948 implInsertGraphics();
949 bModified = true;
950 break;
951

--- 68 unchanged lines hidden ---
944
945 switch ( nResult )
946 {
947 case ID_OPEN_GRAPHICS:
948 implInsertGraphics();
949 bModified = true;
950 break;
951

--- 68 unchanged lines hidden ---