Pass buffer length to format string parse, for better default format

* If we are only looking at a 4-byte buffer, don't use a uint4 default or it
  will fail to display anything
This commit is contained in:
baldurk
2019-10-15 10:54:42 +01:00
parent 179dbb0e43
commit d48b84d8f5
+10 -2
View File
@@ -2112,8 +2112,12 @@ void BufferViewer::OnEventChanged(uint32_t eventId)
}
else
{
uint64_t len = m_ByteSize;
if(len == UINT64_MAX)
len = 0;
QString errors;
bufdata->vsinConfig.columns = FormatElement::ParseFormatString(m_Format, 0, true, errors);
bufdata->vsinConfig.columns = FormatElement::ParseFormatString(m_Format, len, true, errors);
ClearModels();
}
@@ -3260,7 +3264,11 @@ void BufferViewer::processFormat(const QString &format)
BufferConfiguration bufconfig;
QList<FormatElement> cols = FormatElement::ParseFormatString(format, 0, true, errors);
uint64_t len = m_ByteSize;
if(len == UINT64_MAX)
len = 0;
QList<FormatElement> cols = FormatElement::ParseFormatString(format, len, true, errors);
int maxNumRows = 1;