Feature (contd.): Variable Fields - fixed 2nd protocol of combo protocols not being listed and offset/mask not being calculated correctly for them via the GUI

This commit is contained in:
Srivats P. 2015-05-31 20:47:25 +05:30
parent 6bb64a3b26
commit 022fac534c
2 changed files with 3 additions and 2 deletions

View File

@ -338,7 +338,7 @@ void VariableFieldsWidget::loadProtocolFields(
field->clear(); field->clear();
field->addItem("Custom"); field->addItem("Custom");
for (int i = 0; i < protocol->frameFieldCount(); i++) { for (int i = 0; i < protocol->fieldCount(); i++) {
if (!protocol->fieldFlags(i).testFlag(AbstractProtocol::FrameField)) if (!protocol->fieldFlags(i).testFlag(AbstractProtocol::FrameField))
continue; continue;
QString name = protocol->fieldData(i, AbstractProtocol::FieldName) QString name = protocol->fieldData(i, AbstractProtocol::FieldName)

View File

@ -361,7 +361,8 @@ int AbstractProtocol::fieldFrameBitOffset(int index, int streamIndex) const
{ {
int ofs = 0; int ofs = 0;
if ((index < 0) || (index >= frameFieldCount())) if ((index < 0) || (index >= fieldCount())
|| !fieldFlags(index).testFlag(FrameField))
return -1; return -1;
// Lookup Cache; if not available calculate and cache (if enabled) // Lookup Cache; if not available calculate and cache (if enabled)