summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-06-01 17:10:42 +0200
committerMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-06-01 17:21:14 +0200
commit8d83c439bacb3155eec31fe3b4bf2c9990beb936 (patch)
tree0d067771b8e2c711ef1163a5853a18c8f3dbbcfa /vcl
parentd7eb2703913d9e07749bda0b5f6437ee7d423142 (diff)
fix crash if there is no OpenGLRenderer set
Change-Id: I6cd75aa2a9db7219b2873d0b6516ef9df4fbe33d
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/openglwin.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/vcl/source/window/openglwin.cxx b/vcl/source/window/openglwin.cxx
index 0300987af29e..f7b3cf3b584d 100644
--- a/vcl/source/window/openglwin.cxx
+++ b/vcl/source/window/openglwin.cxx
@@ -65,13 +65,15 @@ void OpenGLWindow::MouseButtonDown( const MouseEvent& rMEvt )
void OpenGLWindow::MouseButtonUp( const MouseEvent& rMEvt )
{
+ if(!mpRenderer)
+ return;
+
Point aPoint = rMEvt.GetPosPixel();
if(aPoint == maStartPoint)
{
Color aColor = GetPixel(aPoint);
SAL_WARN("vcl.opengl", aColor.GetColor());
- if(mpRenderer)
- mpRenderer->clickedAt(aPoint, rMEvt.GetButtons());
+ mpRenderer->clickedAt(aPoint, rMEvt.GetButtons());
}
else
{
@@ -82,14 +84,16 @@ void OpenGLWindow::MouseButtonUp( const MouseEvent& rMEvt )
void OpenGLWindow::Command( const CommandEvent& rCEvt )
{
+ if(!mpRenderer)
+ return;
+
if(rCEvt.GetCommand() == COMMAND_WHEEL)
{
const CommandWheelData* pData = rCEvt.GetWheelData();
if(pData->GetMode() == COMMAND_WHEEL_SCROLL)
{
long nDelta = pData->GetDelta();
- if(mpRenderer)
- mpRenderer->scroll(nDelta);
+ mpRenderer->scroll(nDelta);
}
}
}