Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/1676

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/76/1676/1

Resolves: fdo#58324 keep both halves of surrogate pairs if glyph isn't found

Change-Id: I8fda443bb224a7a99b992611221a65e9869da8b9
---
M vcl/generic/glyphs/gcach_layout.cxx
1 file changed, 12 insertions(+), 2 deletions(-)



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 @@
     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 @@
                 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 );
                 }
 

-- 
To view, visit https://gerrit.libreoffice.org/1676
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8fda443bb224a7a99b992611221a65e9869da8b9
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Caolán McNamara <caolanm@redhat.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.