summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-08-10 16:43:11 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-08-11 11:49:21 +0200
commit22b9bee790a6b63b11369a7ae7257ceaef9d8585 (patch)
tree195fffcde2935c4fcfba85684a79a14a0c1d2a94 /editeng
parentde765158b372d5f7bbb1b37c7d6be695ab6104ac (diff)
tdf#119169 impress, crash when editing bulleted list
regression from commit e278df1a14c5cb5dbb7add5d6ed5dd52da131e92 tdf#108608 Draw file unresponsive on large text pasted into textbox Somewhere up in the accessibility code it has a stale paragraph index. Judging up other code in this class, that is fairly common, so just add similar safety checks. The old code (pre-regression) only worked because it iterated over all paragraphs, and it just ignored the paragraph index. Change-Id: I51c573b95f976fa87228e4f7e9f33bd6ea0dc3c8 Reviewed-on: https://gerrit.libreoffice.org/58836 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 36a2af004e1a7b17a71d8327c7ae2b6091ab0ffa) Reviewed-on: https://gerrit.libreoffice.org/58855
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/impedit2.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 4bd83aa6e644..7e8fb846136a 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -3110,8 +3110,9 @@ sal_uInt32 ImpEditEngine::CalcParaWidth( sal_Int32 nPara, bool bIgnoreExtraSpace
// Over all the paragraphs ...
+ OSL_ENSURE( 0 <= nPara && nPara < GetParaPortions().Count(), "CalcParaWidth: Out of range" );
ParaPortion* pPortion = GetParaPortions()[nPara];
- if ( pPortion->IsVisible() )
+ if ( pPortion && pPortion->IsVisible() )
{
const SvxLRSpaceItem& rLRItem = GetLRSpaceItem( pPortion->GetNode() );
sal_Int32 nSpaceBeforeAndMinLabelWidth = GetSpaceBeforeAndMinLabelWidth( pPortion->GetNode() );