From 55de85579c31c3205109506bf3bdf391fa67033d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20T=C5=AFma?= Date: Sat, 20 Apr 2024 19:57:52 +0200 Subject: [PATCH] Move the tables to the function where they are used --- src/map/IMG/lblfile.cpp | 52 ++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/src/map/IMG/lblfile.cpp b/src/map/IMG/lblfile.cpp index c2c7659b..9e04a2bd 100644 --- a/src/map/IMG/lblfile.cpp +++ b/src/map/IMG/lblfile.cpp @@ -7,33 +7,6 @@ using namespace IMG; enum Charset {Normal, Symbol, Special}; -static const quint8 NORMAL_CHARS[] = { - ' ', 'A', 'B', 'C', 'D', 'E', 'F', 'G', - 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', - 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', - 'X', 'Y', 'Z', '~', '~', '~', ' ', ' ', - '0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', '~', '~', '~', '~', '~', '~' -}; - -static const quint8 SYMBOL_CHARS[] = { - '@', '!', '"', '#', '$', '%', '&', '\'', - '(', ')', '*', '+', ',', '-', '.', '/', - '~', '~', '~', '~', '~', '~', '~', '~', - '~', '~', ':', ';', '<', '=', '>', '?', - '~', '~', '~', '~', '~', '~', '~', '~', - '~', '~', '~', '[', '\\', ']', '^', '_' -}; - -static const quint8 SPECIAL_CHARS[] = { - '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', - 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', - 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', - 'x', 'y', 'z', '~', '~', '~', '~', '~', - '0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', '~', '~', '~', '~', '~', '~' -}; - static bool isAllUpperCase(const QString &str) { if (str.isEmpty()) @@ -75,6 +48,7 @@ static QByteArray ft2m(const QByteArray &str) return ok ? QByteArray::number(qRound(number * 0.3048)) : str; } + LBLFile::~LBLFile() { delete _huffmanText; @@ -189,6 +163,30 @@ Label LBLFile::str2label(const QVector &str, bool capitalize, Label LBLFile::label6b(const SubFile *file, Handle &fileHdl, quint32 size, bool capitalize, bool convert) const { + static const quint8 NORMAL_CHARS[] = { + ' ', 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '~', '~', '~', ' ', ' ', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', '~', '~', '~', '~', '~', '~' + }; + static const quint8 SYMBOL_CHARS[] = { + '@', '!', '"', '#', '$', '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', + '~', '~', '~', '~', '~', '~', '~', '~', + '~', '~', ':', ';', '<', '=', '>', '?', + '~', '~', '~', '~', '~', '~', '~', '~', + '~', '~', '~', '[', '\\', ']', '^', '_' + }; + static const quint8 SPECIAL_CHARS[] = { + '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', '~', '~', '~', '~', '~', + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', '~', '~', '~', '~', '~', '~' + }; Shield::Type shieldType = Shield::None; QByteArray label, shieldLabel; QByteArray *bap = &label; -- 2.11.4.GIT