| 2879 | } |
| 2880 | |
| 2881 | void ColumnPrivate::initDictionary() { |
| 2882 | m_dictionary.clear(); |
| 2883 | m_dictionaryFrequencies.clear(); |
| 2884 | if (!m_data || columnMode() != AbstractColumn::ColumnMode::Text) |
| 2885 | return; |
| 2886 | |
| 2887 | auto data = static_cast<QVector<QString>*>(m_data); |
| 2888 | for (auto& value : *data) { |
| 2889 | if (value.isEmpty()) |
| 2890 | continue; |
| 2891 | |
| 2892 | if (!m_dictionary.contains(value)) |
| 2893 | m_dictionary << value; |
| 2894 | |
| 2895 | if (m_dictionaryFrequencies.constFind(value) == m_dictionaryFrequencies.constEnd()) |
| 2896 | m_dictionaryFrequencies[value] = 1; |
| 2897 | else |
| 2898 | m_dictionaryFrequencies[value]++; |
| 2899 | } |
| 2900 | |
| 2901 | available.dictionary = true; |
| 2902 | } |
| 2903 | |
| 2904 | /** |
| 2905 | * \brief Set the content of row 'row' |
no test coverage detected