2 次代码提交 dcc59f9131 ... 0a09159375

作者 SHA1 备注 提交日期
  Kolja Strohm 0a09159375 fix problems with formatted texts so that they do not have to contain 0 byte anymore 6 月之前
  Kolja Strohm 6720624bf3 improve performance of arrays 6 月之前
共有 2 个文件被更改,包括 5 次插入5 次删除
  1. 4 4
      Array.h
  2. 1 1
      TextFeld.cpp

+ 4 - 4
Array.h

@@ -407,13 +407,12 @@ namespace Framework
         void leeren()
         {
             ArrayEintrag<TYP>* e2 = 0;
-            for (ArrayEintrag<TYP>* e = entries; e; e = e->next)
+            for (ArrayEintrag<TYP>* e = entries->next; e; e = e->next)
             {
                 delete e2;
                 e2 = e;
             }
             delete e2;
-            entries = new ArrayEintrag<TYP>();
             entries->set = 0;
             entries->next = 0;
             last = entries;
@@ -710,14 +709,15 @@ namespace Framework
         //! Löscht alle Elemente der Liste
         void leeren()
         {
-            for (ArrayEintrag<TYP*>* e = entries; e;)
+            for (ArrayEintrag<TYP*>* e = entries->next; e;)
             {
                 if (e && e->var && e->set) e->var->release();
                 auto tmp = e->next;
                 delete e;
                 e = tmp;
             }
-            entries = new ArrayEintrag<TYP*>();
+            if (entries && entries->var && entries->set)
+                entries->var->release();
             entries->set = 0;
             entries->next = 0;
             last = entries;

+ 1 - 1
TextFeld.cpp

@@ -613,7 +613,7 @@ void TextFeld::setFormattedText(const char* txt)
             tm->textStyle.add(current);
             break;
         case 6:
-            current.rendererIndex = (unsigned char)txt[++i];
+            current.rendererIndex = (unsigned char)(txt[++i] - 1);
             tm->textStyle.add(current);
             break;
         case 7: