correctly handle return from Db::getDoc(udi...
This commit is contained in:
parent
da4e576330
commit
382ae1f718
@ -128,7 +128,8 @@ bool DocSequenceDb::getEnclosing(Rcl::Doc& doc, Rcl::Doc& pdoc)
|
|||||||
if (!FileInterner::getEnclosing(doc.url, doc.ipath, pdoc.url, pdoc.ipath,
|
if (!FileInterner::getEnclosing(doc.url, doc.ipath, pdoc.url, pdoc.ipath,
|
||||||
udi))
|
udi))
|
||||||
return false;
|
return false;
|
||||||
return m_q->whatDb()->getDoc(udi, pdoc);
|
bool dbret = m_q->whatDb()->getDoc(udi, pdoc);
|
||||||
|
return dbret && pdoc.pc != -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
list<string> DocSequenceDb::expand(Rcl::Doc &doc)
|
list<string> DocSequenceDb::expand(Rcl::Doc &doc)
|
||||||
|
|||||||
@ -135,7 +135,7 @@ bool DocSequenceHistory::getDoc(int num, Rcl::Doc &doc, string *sh)
|
|||||||
sh->erase();
|
sh->erase();
|
||||||
}
|
}
|
||||||
bool ret = m_db->getDoc(m_it->udi, doc);
|
bool ret = m_db->getDoc(m_it->udi, doc);
|
||||||
if (!ret) {
|
if (!ret || doc.pc == -1) {
|
||||||
doc.url = "UNKNOWN";
|
doc.url = "UNKNOWN";
|
||||||
doc.ipath = "";
|
doc.ipath = "";
|
||||||
}
|
}
|
||||||
@ -148,7 +148,8 @@ bool DocSequenceHistory::getEnclosing(Rcl::Doc& doc, Rcl::Doc& pdoc)
|
|||||||
if (!FileInterner::getEnclosing(doc.url, doc.ipath, pdoc.url, pdoc.ipath,
|
if (!FileInterner::getEnclosing(doc.url, doc.ipath, pdoc.url, pdoc.ipath,
|
||||||
udi))
|
udi))
|
||||||
return false;
|
return false;
|
||||||
return m_db->getDoc(udi, pdoc);
|
bool dbret = m_db->getDoc(udi, pdoc);
|
||||||
|
return dbret && pdoc.pc != -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int DocSequenceHistory::getResCnt()
|
int DocSequenceHistory::getResCnt()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user