Merge remote-tracking branch 'artemutin/scriptSearchRedirect'

openmw-37
Marc Zinnschlag 9 years ago
commit 3b39572274

@ -198,16 +198,33 @@ void CSVWorld::ScriptSubView::useHint (const std::string& hint)
if (hint.empty())
return;
if (hint[0]=='l')
{
unsigned line = 0, column = 0;
char c;
std::istringstream stream (hint.c_str()+1);
switch(hint[0]){
case 'R':
case 'r':
{
QModelIndex index = mModel->getModelIndex (getUniversalId().getId(), mColumn);
QString source = mModel->data (index).toString();
unsigned pos, dummy;
if (!(stream >> c >> dummy >> pos) )
return;
char ignore;
int line;
int column;
for (unsigned i = 0; i <= pos; ++i){
if (source[i] == '\n'){
++line;
column = i+1;
}
}
column = pos - column;
break;
}
case 'l':
if (!(stream >> c >> line >> column))
return;
}
if (stream >> ignore >> line >> column)
{
QTextCursor cursor = mEditor->textCursor();
cursor.movePosition (QTextCursor::Start);
@ -216,8 +233,6 @@ void CSVWorld::ScriptSubView::useHint (const std::string& hint)
mEditor->setFocus();
mEditor->setTextCursor (cursor);
}
}
}
void CSVWorld::ScriptSubView::textChanged()

Loading…
Cancel
Save