[Libreoffice-commits] .: Branch 'libreoffice-4-0' - vcl/generic

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Jan 14 08:25:34 PST 2013


 vcl/generic/glyphs/gcach_layout.cxx |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 700da51c5629f3b6a9b7c8e651cabbeb66960731
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jan 14 16:00:58 2013 +0000

    Resolves: fdo#58324 keep both halves of surrogate pairs if glyph isn't found
    
    Change-Id: I8fda443bb224a7a99b992611221a65e9869da8b9
    Reviewed-on: https://gerrit.libreoffice.org/1676
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>

diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx
index a8ddc49..a9f373e 100644
--- a/vcl/generic/glyphs/gcach_layout.cxx
+++ b/vcl/generic/glyphs/gcach_layout.cxx
@@ -299,6 +299,16 @@ static bool lcl_CharIsJoiner(sal_Unicode cChar)
     return ((cChar == 0x200C) || (cChar == 0x200D));
 }
 
+static bool needPreviousCode(sal_Unicode cChar)
+{
+    return lcl_CharIsJoiner(cChar) || U16_IS_LEAD(cChar);
+}
+
+static bool needNextCode(sal_Unicode cChar)
+{
+    return lcl_CharIsJoiner(cChar) || U16_IS_TRAIL(cChar);
+}
+
 //See https://bugs.freedesktop.org/show_bug.cgi?id=31016
 #define ARABIC_BANDAID
 
@@ -439,9 +449,9 @@ bool IcuLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs)
                 if( nCharPos >= 0 )
                 {
                     rArgs.NeedFallback( nCharPos, bRightToLeft );
-                    if ( (nCharPos > 0) && lcl_CharIsJoiner(rArgs.mpStr[nCharPos-1]) )
+                    if ( (nCharPos > 0) && needPreviousCode(rArgs.mpStr[nCharPos-1]) )
                         rArgs.NeedFallback( nCharPos-1, bRightToLeft );
-                    else if ( (nCharPos + 1 < nEndRunPos) && lcl_CharIsJoiner(rArgs.mpStr[nCharPos+1]) )
+                    else if ( (nCharPos + 1 < nEndRunPos) && needNextCode(rArgs.mpStr[nCharPos+1]) )
                         rArgs.NeedFallback( nCharPos+1, bRightToLeft );
                 }
 


More information about the Libreoffice-commits mailing list