summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-04-07 16:55:37 +0100
committerMichael Stahl <mstahl@redhat.com>2017-04-10 12:44:04 +0200
commited4b4cf298af859c354629e0f88ad87161385175 (patch)
treea96b3bb00b3241fe86998b23b5c13697e902a089
parent1946bdabb8132a1989024f1bcd1d24806e1fae9e (diff)
Resolves: tdf#102286 lets not crash on null pFrame
this is the FlyEmbeddedPrt case ensure we don't end up with a null pFrame at return time (cherry picked from commit 5ce387c4812466e6752b434cf0f5a54f98c6a147) Change-Id: I68ff6f0a36462cffc47d774865e69041c4dd15a8 Reviewed-on: https://gerrit.libreoffice.org/36279 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--sw/source/core/frmedt/fews.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx
index c15266976511..9c1ff08b257e 100644
--- a/sw/source/core/frmedt/fews.cxx
+++ b/sw/source/core/frmedt/fews.cxx
@@ -121,12 +121,15 @@ const SwRect& SwFEShell::GetAnyCurRect( CurRectType eType, const Point* pPt,
case RECT_FLY_PRT_EMBEDDED: bFrame = false;
SAL_FALLTHROUGH;
- case RECT_FLY_EMBEDDED: pFrame = xObj.is() ? FindFlyFrame( xObj )
+ case RECT_FLY_EMBEDDED:
+ {
+ const SwFrame *pFlyFrame = xObj.is() ? FindFlyFrame(xObj) : nullptr;
+ pFrame = pFlyFrame ? pFlyFrame
: pFrame->IsFlyFrame()
? pFrame
: pFrame->FindFlyFrame();
break;
-
+ }
case RECT_OUTTABSECTION_PRT:
case RECT_OUTTABSECTION : if( pFrame->IsInTab() )
pFrame = pFrame->FindTabFrame();