@@ -626,11 +626,11 @@ void TableBrowser::clearAllCondFormats(size_t column)
626626void TableBrowser::clearRowIdFormats (const QModelIndex index)
627627{
628628
629- std::vector<CondFormat>& rowIdFormats = m_settings[currentlyBrowsedTableName ()].rowIdFormats [index.column ()];
629+ std::vector<CondFormat>& rowIdFormats = m_settings[currentlyBrowsedTableName ()].rowIdFormats [static_cast < size_t >( index.column () )];
630630 rowIdFormats.erase (std::remove_if (rowIdFormats.begin (), rowIdFormats.end (), [&](const CondFormat& format) {
631631 return format.filter () == QString (" =%1" ).arg (m_model->data (index.sibling (index.row (), 0 )).toString ());
632632 }), rowIdFormats.end ());
633- m_model->setCondFormats (true , index.column (), rowIdFormats);
633+ m_model->setCondFormats (true , static_cast < size_t >( index.column () ), rowIdFormats);
634634 emit projectModified ();
635635
636636}
@@ -650,19 +650,20 @@ void TableBrowser::editCondFormats(size_t column)
650650}
651651void TableBrowser::modifySingleFormat (const bool isRowIdFormat, const QString& filter, const QModelIndex refIndex, std::function<void (CondFormat&)> changeFunction)
652652{
653+ const size_t column = static_cast <size_t >(refIndex.column ());
653654 BrowseDataTableSettings& settings = m_settings[currentlyBrowsedTableName ()];
654- std::vector<CondFormat>& formats = isRowIdFormat ? settings.rowIdFormats [refIndex. column () ] : settings.condFormats [refIndex. column () ];
655+ std::vector<CondFormat>& formats = isRowIdFormat ? settings.rowIdFormats [column] : settings.condFormats [column];
655656 auto it = std::find_if (formats.begin (), formats.end (), [&filter](const CondFormat& format) {
656657 return format.filter () == filter;
657658 });
658659 if (it != formats.end ()) {
659660 changeFunction (*it);
660- m_model->addCondFormat (isRowIdFormat, refIndex. column () , *it);
661+ m_model->addCondFormat (isRowIdFormat, column, *it);
661662 } else {
662663 // Create a new conditional format based on the current reference index and then modify it as requested using the passed function.
663664 CondFormat newCondFormat (filter, m_model, refIndex, m_model->encoding ());
664665 changeFunction (newCondFormat);
665- addCondFormat (isRowIdFormat, refIndex. column () , newCondFormat);
666+ addCondFormat (isRowIdFormat, column, newCondFormat);
666667 }
667668}
668669
0 commit comments