CMP_TREE_MODEL_ADAPTER: use more suitable cache type

Fixes: lp:1671086
* https://bugs.launchpad.net/kicad/+bug/1671086
This commit is contained in:
Chris Pavlina 2017-03-08 12:34:00 -05:00
parent 2232edfb87
commit 3bddc14dc6
2 changed files with 3 additions and 3 deletions

View File

@ -353,8 +353,8 @@ int CMP_TREE_MODEL_ADAPTER::WidthFor( CMP_TREE_NODE& aNode, int aCol )
int wname = m_widget->GetTextExtent( aNode.Name ).x + kDataViewIndent; int wname = m_widget->GetTextExtent( aNode.Name ).x + kDataViewIndent;
int wdesc = m_widget->GetTextExtent( aNode.Desc ).x; int wdesc = m_widget->GetTextExtent( aNode.Desc ).x;
m_width_cache[&aNode][0] = wname; m_width_cache[&aNode].push_back( wname );
m_width_cache[&aNode][1] = wdesc; m_width_cache[&aNode].push_back( wdesc );
return m_width_cache[&aNode][aCol]; return m_width_cache[&aNode][aCol];
} }
} }

View File

@ -315,7 +315,7 @@ private:
wxDataViewColumn* m_col_desc; wxDataViewColumn* m_col_desc;
wxDataViewCtrl* m_widget; wxDataViewCtrl* m_widget;
typedef std::unordered_map<CMP_TREE_NODE*, int[2]> WIDTH_CACHE; typedef std::unordered_map<CMP_TREE_NODE*, std::vector<int>> WIDTH_CACHE;
static WIDTH_CACHE m_width_cache; static WIDTH_CACHE m_width_cache;