- if ((theIndex.column() == 1) && (theIndex.internalId() == HistoryNode)) {
- int aOldId = lastHistoryRow();
- setLastHistoryItem(theIndex);
- int aStartRow = std::min(aOldId, theIndex.row());
- int aEndRow = std::max(aOldId, theIndex.row());
- for (int i = aStartRow; i <= aEndRow; i++) {
- aTreeView->update(createIndex(i, 0, HistoryNode));
- aTreeView->update(createIndex(i, 1, HistoryNode));
- }
+ if (myActivePartModel)
+ // It means that the root document is not active
+ return;
+ QModelIndex aNewIndex;
+ if (theIndex.internalId() == HistoryNode)
+ aNewIndex = theIndex;
+ int aOldId = lastHistoryRow();
+ setLastHistoryItem(theIndex);
+ int aStartRow = std::min(aOldId, theIndex.row());
+ int aEndRow = std::max(aOldId, theIndex.row());
+ for (int i = aStartRow; i <= aEndRow; i++) {
+ aTreeView->update(createIndex(i, 0, HistoryNode));
+ aTreeView->update(createIndex(i, 1, HistoryNode));