summaryrefslogtreecommitdiff
path: root/sw/source/core/layout
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2019-07-31 15:16:02 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2019-08-01 11:00:48 +0200
commitb93216e8253c984a3ce36a9fc55516aa85f98d5f (patch)
treed14c5d734655df7d9100b3714f65ec27a69e41f6 /sw/source/core/layout
parent0dab9b7c83099a192ec61486e7a9fd04aecd3686 (diff)
tdf#126138 sw: invalid static_cast in SwTabFrame::FindLastContent()
Change-Id: I64412f32f1be78a647710e96f0a92cd78921d784 Reviewed-on: https://gerrit.libreoffice.org/76755 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'sw/source/core/layout')
-rw-r--r--sw/source/core/layout/tabfrm.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 21607647593b..76a064017ad8 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -3398,10 +3398,20 @@ SwContentFrame *SwTabFrame::FindLastContent()
while ( pRet->GetNext() )
pRet = pRet->GetNext();
- if( pRet->IsSctFrame() )
+ while (pRet && pRet->IsTabFrame()) // possibly there's only tables here!
+ { // tdf#126138 skip table, don't look inside
+ // TODO this is actually not ideal, e.g. SwFrame::FindNext_() might
+ // -if there's a table at the end- return a lower frame inside that
+ // table instead of the "next" one... probably this function should
+ // really return SwFrame* to be able to return a SwTabFrame?
+ pRet = pRet->GetPrev();
+ }
+
+ if (pRet && pRet->IsSctFrame())
pRet = static_cast<SwSectionFrame*>(pRet)->FindLastContent();
}
+ assert(pRet == nullptr || dynamic_cast<SwContentFrame*>(pRet));
return static_cast<SwContentFrame*>(pRet);
}