summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/cmdevt.hxx28
-rw-r--r--sd/source/ui/app/sdmod1.cxx8
-rw-r--r--sd/source/ui/slideshow/slideshowimpl.cxx7
-rw-r--r--vcl/osx/salinst.cxx3
-rw-r--r--vcl/win/source/window/salframe.cxx13
5 files changed, 38 insertions, 21 deletions
diff --git a/include/vcl/cmdevt.hxx b/include/vcl/cmdevt.hxx
index 439e9692d9e4..623356b9c876 100644
--- a/include/vcl/cmdevt.hxx
+++ b/include/vcl/cmdevt.hxx
@@ -270,10 +270,7 @@ class VCL_DLLPUBLIC CommandDialogData
int GetDialogId() const { return m_nDialogId; }
};
-
// Media Commands
-
-
#define MEDIA_COMMAND_CHANNEL_DOWN ((sal_Int16)1) // Decrement the channel value, for example, for a TV or radio tuner.
#define MEDIA_COMMAND_CHANNEL_UP ((sal_Int16)2) // Increment the channel value, for example, for a TV or radio tuner.
#define MEDIA_COMMAND_NEXTTRACK ((sal_Int16)3) // Go to next media track/slide.
@@ -297,11 +294,22 @@ class VCL_DLLPUBLIC CommandDialogData
#define MEDIA_COMMAND_NEXTTRACK_HOLD ((sal_Int16)21)// Button Right holding pressed.
#define MEDIA_COMMAND_PREVIOUSTRACK_HOLD ((sal_Int16)22)// Button Left holding pressed.
-
+class VCL_DLLPUBLIC CommandMediaData
+{
+ sal_Int16 m_nMediaId;
+ bool m_bPassThroughToOS;
+public:
+ CommandMediaData(sal_Int16 nMediaId)
+ : m_nMediaId(nMediaId)
+ , m_bPassThroughToOS(true)
+ {
+ }
+ sal_Int16 GetMediaId() const { return m_nMediaId; }
+ void SetPassThroughToOS(bool bPassThroughToOS) { m_bPassThroughToOS = bPassThroughToOS; }
+ bool GetPassThroughToOS() const { return m_bPassThroughToOS; }
+};
// - CommandSelectionChangeData -
-
-
class VCL_DLLPUBLIC CommandSelectionChangeData
{
private:
@@ -377,7 +385,7 @@ public:
const CommandScrollData* GetAutoScrollData() const;
const CommandModKeyData* GetModKeyData() const;
const CommandDialogData* GetDialogData() const;
- sal_Int16 GetMediaCommand() const;
+ CommandMediaData* GetMediaData() const;
const CommandSelectionChangeData* GetSelectionChangeData() const;
};
@@ -445,12 +453,12 @@ inline const CommandDialogData* CommandEvent::GetDialogData() const
return NULL;
}
-inline sal_Int16 CommandEvent::GetMediaCommand() const
+inline CommandMediaData* CommandEvent::GetMediaData() const
{
if( mnCommand == COMMAND_MEDIA )
- return *(const sal_Int16*)(mpData);
+ return (CommandMediaData*)(mpData);
else
- return 0;
+ return NULL;
}
inline const CommandSelectionChangeData* CommandEvent::GetSelectionChangeData() const
diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx
index a4aff4d943f2..9f18bf5b828a 100644
--- a/sd/source/ui/app/sdmod1.cxx
+++ b/sd/source/ui/app/sdmod1.cxx
@@ -428,7 +428,9 @@ IMPL_LINK( SdModule, EventListenerHdl, VclSimpleEvent*, pEvent )
if( rEvent.GetCommand() == COMMAND_MEDIA )
{
- switch( rEvent.GetMediaCommand() )
+ CommandMediaData* pMediaData = rEvent.GetMediaData();
+ pMediaData->SetPassThroughToOS(false);
+ switch (pMediaData->GetMediaId())
{
case MEDIA_COMMAND_PLAY:
{
@@ -441,10 +443,10 @@ IMPL_LINK( SdModule, EventListenerHdl, VclSimpleEvent*, pEvent )
if( pViewShell && (pDocShell->GetDocumentType() == DOCUMENT_TYPE_IMPRESS) )
pViewShell->GetViewFrame()->GetDispatcher()->Execute( SID_PRESENTATION );
}
- }
break;
-
+ }
default:
+ pMediaData->SetPassThroughToOS(true);
break;
}
}
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index 40c62cff4b7d..1566a82baaf8 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -2001,7 +2001,9 @@ IMPL_LINK( SlideshowImpl, EventListenerHdl, VclSimpleEvent*, pEvent )
if( rEvent.GetCommand() == COMMAND_MEDIA )
{
- switch( rEvent.GetMediaCommand() )
+ CommandMediaData* pMediaData = rEvent.GetMediaData();
+ pMediaData->SetPassThroughToOS(false);
+ switch (pMediaData->GetMediaId())
{
#if defined( MACOSX )
case MEDIA_COMMAND_MENU:
@@ -2057,6 +2059,9 @@ IMPL_LINK( SlideshowImpl, EventListenerHdl, VclSimpleEvent*, pEvent )
}
endPresentation();
break;
+ default:
+ pMediaData->SetPassThroughToOS(true);
+ break;
}
}
}
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx
index 8ee435124a4a..164011efdcb3 100644
--- a/vcl/osx/salinst.cxx
+++ b/vcl/osx/salinst.cxx
@@ -524,7 +524,8 @@ void AquaSalInstance::handleAppDefinedEvent( NSEvent* pEvent )
if( pWindow )
{
const Point aPoint;
- CommandEvent aCEvt( aPoint, COMMAND_MEDIA, FALSE, &nCommand );
+ CommandMediaData aMediaData(nCommand);
+ CommandEvent aCEvt( aPoint, COMMAND_MEDIA, FALSE, &aMediaData );
NotifyEvent aNCmdEvt( EVENT_COMMAND, pWindow, &aCEvt );
if ( !ImplCallPreNotify( aNCmdEvt ) )
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index e7cc2939762c..b62d805d2ba7 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -5181,7 +5181,7 @@ static bool ImplHandleIMEEndComposition( HWND hWnd )
return bDef;
}
-static boolean ImplHandleAppCommand( HWND hWnd, LPARAM lParam )
+static boolean ImplHandleAppCommand( HWND hWnd, LPARAM lParam, LRESULT & nRet )
{
sal_Int16 nCommand = 0;
switch( GET_APPCOMMAND_LPARAM(lParam) )
@@ -5213,13 +5213,15 @@ static boolean ImplHandleAppCommand( HWND hWnd, LPARAM lParam )
if( pWindow )
{
const Point aPoint;
- CommandEvent aCEvt( aPoint, COMMAND_MEDIA, FALSE, &nCommand );
- NotifyEvent aNCmdEvt( EVENT_COMMAND, pWindow, &aCEvt );
+ CommandMediaData aMediaData(nCommand);
+ CommandEvent aCEvt( aPoint, COMMAND_MEDIA, FALSE, &aMediaData );
+ NotifyEvent aNCmdEvt( VENT_COMMAND, pWindow, &aCEvt );
if ( !ImplCallPreNotify( aNCmdEvt ) )
{
pWindow->Command( aCEvt );
- return true;
+ nRet = 1;
+ return !aMediaData.GetPassThroughToOS();
}
}
@@ -5847,10 +5849,9 @@ LRESULT CALLBACK SalFrameWndProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lP
break;
case WM_APPCOMMAND:
- if( ImplHandleAppCommand( hWnd, lParam ) )
+ if( ImplHandleAppCommand( hWnd, lParam, nRet ) )
{
rDef = false;
- nRet = 1;
}
break;
case WM_IME_REQUEST: