mirror of
https://github.com/NohamR/Reclass.git
synced 2026-05-10 19:59:21 +00:00
Fix 13 logic bugs and UI issues across editor, controller, and core
Round 1: Fix updateCommandRow offset, structTypeName undo, changeNodeKind macro, shift-click kCommandRowId leak, type filter byte-vs-column bug. Round 2: Move kFooterIdBit to core.h, add RcxEditor destructor for cursor cleanup, defer refresh during batch ops, use newline separator in type picker, narrow selection on double-click edit, clear hover on keyboard scroll, guard 0x prefix from deletion, cap array count at 100k.
This commit is contained in:
@@ -51,6 +51,14 @@ QString arrayTypeName(NodeKind elemKind, int count) {
|
||||
return elem + QStringLiteral("[") + QString::number(count) + QStringLiteral("]");
|
||||
}
|
||||
|
||||
// Pointer type string: "ptr64<void>" or "ptr64<StructName>"
|
||||
QString pointerTypeName(NodeKind kind, const QString& targetName) {
|
||||
auto* m = kindMeta(kind);
|
||||
QString base = m ? QString::fromLatin1(m->typeName) : QStringLiteral("???");
|
||||
QString target = targetName.isEmpty() ? QStringLiteral("void") : targetName;
|
||||
return base + QStringLiteral("<") + target + QStringLiteral(">");
|
||||
}
|
||||
|
||||
// ── Value formatting ──
|
||||
|
||||
static QString hexVal(uint64_t v) {
|
||||
@@ -132,6 +140,22 @@ QString fmtArrayHeader(const Node& node, int depth, int /*viewIdx*/, bool collap
|
||||
return ind + type + SEP + name + SEP + suffix;
|
||||
}
|
||||
|
||||
// ── Pointer header (merged pointer + struct header) ──
|
||||
|
||||
QString fmtPointerHeader(const Node& node, int depth, bool collapsed,
|
||||
const Provider& prov, uint64_t addr,
|
||||
const QString& ptrTypeName, int colType, int colName) {
|
||||
QString ind = indent(depth);
|
||||
QString type = fit(ptrTypeName, colType);
|
||||
QString name = fit(node.name, colName);
|
||||
if (collapsed) {
|
||||
// Collapsed: show pointer value instead of brace
|
||||
QString val = fit(readValue(node, prov, addr, 0), COL_VALUE);
|
||||
return ind + type + SEP + name + SEP + val;
|
||||
}
|
||||
return ind + type + SEP + name + SEP + QStringLiteral("{");
|
||||
}
|
||||
|
||||
// ── Hex / ASCII preview ──
|
||||
|
||||
static inline bool isAsciiPrintable(uint8_t c) { return c >= 0x20 && c <= 0x7E; }
|
||||
@@ -277,9 +301,10 @@ QString readValue(const Node& node, const Provider& prov,
|
||||
|
||||
QString fmtNodeLine(const Node& node, const Provider& prov,
|
||||
uint64_t addr, int depth, int subLine,
|
||||
const QString& comment, int colType, int colName) {
|
||||
const QString& comment, int colType, int colName,
|
||||
const QString& typeOverride) {
|
||||
QString ind = indent(depth);
|
||||
QString type = typeName(node.kind, colType);
|
||||
QString type = typeOverride.isEmpty() ? typeName(node.kind, colType) : fit(typeOverride, colType);
|
||||
QString name = fit(node.name, colName);
|
||||
// Blank prefix for continuation lines (same width as type+sep+name+sep)
|
||||
const int prefixW = colType + colName + 2 * kSepWidth;
|
||||
|
||||
Reference in New Issue
Block a user