mirror of
https://github.com/OpenMW/openmw.git
synced 2026-02-01 04:18:26 +00:00
Fix bad dynamic cast in subview
This commit is contained in:
parent
2b43186d0e
commit
12ec0dd60d
2 changed files with 7 additions and 4 deletions
|
|
@ -86,6 +86,9 @@ namespace CSVTools
|
|||
/// \return rows in the original model
|
||||
std::vector<int> getReplaceIndices(bool selection) const;
|
||||
|
||||
/// Return underlying report model
|
||||
CSMTools::ReportModel* getReportModel() const { return mModel; }
|
||||
|
||||
/// \param index row in the original model
|
||||
void flagAsReplaced(int index);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ void CSVTools::SearchSubView::replace(bool selection)
|
|||
|
||||
std::string replace = mSearchBox.getReplaceText();
|
||||
|
||||
const CSMTools::ReportModel& model = dynamic_cast<const CSMTools::ReportModel&>(*mTable->model());
|
||||
const CSMTools::ReportModel* model = mTable->getReportModel();
|
||||
|
||||
bool autoDelete = CSMPrefs::get()["Search & Replace"]["auto-delete"].isTrue();
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ void CSVTools::SearchSubView::replace(bool selection)
|
|||
// in a single string.
|
||||
for (std::vector<int>::const_reverse_iterator iter(indices.rbegin()); iter != indices.rend(); ++iter)
|
||||
{
|
||||
const CSMWorld::UniversalId& id = model.getUniversalId(*iter);
|
||||
const CSMWorld::UniversalId& id = model->getUniversalId(*iter);
|
||||
|
||||
CSMWorld::UniversalId::Type type = CSMWorld::UniversalId::getParentType(id.getType());
|
||||
|
||||
|
|
@ -52,7 +52,7 @@ void CSVTools::SearchSubView::replace(bool selection)
|
|||
currentTable = table;
|
||||
}
|
||||
|
||||
std::string hint = model.getHint(*iter);
|
||||
std::string hint = model->getHint(*iter);
|
||||
|
||||
if (search.verify(mDocument, table, id, hint))
|
||||
{
|
||||
|
|
@ -113,7 +113,7 @@ CSVTools::SearchSubView::SearchSubView(const CSMWorld::UniversalId& id, CSMDoc::
|
|||
void CSVTools::SearchSubView::setEditLock(bool locked)
|
||||
{
|
||||
mLocked = locked;
|
||||
mSearchBox.setEditLock(locked);
|
||||
mSearchBox.setEditLock(locked || mSearchBox.hasInvalidText());
|
||||
}
|
||||
|
||||
void CSVTools::SearchSubView::setStatusBar(bool show)
|
||||
|
|
|
|||
Loading…
Reference in a new issue