[Konsole-devel] [Bug 276720] Assert in screen emulation

Albert Astals Cid tsdgeos at terra.es
Wed Jun 29 08:08:38 UTC 2011


https://bugs.kde.org/show_bug.cgi?id=276720





--- Comment #1 from Albert Astals Cid <tsdgeos terra es>  2011-06-29 08:08:38 ---
There is indeed a problem when rendering the Name[th] for that file

This patch seems like it would be the correct thing to do

diff --git a/src/Screen.cpp b/src/Screen.cpp
index 03a4bbd..acb0303 100644
--- a/src/Screen.cpp
+++ b/src/Screen.cpp
@@ -660,10 +660,28 @@ void Screen::displayCharacter(unsigned short c)
             charToCombineWithY = cuY;
         }
         Character& currentChar =
screenLines[charToCombineWithY][charToCombineWithX];
-        Q_ASSERT((currentChar.rendition & RE_EXTENDED_CHAR) == 0);
-        const ushort chars[2] = { currentChar.character, c };
-        currentChar.rendition |= RE_EXTENDED_CHAR;
-        currentChar.character =
ExtendedCharTable::instance.createExtendedChar(chars, 2);
+        if ((currentChar.rendition & RE_EXTENDED_CHAR) == 0)
+        {
+            const ushort chars[2] = { currentChar.character, c };
+            currentChar.rendition |= RE_EXTENDED_CHAR;
+            currentChar.character =
ExtendedCharTable::instance.createExtendedChar(chars, 2);
+        }
+        else
+        {
+            ushort extendedCharLength;
+            const ushort* oldChars =
ExtendedCharTable::instance.lookupExtendedChar(currentChar.character,
extendedCharLength);
+            Q_ASSERT(oldChars);
+            if (oldChars)
+            {
+                Q_ASSERT(extendedCharLength > 1);
+                Q_ASSERT(extendedCharLength < 65535);
+                ushort *chars = new ushort[extendedCharLength + 1];
+                memcpy (chars, oldChars, sizeof(ushort) * extendedCharLength);
+                chars[extendedCharLength] = currentChar.character;
+                currentChar.character =
ExtendedCharTable::instance.createExtendedChar(chars, extendedCharLength);
+                delete[] chars;
+            }
+        }
         return;
     }

But actually gives a somewhat worse rendering than the old konsole so i have to
research a bit how th works and what kind of characters are trying to be
composed. I'm a bit busy the coming days so not sure i'll be able of having a
look before next monday

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the konsole-devel mailing list