summaryrefslogtreecommitdiffstats
path: root/sw/source/core/access/accpara.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/access/accpara.cxx')
-rw-r--r--sw/source/core/access/accpara.cxx19
1 files changed, 11 insertions, 8 deletions
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index aea0d2b3518f..8121d1c62389 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -431,15 +431,18 @@ bool SwAccessibleParagraph::HasCursor()
void SwAccessibleParagraph::UpdatePortionData()
{
// obtain the text frame
- OSL_ENSURE( GetFrame() != nullptr, "The text frame has vanished!" );
- OSL_ENSURE( GetFrame()->IsTextFrame(), "The text frame has mutated!" );
const SwTextFrame* pFrame = static_cast<const SwTextFrame*>( GetFrame() );
-
- // build new portion data
- m_pPortionData.reset( new SwAccessiblePortionData(
- pFrame, GetMap()->GetShell()->GetViewOptions()) );
- pFrame->VisitPortions( *m_pPortionData );
-
+ OSL_ENSURE( pFrame != nullptr, "The text frame has vanished!" );
+ if (!pFrame)
+ ClearPortionData();
+ else
+ {
+ OSL_ENSURE( pFrame->IsTextFrame(), "The text frame has mutated!" );
+ // build new portion data
+ m_pPortionData.reset( new SwAccessiblePortionData(
+ pFrame, GetMap()->GetShell()->GetViewOptions()) );
+ pFrame->VisitPortions( *m_pPortionData );
+ }
OSL_ENSURE( m_pPortionData != nullptr, "UpdatePortionData() failed" );
}