From 34140139840a181157690038fe845f5b33866b10 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 9 Dec 2013 23:01:11 +0100 Subject: sd: PPT export: fix assert on 0-length text portions Not sure if such are legit, but this should fix the crash. Change-Id: Idf8a3a67ddae464533d431f1a6a2ebea6d6c2213 --- sd/source/filter/eppt/pptx-text.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sd/source/filter/eppt/pptx-text.cxx b/sd/source/filter/eppt/pptx-text.cxx index 1efc7791d55b..0a45ad0358b2 100644 --- a/sd/source/filter/eppt/pptx-text.cxx +++ b/sd/source/filter/eppt/pptx-text.cxx @@ -129,7 +129,9 @@ PortionObj::PortionObj( ::com::sun::star::uno::Reference< ::com::sun::star::text { // For i39516 - a closing parenthesis that ends an RTL string is displayed backwards by PPT // Solution: add a Unicode Right-to-Left Mark, following the method described in i18024 - if ( bLast && aString[ aString.getLength() - 1 ] == ')' && rFontCollection.GetScriptDirection( aString ) == com::sun::star::i18n::ScriptDirection::RIGHT_TO_LEFT ) + if (bLast && !aString.isEmpty() + && aString[aString.getLength() - 1] == ')' + && rFontCollection.GetScriptDirection(aString) == com::sun::star::i18n::ScriptDirection::RIGHT_TO_LEFT) { mnTextSize++; bRTL_endingParen = sal_True; -- cgit