Project

General

Profile

Bug #3514 ยป w-batch-edit-proxy-model-fix-broken-indexes.patch

Jan Lindemann, 08/04/2014 02:15 PM

View differences:

src/Wt/WBatchEditProxyModel.C
759 759
  WModelIndex sourceIndex = mapToSource(index);
760 760

  
761 761
  if (sourceIndex.isValid())
762
    return sourceModel()->flags(index);
762
    return sourceModel()->flags(sourceIndex);
763 763
  else {
764 764
    std::map<int, WFlags<ItemFlag> >::const_iterator i
765 765
      = newRowFlags_.find(index.column());
766 766
    if (i != newRowFlags_.end())
767 767
      return i->second;
768 768
    else
769
      return WAbstractProxyModel::flags(index);
769
      return WAbstractProxyModel::flags(sourceIndex);
770 770
  }
771 771
}
772 772

  
test/models/WBatchEditProxyModelTest.C
149 149
  BOOST_REQUIRE(sm->rowCount() == 0);
150 150
  BOOST_REQUIRE(pm->rowCount() == 0);
151 151

  
152
  WModelIndex a = f.proxyModel_->index(1, 0);
153
  WModelIndex b = f.proxyModel_->mapToSource(a);
154
  WModelIndex c = f.proxyModel_->mapFromSource(b);
155
  BOOST_REQUIRE(a == c);
156

  
152 157
  pm->insertRows(0, 2);
153 158

  
154 159
  BOOST_REQUIRE(f.modelEvents_[SourceModel].size() == 0);
    (1-1/1)