summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-02-09 15:41:54 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-02-09 15:41:54 +0000
commitecfeb72252c18c7fc94170e19a1ca6aba4116e72 (patch)
tree0dbfc87087cafa7ef97c421b339beed039ba78d3 /editeng
parentb8ba31a4028d8af77111b6a078f3ae0390db734b (diff)
coverity#1169828 Explicit null dereferenced
Change-Id: Iad58bc1f5295bdaaff4ba17e70cb3aa4d5fc5aca
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/impedit2.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index eb1e36681d71..514668c4e662 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -3982,12 +3982,10 @@ long ImpEditEngine::GetXPos(
if ( pPortion->GetExtraInfos()->nAsianCompressionTypes & CHAR_PUNCTUATIONRIGHT )
{
sal_uInt8 nType = GetCharTypeForCompression( pParaPortion->GetNode()->GetChar( nIndex ) );
- if ( nType == CHAR_PUNCTUATIONRIGHT )
+ if ( nType == CHAR_PUNCTUATIONRIGHT && !pLine->GetCharPosArray().empty() )
{
sal_Int32 n = nIndex - nTextPortionStart;
- const sal_Int32* pDXArray = NULL;
- if (!pLine->GetCharPosArray().empty())
- pDXArray = &pLine->GetCharPosArray()[0]+( nTextPortionStart-pLine->GetStart() );
+ const sal_Int32* pDXArray = &pLine->GetCharPosArray()[0]+( nTextPortionStart-pLine->GetStart() );
sal_Int32 nCharWidth = ( ( (n+1) < pPortion->GetLen() ) ? pDXArray[n] : pPortion->GetSize().Width() )
- ( n ? pDXArray[n-1] : 0 );
if ( (n+1) < pPortion->GetLen() )