summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-03-26 16:26:31 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-03-26 20:39:11 +0100
commit9befa8b1743526759b88e56afc98a78ba25100f6 (patch)
treebb1bd1a4b7a3e9eb3969fef05f68e8d7c5774c62 /sw/source
parent5c5eeecfd5ad156489302cc48c2ce03f1ed2d6c8 (diff)
cid#1474452 Unchecked dynamic_cast
Change-Id: Ib50140fad741d34eae0dfe28fd4ed03024d11e96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113165 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/text/itrcrsr.cxx4
1 files 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<SwPostItsPortion*>(pPor) : nullptr;
+ if (pPostItsPortion)
{
- SwPostItsPortion* pPostItsPortion = dynamic_cast<SwPostItsPortion*>(pPor);
if (!pPostItsPortion->IsScript()) // tdf#141079
{
// Offset would be nCurrStart + nLength below, do the same for post-it portions.