-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Renaming HtmlFormat to ToolTipFormat, and creating a new HtmlFormat. #343
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -792,30 +792,41 @@ class NeighborList : public IDataArray | |
{ | ||
QString info; | ||
QTextStream ss (&info); | ||
if(format == SIMPL::HtmlFormat) | ||
|
||
QString bgColor = ""; | ||
QString nameBgColor = ""; | ||
|
||
switch(format) | ||
{ | ||
case SIMPL::ToolTipFormat: | ||
bgColor = "bgcolor=\"#FFFCEA\""; | ||
nameBgColor = "bgcolor=\"#E9E7D6\""; | ||
case SIMPL::HtmlFormat: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If fall-through is intentional, make sure to document it ever time. |
||
{ | ||
ss << "<html><head></head>\n"; | ||
ss << "<body>\n"; | ||
ss << "<table cellpadding=\"4\" cellspacing=\"0\" border=\"0\">\n"; | ||
ss << "<tbody>\n"; | ||
ss << "<tr bgcolor=\"#FFFCEA\"><th colspan=2>Attribute Array Info</th></tr>"; | ||
ss << "<tr " << bgColor << "><th colspan=2>Attribute Array Info</th></tr>"; | ||
|
||
ss << "<tr bgcolor=\"#E9E7D6\"><th align=\"right\">Name:</th><td>" << getName() << "</td></tr>"; | ||
ss << "<tr " << nameBgColor << "><th align=\"right\">Name:</th><td>" << getName() << "</td></tr>"; | ||
|
||
ss << "<tr bgcolor=\"#FFFCEA\"><th align=\"right\">Type:</th><td>" << getTypeAsString() << "</td></tr>"; | ||
ss << "<tr " << bgColor << "><th align=\"right\">Type:</th><td>" << getTypeAsString() << "</td></tr>"; | ||
QLocale usa(QLocale::English, QLocale::UnitedStates); | ||
QString numStr = usa.toString(static_cast<qlonglong>(getNumberOfTuples())); | ||
ss << "<tr bgcolor=\"#FFFCEA\"><th align=\"right\">Number of Tuples:</th><td>" << numStr << "</td></tr>"; | ||
ss << "<tr bgcolor=\"#FFFCEA\"><th align=\"right\">Number of Lists:</th><td>" << getNumberOfLists() << "</td></tr>"; | ||
ss << "<tr " << bgColor << "><th align=\"right\">Number of Tuples:</th><td>" << numStr << "</td></tr>"; | ||
ss << "<tr " << bgColor << "><th align=\"right\">Number of Lists:</th><td>" << getNumberOfLists() << "</td></tr>"; | ||
|
||
ss << "</tbody></table>\n"; | ||
ss << "<br/>"; | ||
ss << "</body></html>"; | ||
break; | ||
} | ||
else | ||
{ | ||
|
||
default: | ||
ss << "Requested NeighborList information string format is not supported. " << format; | ||
break; | ||
} | ||
|
||
return info; | ||
} | ||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment here (before the
case SIMPL::HtmlFormat:
) stating that the fall-through is intentional. Better yet, use a commented out[[fallthrough]]
attribute to document the intention. Without any kind of documentation of intent, this looks like a mistake and could be easily "fixed" while trying to reduce compiler warnings.