summaryrefslogtreecommitdiff
path: root/vcl/ios
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2012-09-04 09:40:57 +0300
committerTor Lillqvist <tml@iki.fi>2012-09-04 09:49:18 +0300
commit8951ef03b9e99ce468d063c2793a724558af27dc (patch)
treec73199ccf8daef821ab419d111fad431eeb7a70d /vcl/ios
parent3cac48044846522e095b84e3d98d7173cc849f58 (diff)
Workaround for crash on iOS
Change-Id: I947f7def862d2a238dc609a91d898f03dbd72b84
Diffstat (limited to 'vcl/ios')
-rw-r--r--vcl/ios/source/gdi/salcoretextlayout.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/vcl/ios/source/gdi/salcoretextlayout.cxx b/vcl/ios/source/gdi/salcoretextlayout.cxx
index 99151e886b0f..ff6552fed27a 100644
--- a/vcl/ios/source/gdi/salcoretextlayout.cxx
+++ b/vcl/ios/source/gdi/salcoretextlayout.cxx
@@ -421,6 +421,19 @@ bool CoreTextLayout::LayoutText(ImplLayoutArgs& args)
{
return false;
}
+
+ // If the string contains U+FFFD ("REPLACEMENT CHARACTER"), which
+ // happens at least for the ooo80484-1.slk document in
+ // sc_filters_test, the CTTypesetterCreateWithAttributedString()
+ // call below crashes, at least in the iOS simulator. Go figure.
+ // (In that case the string consists of *only* such characters,
+ // but play it safe.
+ for (int i = 0; i < m_chars_count; i++)
+ {
+ if (args.mpStr[args.mnMinCharPos+i] == 0xFFFD)
+ return false;
+ }
+
/* c0 and c1 are construction objects */
CFStringRef c0 = CFStringCreateWithCharactersNoCopy( NULL, &(args.mpStr[args.mnMinCharPos]), m_chars_count, kCFAllocatorNull );
if ( !c0 )