clean up wordParts system in Message

This commit is contained in:
Rasmus Karlsson
2017-01-28 20:29:02 +01:00
parent a38b3c1626
commit fbb6868b70
2 changed files with 45 additions and 50 deletions
+7 -7
View File
@@ -22,9 +22,6 @@ public:
~Message()
{
if (wordParts != NULL) {
delete wordParts;
}
}
bool
@@ -66,7 +63,7 @@ public:
const std::vector<WordPart>
getWordParts() const
{
return *wordParts;
return wordParts;
}
bool
@@ -119,20 +116,23 @@ private:
int height = 0;
std::vector<Word> words;
std::vector<WordPart> *wordParts;
std::vector<WordPart> wordParts;
long currentLayoutWidth = -1;
bool relayoutRequested = true;
int fontGeneration = -1;
int emoteGeneration = -1;
void alignWordParts(int lineStart, int lineHeight);
static QString matchLink(const QString &string);
static bool sortTwitchEmotes(
const std::pair<long int, LazyLoadedImage *> &a,
const std::pair<long int, LazyLoadedImage *> &b);
};
}
}
} // namespace messages
} // namespace chatterino
#endif // MESSAGE_H