@@ -47,8 +47,8 @@ int DataViewport::addTabToDataViewport(String name,
4747 if (tabArray.size () == 0 )
4848 setVisible (true );
4949
50- if (tabArray.contains (tabIndex))
51- return tabIndex;
50+ // if (tabArray.contains(tabIndex))
51+ // return tabIndex;
5252
5353 addTab (name, Colours::lightgrey, component, false , tabIndex);
5454
@@ -77,10 +77,13 @@ int DataViewport::addTabToDataViewport(String name,
7777void DataViewport::addTabAtIndex (int tabIndex_, String tabName, Component* tabComponent)
7878{
7979
80- savedTabIndices.add (tabIndex_);
81- savedTabComponents.add (tabComponent);
82- savedTabNames.add (tabName);
83-
80+ if (!savedTabIndices.contains (tabIndex_))
81+ {
82+ savedTabIndices.add (tabIndex_);
83+ savedTabComponents.add (tabComponent);
84+ savedTabNames.add (tabName);
85+ }
86+
8487}
8588
8689
@@ -127,6 +130,8 @@ void DataViewport::saveStateToXml(XmlElement* xml)
127130void DataViewport::loadStateFromXml (XmlElement* xml)
128131{
129132
133+ // LOGD("DataViewport::loadStateFromXml()");
134+
130135 std::vector<int > tabOrder (savedTabIndices.size ());
131136 std::iota (tabOrder.begin (), tabOrder.end (), 0 ); // Initializing
132137 sort (tabOrder.begin (), tabOrder.end (), [&](int i, int j)
0 commit comments