summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
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.