summaryrefslogtreecommitdiff
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-10 18:40:17 +0200
commit36a2af004e1a7b17a71d8327c7ae2b6091ab0ffa (patch)
tree3e6c6ab2848064576411c05a49b5edee755c2003
parentd7c3f01280f7d716d608a12d56cc9d6438da24f7 (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>
-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 c075a8ae6f59..8a38a97661db 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -3124,8 +3124,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() );