From 9befa8b1743526759b88e56afc98a78ba25100f6 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 26 Mar 2021 16:26:31 +0000 Subject: cid#1474452 Unchecked dynamic_cast MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib50140fad741d34eae0dfe28fd4ed03024d11e96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113165 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- sw/source/core/text/itrcrsr.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx index 4c39874eb862..f7c6380cb3bb 100644 --- a/sw/source/core/text/itrcrsr.cxx +++ b/sw/source/core/text/itrcrsr.cxx @@ -1558,9 +1558,9 @@ TextFrameIndex SwTextCursor::GetModelPositionForViewPoint( SwPosition *pPos, con if ( pPor->IsPostItsPortion() || pPor->IsBreakPortion() || pPor->InToxRefGrp() ) { - if (pPor->IsPostItsPortion()) + SwPostItsPortion* pPostItsPortion = pPor->IsPostItsPortion() ? dynamic_cast(pPor) : nullptr; + if (pPostItsPortion) { - SwPostItsPortion* pPostItsPortion = dynamic_cast(pPor); if (!pPostItsPortion->IsScript()) // tdf#141079 { // Offset would be nCurrStart + nLength below, do the same for post-it portions. -- cgit