summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-01-28 13:37:51 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-01-28 14:30:41 +0000
commit0ae60c3c3580bcca595e0e6e277be4651076d3bd (patch)
tree1ebc495209871ae7b747cf93efc629c15876afe3 /svx
parent3acf5f61b009160b89491d75ab1153798f653563 (diff)
coverity#705898 Dereference before null check
Change-Id: I16029411bd758914e87c7dc020ff8779218fefaa
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdedxv.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 87df0533f871..be05624cfd1d 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1228,11 +1228,14 @@ sal_Bool SdrObjEditView::MouseButtonDown(const MouseEvent& rMEvt, Window* pWin)
}
if (bPostIt) {
Point aPixPos(rMEvt.GetPosPixel());
- Rectangle aR(pWin->LogicToPixel(pTextEditOutlinerView->GetOutputArea()));
- if (aPixPos.X()<aR.Left ()) aPixPos.X()=aR.Left ();
- if (aPixPos.X()>aR.Right ()) aPixPos.X()=aR.Right ();
- if (aPixPos.Y()<aR.Top ()) aPixPos.Y()=aR.Top ();
- if (aPixPos.Y()>aR.Bottom()) aPixPos.Y()=aR.Bottom();
+ if (pWin)
+ {
+ Rectangle aR(pWin->LogicToPixel(pTextEditOutlinerView->GetOutputArea()));
+ if (aPixPos.X()<aR.Left ()) aPixPos.X()=aR.Left ();
+ if (aPixPos.X()>aR.Right ()) aPixPos.X()=aR.Right ();
+ if (aPixPos.Y()<aR.Top ()) aPixPos.Y()=aR.Top ();
+ if (aPixPos.Y()>aR.Bottom()) aPixPos.Y()=aR.Bottom();
+ }
MouseEvent aMEvt(aPixPos,rMEvt.GetClicks(),rMEvt.GetMode(),
rMEvt.GetButtons(),rMEvt.GetModifier());
if (pTextEditOutlinerView->MouseButtonDown(aMEvt)) {