diff options
author | Hans-Joachim Lankenau <hjs@openoffice.org> | 2010-12-17 13:36:59 +0100 |
---|---|---|
committer | Hans-Joachim Lankenau <hjs@openoffice.org> | 2010-12-17 13:36:59 +0100 |
commit | 238883621ee13e53f535fb56c4dc8510e39a7f3b (patch) | |
tree | 3fea36e0243440f0e5c96364a0fe36269966c8fd /vcl/win/source/window | |
parent | 845ab68981c2aacf81af53adbf9d2d4d2e9d5527 (diff) | |
parent | 9103c81b03961788743d6248099f6a7f35f735d9 (diff) |
CWS-TOOLING: integrate CWS mib19
Diffstat (limited to 'vcl/win/source/window')
-rw-r--r-- | vcl/win/source/window/salobj.cxx | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/vcl/win/source/window/salobj.cxx b/vcl/win/source/window/salobj.cxx index 2f657968284f..6d00242ef313 100644 --- a/vcl/win/source/window/salobj.cxx +++ b/vcl/win/source/window/salobj.cxx @@ -39,6 +39,7 @@ #include <salframe.h> #include <salobj.h> #include <tools/debug.hxx> +#include <vcl/svapp.hxx> // ======================================================================= @@ -103,6 +104,46 @@ WinSalFrame* ImplFindSalObjectFrame( HWND hWnd ) // ----------------------------------------------------------------------- +sal_Bool ImplInterceptChildWindowKeyDown( MSG& rMsg ) +{ + sal_Bool bResult = sal_False; + if ( rMsg.message == WM_KEYDOWN ) + { + wchar_t pClassName[10]; + sal_Int32 nLen = GetClassNameW( rMsg.hwnd, pClassName, 10 ); + if ( !( nLen == 9 && wcsncmp( pClassName, SAL_OBJECT_CLASSNAMEW, nLen ) == 0 ) ) + { + // look for the first SalObject in the parent hierarchy + HWND hWin = rMsg.hwnd; + HWND hLastOLEWindow = hWin; + WinSalObject* pSalObj = NULL; + do + { + hLastOLEWindow = hWin; + hWin = ::GetParent( hWin ); + if ( hWin ) + { + nLen = GetClassNameW( hWin, pClassName, 10 ); + if ( nLen == 9 && wcsncmp( pClassName, SAL_OBJECT_CLASSNAMEW, nLen ) == 0 ) + pSalObj = GetSalObjWindowPtr( hWin ); + } + } while( hWin && !pSalObj ); + + if ( pSalObj && pSalObj->mbInterceptChildWindowKeyDown && pSalObj->maSysData.hWnd ) + { + bResult = ( 1 == ImplSendMessage( pSalObj->maSysData.hWnd, rMsg.message, rMsg.wParam, rMsg.lParam ) ); + } + } + } + + return bResult; +} + +// ----------------------------------------------------------------------- + + +// ----------------------------------------------------------------------- + LRESULT CALLBACK SalSysMsgProc( int nCode, WPARAM wParam, LPARAM lParam ) { // Used for Unicode and none Unicode @@ -623,6 +664,7 @@ WinSalObject::WinSalObject() mhLastFocusWnd = 0; maSysData.nSize = sizeof( SystemEnvData ); mpStdClipRgnData = NULL; + mbInterceptChildWindowKeyDown = sal_False; // Insert object in objectlist mpNextObject = pSalData->mpFirstObject; @@ -836,3 +878,11 @@ const SystemEnvData* WinSalObject::GetSystemData() const { return &maSysData; } + +// ----------------------------------------------------------------------- + +void WinSalObject::InterceptChildWindowKeyDown( sal_Bool bIntercept ) +{ + mbInterceptChildWindowKeyDown = bIntercept; +} + |