[Libreoffice-commits] .: editeng/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Tue Apr 3 15:44:32 PDT 2012
editeng/source/editeng/impedit2.cxx | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
New commits:
commit 71da75abda60172ee9b8f42c1bf5de2f48a731b9
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue Apr 3 18:45:55 2012 -0400
I need to check for empty-ness here too.
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index ec74f29..ecb4a89 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -4021,7 +4021,9 @@ long ImpEditEngine::GetXPos(
if ( nType == CHAR_PUNCTUATIONRIGHT )
{
sal_uInt16 n = nIndex - nTextPortionStart;
- const sal_Int32* pDXArray = &pLine->GetCharPosArray()[0]+( nTextPortionStart-pLine->GetStart() );
+ const sal_Int32* pDXArray = NULL;
+ if (!pLine->GetCharPosArray().empty())
+ 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() )
More information about the Libreoffice-commits
mailing list