2
0

2 Revīzijas dcc59f9131 ... 0a09159375

Autors SHA1 Ziņojums Datums
  Kolja Strohm 0a09159375 fix problems with formatted texts so that they do not have to contain 0 byte anymore 6 mēneši atpakaļ
  Kolja Strohm 6720624bf3 improve performance of arrays 6 mēneši atpakaļ
2 mainītis faili ar 5 papildinājumiem un 5 dzēšanām
  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: