diff options
author | Jonathan Schultz <jonathan@imatix.com> | 2013-05-22 14:08:12 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2013-05-22 14:10:34 +0200 |
commit | 0b70e4ea4fcf0adccdfdf4886e5cc45d46479692 (patch) | |
tree | 45046466f899c707a2d83a2a59e98ba849c03aa9 /vcl/source/gdi/pdfwriter_impl.cxx | |
parent | 2dec489ebb75030ffaeaa6daf7d42472e23a5eb6 (diff) |
fdo#62846 incorrect glyph to Unicode mappings in PDFs
Change-Id: Idebc7f69f95d8f72626373475d8611ea68f1483a
Diffstat (limited to 'vcl/source/gdi/pdfwriter_impl.cxx')
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 3c7b186daec2..4e84f0711778 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -7619,7 +7619,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const String& rText, bool bT std::vector<sal_Ucs> aUnicodes; aUnicodes.reserve( nMaxGlyphs ); sal_Int32 pUnicodesPerGlyph[nMaxGlyphs]; - int pCharPosAry[nMaxGlyphs]; + int pCharPosAry[nMaxGlyphs+1]; sal_Int32 nAdvanceWidths[nMaxGlyphs]; const PhysicalFontFace* pFallbackFonts[nMaxGlyphs]; bool bVertical = m_aCurrentPDFState.m_aFont.IsVertical(); @@ -7768,14 +7768,14 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const String& rText, bool bT aUnicodes.push_back( rText.GetChar( sal::static_int_cast<xub_StrLen>(pCharPosAry[i]) ) ); pUnicodesPerGlyph[i] = 1; // try to handle ligatures and such - if( i < nGlyphs-1 ) + if( i < nGlyphs ) { nChars = pCharPosAry[i+1] - pCharPosAry[i]; // #i115618# fix for simple RTL+CTL cases // TODO: sanitize for RTL ligatures, more complex CTL, etc. if( nChars < 0 ) nChars = -nChars; - else if( nChars == 0 ) + else if( nChars == 0 ) nChars = 1; pUnicodesPerGlyph[i] = nChars; for( int n = 1; n < nChars; n++ ) |