summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'vcl')
-rw-r--r--vcl/aqua/inc/salobj.h1
-rw-r--r--vcl/aqua/source/window/salobj.cxx6
-rw-r--r--vcl/inc/vcl/salframe.hxx1
-rw-r--r--vcl/inc/vcl/salobj.hxx2
-rw-r--r--vcl/inc/vcl/window.h3
-rwxr-xr-xvcl/inc/vcl/window.hxx3
-rw-r--r--vcl/os2/inc/salobj.h1
-rw-r--r--vcl/os2/source/window/salobj.cxx6
-rw-r--r--vcl/prj/build.lst2
-rw-r--r--vcl/prj/d.lst1
-rw-r--r--vcl/source/gdi/metaact.cxx8
-rwxr-xr-xvcl/source/window/window.cxx7
-rw-r--r--vcl/unx/gtk/window/gtkobject.cxx5
-rw-r--r--vcl/unx/headless/svpdummies.cxx1
-rw-r--r--vcl/unx/headless/svpdummies.hxx2
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkobject.hxx1
-rw-r--r--vcl/unx/inc/salobj.h1
-rw-r--r--vcl/unx/source/window/salobj.cxx7
-rw-r--r--vcl/win/inc/saldata.hxx1
-rw-r--r--vcl/win/inc/salobj.h2
-rw-r--r--vcl/win/source/app/salinst.cxx15
-rw-r--r--vcl/win/source/gdi/salprn.cxx15
-rw-r--r--vcl/win/source/window/salobj.cxx50
23 files changed, 128 insertions, 13 deletions
diff --git a/vcl/aqua/inc/salobj.h b/vcl/aqua/inc/salobj.h
index 0041b22c16a0..56b07cea4262 100644
--- a/vcl/aqua/inc/salobj.h
+++ b/vcl/aqua/inc/salobj.h
@@ -81,6 +81,7 @@ public:
virtual void SetBackground();
virtual void SetBackground( SalColor nSalColor );
virtual const SystemEnvData* GetSystemData() const;
+ virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept );
};
#endif // _SV_SALOBJ_H
diff --git a/vcl/aqua/source/window/salobj.cxx b/vcl/aqua/source/window/salobj.cxx
index 07d337dcc81a..f300929f04fe 100644
--- a/vcl/aqua/source/window/salobj.cxx
+++ b/vcl/aqua/source/window/salobj.cxx
@@ -237,3 +237,9 @@ const SystemEnvData* AquaSalObject::GetSystemData() const
return &maSysData;
}
+// -----------------------------------------------------------------------
+
+void AquaSalObject::InterceptChildWindowKeyDown( sal_Bool /*bIntercept*/ )
+{
+}
+
diff --git a/vcl/inc/vcl/salframe.hxx b/vcl/inc/vcl/salframe.hxx
index 08548d7dda40..d82a2099f315 100644
--- a/vcl/inc/vcl/salframe.hxx
+++ b/vcl/inc/vcl/salframe.hxx
@@ -270,7 +270,6 @@ public:
// done setting up the clipregion
virtual void EndSetClipRegion() = 0;
-
// Callbacks (indepent part in vcl/source/window/winproc.cxx)
// for default message handling return 0
void SetCallback( Window* pWindow, SALFRAMEPROC pProc )
diff --git a/vcl/inc/vcl/salobj.hxx b/vcl/inc/vcl/salobj.hxx
index e453bf5c6f87..adf0e0a3d45d 100644
--- a/vcl/inc/vcl/salobj.hxx
+++ b/vcl/inc/vcl/salobj.hxx
@@ -73,6 +73,8 @@ public:
virtual const SystemEnvData* GetSystemData() const = 0;
+ virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept ) = 0;
+
void SetCallback( void* pInst, SALOBJECTPROC pProc )
{ m_pInst = pInst; m_pCallback = pProc; }
long CallCallback( USHORT nEvent, const void* pEvent )
diff --git a/vcl/inc/vcl/window.h b/vcl/inc/vcl/window.h
index 4a7f1c644400..73b6f1078ca9 100644
--- a/vcl/inc/vcl/window.h
+++ b/vcl/inc/vcl/window.h
@@ -357,7 +357,8 @@ public:
mbDisableAccessibleLabelForRelation:1,
mbDisableAccessibleLabeledByRelation:1,
mbHelpTextDynamic:1,
- mbFakeFocusSet:1;
+ mbFakeFocusSet:1,
+ mbInterceptChildWindowKeyDown:1;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxDNDListenerContainer;
};
diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx
index 700a87695085..fa136f6d514d 100755
--- a/vcl/inc/vcl/window.hxx
+++ b/vcl/inc/vcl/window.hxx
@@ -1114,6 +1114,9 @@ public:
*/
void doLazyDelete();
+ // let the window intercept the KeyDown messages of the system children
+ void InterceptChildWindowKeyDown( sal_Bool bIntercept );
+
virtual XubString GetSurroundingText() const;
virtual Selection GetSurroundingTextSelection() const;
diff --git a/vcl/os2/inc/salobj.h b/vcl/os2/inc/salobj.h
index 5b4ac21ccdd6..04fdef90bf67 100644
--- a/vcl/os2/inc/salobj.h
+++ b/vcl/os2/inc/salobj.h
@@ -64,6 +64,7 @@ public:
virtual void SetBackground();
virtual void SetBackground( SalColor nSalColor );
virtual const SystemEnvData* GetSystemData() const;
+ virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept );
};
#endif // _SV_SALOBJ_H
diff --git a/vcl/os2/source/window/salobj.cxx b/vcl/os2/source/window/salobj.cxx
index 85ed1a606d08..e55ce448f7d0 100644
--- a/vcl/os2/source/window/salobj.cxx
+++ b/vcl/os2/source/window/salobj.cxx
@@ -566,3 +566,9 @@ void Os2SalObject::SetCallback( void* pInst, SALOBJECTPROC pProc )
}
#endif
+// -----------------------------------------------------------------------
+
+void Os2SalObject::InterceptChildWindowKeyDown( sal_Bool /*bIntercept*/ )
+{
+}
+
diff --git a/vcl/prj/build.lst b/vcl/prj/build.lst
index 0a6f6a95f605..af15ad73e19d 100644
--- a/vcl/prj/build.lst
+++ b/vcl/prj/build.lst
@@ -1,4 +1,4 @@
-vc vcl : l10n apple_remote BOOST:boost rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx basebmp tools l10ntools icc SO:print_header cpputools shell svl NULL
+vc vcl : l10n apple_remote BOOST:boost rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx basebmp tools l10ntools icc SO:print_header cpputools shell svl LIBXSLT:libxslt NULL
vc vcl usr1 - all vc_mkout NULL
vc vcl\inc nmake - all vc_inc NULL
vc vcl\source\glyphs nmake - all vc_glyphs vc_inc NULL
diff --git a/vcl/prj/d.lst b/vcl/prj/d.lst
index 6d452e8ee43f..196bdeb19c0e 100644
--- a/vcl/prj/d.lst
+++ b/vcl/prj/d.lst
@@ -23,7 +23,6 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\bmpacc.hxx %_DEST%\inc%_EXT%\vcl\bmpacc.hxx
..\inc\vcl\btndlg.hxx %_DEST%\inc%_EXT%\vcl\btndlg.hxx
..\inc\vcl\button.hxx %_DEST%\inc%_EXT%\vcl\button.hxx
-..\inc\vcl\button.hxx %_DEST%\inc%_EXT%\vcl\imagebtn.hxx
..\inc\vcl\cmdevt.h %_DEST%\inc%_EXT%\vcl\cmdevt.h
..\inc\vcl\cmdevt.hxx %_DEST%\inc%_EXT%\vcl\cmdevt.hxx
..\inc\vcl\combobox.h %_DEST%\inc%_EXT%\vcl\combobox.h
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 79d875542509..f398888a33b6 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -1441,7 +1441,7 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
rIStm >> mnLen;
rIStm >> nAryLen;
- if ( mnIndex > mnLen )
+ if ( mnIndex + mnLen > maStr.Len() )
{
mnIndex = 0;
mpDXAry = 0;
@@ -1481,6 +1481,12 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
sal_Unicode* pBuffer = maStr.AllocBuffer( nLen );
while ( nLen-- )
rIStm >> *pBuffer++;
+
+ if ( mnIndex + mnLen > maStr.Len() )
+ {
+ mnIndex = 0;
+ delete[] mpDXAry, mpDXAry = NULL;
+ }
}
}
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index f6bedc1bfa25..fe2af486c53a 100755
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -4786,6 +4786,13 @@ void Window::doLazyDelete()
}
// -----------------------------------------------------------------------
+void Window::InterceptChildWindowKeyDown( sal_Bool bIntercept )
+{
+ if( mpWindowImpl->mpSysObj )
+ mpWindowImpl->mpSysObj->InterceptChildWindowKeyDown( bIntercept );
+}
+
+// -----------------------------------------------------------------------
void Window::MouseMove( const MouseEvent& rMEvt )
{
diff --git a/vcl/unx/gtk/window/gtkobject.cxx b/vcl/unx/gtk/window/gtkobject.cxx
index 2a2bbe78078a..c5f5a168f653 100644
--- a/vcl/unx/gtk/window/gtkobject.cxx
+++ b/vcl/unx/gtk/window/gtkobject.cxx
@@ -209,3 +209,8 @@ void GtkSalObject::signalDestroy( GtkObject* pObj, gpointer object )
pThis->m_pSocket = NULL;
}
}
+
+void GtkSalObject::InterceptChildWindowKeyDown( sal_Bool /*bIntercept*/ )
+{
+}
+
diff --git a/vcl/unx/headless/svpdummies.cxx b/vcl/unx/headless/svpdummies.cxx
index 5983ff18c34f..0a67b147804a 100644
--- a/vcl/unx/headless/svpdummies.cxx
+++ b/vcl/unx/headless/svpdummies.cxx
@@ -61,6 +61,7 @@ void SvpSalObject::GrabFocus() {}
void SvpSalObject::SetBackground() {}
void SvpSalObject::SetBackground( SalColor ) {}
const SystemEnvData* SvpSalObject::GetSystemData() const { return &m_aSystemChildData; }
+void SvpSalObject::InterceptChildWindowKeyDown( sal_Bool ) {}
// SalI18NImeStatus
SvpImeStatus::~SvpImeStatus() {}
diff --git a/vcl/unx/headless/svpdummies.hxx b/vcl/unx/headless/svpdummies.hxx
index febf7eef6bbe..ea7667ce51ca 100644
--- a/vcl/unx/headless/svpdummies.hxx
+++ b/vcl/unx/headless/svpdummies.hxx
@@ -58,6 +58,8 @@ public:
virtual void SetBackground( SalColor nSalColor );
virtual const SystemEnvData* GetSystemData() const;
+
+ virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept );
};
class SvpImeStatus : public SalI18NImeStatus
diff --git a/vcl/unx/inc/plugins/gtk/gtkobject.hxx b/vcl/unx/inc/plugins/gtk/gtkobject.hxx
index ea740249f1c6..9d3f235b8894 100644
--- a/vcl/unx/inc/plugins/gtk/gtkobject.hxx
+++ b/vcl/unx/inc/plugins/gtk/gtkobject.hxx
@@ -64,6 +64,7 @@ public:
virtual const SystemEnvData* GetSystemData() const;
+ virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept );
};
#endif // _SV_SALOBJ_H
diff --git a/vcl/unx/inc/salobj.h b/vcl/unx/inc/salobj.h
index fa9f1309c8ca..d7d9334f281b 100644
--- a/vcl/unx/inc/salobj.h
+++ b/vcl/unx/inc/salobj.h
@@ -98,6 +98,7 @@ public:
virtual const SystemEnvData* GetSystemData() const;
+ virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept );
};
#endif // _SV_SALOBJ_H
diff --git a/vcl/unx/source/window/salobj.cxx b/vcl/unx/source/window/salobj.cxx
index 647b95ae032c..2ff6d05c35c6 100644
--- a/vcl/unx/source/window/salobj.cxx
+++ b/vcl/unx/source/window/salobj.cxx
@@ -559,3 +559,10 @@ long X11SalObject::Dispatch( XEvent* pEvent )
}
return 0;
}
+
+// -----------------------------------------------------------------------
+
+void X11SalObject::InterceptChildWindowKeyDown( sal_Bool /*bIntercept*/ )
+{
+}
+
diff --git a/vcl/win/inc/saldata.hxx b/vcl/win/inc/saldata.hxx
index ec67272ed07f..f95f1e0ca96b 100644
--- a/vcl/win/inc/saldata.hxx
+++ b/vcl/win/inc/saldata.hxx
@@ -213,6 +213,7 @@ void ImplSalYieldMutexAcquire();
void ImplSalYieldMutexRelease();
ULONG ImplSalReleaseYieldMutex();
void ImplSalAcquireYieldMutex( ULONG nCount );
+sal_Bool ImplInterceptChildWindowKeyDown( MSG& rMsg );
// \\WIN\SOURCE\WINDOW\SALFRAME.CXX
LRESULT CALLBACK SalFrameWndProcA( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam );
diff --git a/vcl/win/inc/salobj.h b/vcl/win/inc/salobj.h
index 11ae96931321..ae7ea5271800 100644
--- a/vcl/win/inc/salobj.h
+++ b/vcl/win/inc/salobj.h
@@ -46,6 +46,7 @@ public:
RGNDATA* mpStdClipRgnData; // Cache Standard-ClipRegion-Data
RECT* mpNextClipRect; // Naechstes ClipRegion-Rect
BOOL mbFirstClipRect; // Flag for first cliprect to insert
+ sal_Bool mbInterceptChildWindowKeyDown; // Intercept the KeyDown event sent to system child window
WinSalObject* mpNextObject; // pointer to next object
@@ -64,6 +65,7 @@ public:
virtual void SetBackground();
virtual void SetBackground( SalColor nSalColor );
virtual const SystemEnvData* GetSystemData() const;
+ virtual void InterceptChildWindowKeyDown( sal_Bool bIntercept );
};
#endif // _SV_SALOBJ_H
diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx
index 419723ee6442..a05d2d0b6502 100644
--- a/vcl/win/source/app/salinst.cxx
+++ b/vcl/win/source/app/salinst.cxx
@@ -719,8 +719,12 @@ void ImplSalYield( BOOL bWait, BOOL bHandleAllCurrentEvents )
{
if ( ImplPeekMessage( &aMsg, 0, 0, 0, PM_REMOVE ) )
{
- TranslateMessage( &aMsg );
- ImplSalDispatchMessage( &aMsg );
+ if ( !ImplInterceptChildWindowKeyDown( aMsg ) )
+ {
+ TranslateMessage( &aMsg );
+ ImplSalDispatchMessage( &aMsg );
+ }
+
bOneEvent = bWasMsg = true;
}
else
@@ -731,8 +735,11 @@ void ImplSalYield( BOOL bWait, BOOL bHandleAllCurrentEvents )
{
if ( ImplGetMessage( &aMsg, 0, 0, 0 ) )
{
- TranslateMessage( &aMsg );
- ImplSalDispatchMessage( &aMsg );
+ if ( !ImplInterceptChildWindowKeyDown( aMsg ) )
+ {
+ TranslateMessage( &aMsg );
+ ImplSalDispatchMessage( &aMsg );
+ }
}
}
}
diff --git a/vcl/win/source/gdi/salprn.cxx b/vcl/win/source/gdi/salprn.cxx
index 9d8d41723f64..702ff639ed84 100644
--- a/vcl/win/source/gdi/salprn.cxx
+++ b/vcl/win/source/gdi/salprn.cxx
@@ -1798,8 +1798,11 @@ WIN_BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ )
MSG aMsg;
if ( ImplPeekMessage( &aMsg, 0, 0, 0, PM_REMOVE ) )
{
- TranslateMessage( &aMsg );
- ImplDispatchMessage( &aMsg );
+ if ( !ImplInterceptChildWindowKeyDown( aMsg ) )
+ {
+ TranslateMessage( &aMsg );
+ ImplDispatchMessage( &aMsg );
+ }
i++;
if ( i > 15 )
bWhile = FALSE;
@@ -2060,8 +2063,12 @@ BOOL WinSalPrinter::StartJob( const XubString* pFileName,
MSG aMsg;
if ( ImplPeekMessage( &aMsg, 0, 0, 0, PM_REMOVE ) )
{
- TranslateMessage( &aMsg );
- ImplDispatchMessage( &aMsg );
+ if ( !ImplInterceptChildWindowKeyDown( aMsg ) )
+ {
+ TranslateMessage( &aMsg );
+ ImplDispatchMessage( &aMsg );
+ }
+
i++;
if ( i > 15 )
bWhile = FALSE;
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;
+}
+