summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-12-09 23:01:11 +0100
committerMichael Stahl <mstahl@redhat.com>2013-12-10 15:32:27 +0100
commitd7a6b5b24a339b7e4c5f30cde28b887b0dd8712b (patch)
treed19af55234ba6e713c2d03da4eae857b9932bdf8
parent8dd67ac98eca72e820ae365d5ceeb6a2eccec8ac (diff)
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 (cherry picked from commit 34140139840a181157690038fe845f5b33866b10)
-rw-r--r--sd/source/filter/eppt/pptx-text.cxx4
1 files changed, 3 insertions, 1 deletions
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;