1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

A few more internal updates for better smart pointer use

This commit is contained in:
jules 2019-05-19 11:44:22 +01:00
parent 49fa0f73e4
commit c6d1828a32
8 changed files with 39 additions and 50 deletions

View file

@ -436,32 +436,29 @@ String TableHeaderComponent::toString() const
void TableHeaderComponent::restoreFromString (const String& storedVersion)
{
if (auto storedXML = parseXML (storedVersion))
if (auto storedXML = parseXMLIfTagMatches (storedVersion, "TABLELAYOUT"))
{
if (storedXML->hasTagName ("TABLELAYOUT"))
int index = 0;
forEachXmlChildElement (*storedXML, col)
{
int index = 0;
auto tabId = col->getIntAttribute ("id");
forEachXmlChildElement (*storedXML, col)
if (auto* ci = getInfoForId (tabId))
{
auto tabId = col->getIntAttribute ("id");
if (auto* ci = getInfoForId (tabId))
{
columns.move (columns.indexOf (ci), index);
ci->width = col->getIntAttribute ("width");
setColumnVisible (tabId, col->getBoolAttribute ("visible"));
}
++index;
columns.move (columns.indexOf (ci), index);
ci->width = col->getIntAttribute ("width");
setColumnVisible (tabId, col->getBoolAttribute ("visible"));
}
columnsResized = true;
sendColumnsChanged();
setSortColumnId (storedXML->getIntAttribute ("sortedCol"),
storedXML->getBoolAttribute ("sortForwards", true));
++index;
}
columnsResized = true;
sendColumnsChanged();
setSortColumnId (storedXML->getIntAttribute ("sortedCol"),
storedXML->getBoolAttribute ("sortForwards", true));
}
}