Fix problems which occurred when using functions like open-parents with multiple indexes containing identical paths (udis)
This commit is contained in:
@@ -38,14 +38,16 @@ int DocSequence::getSeqSlice(int offs, int cnt, vector<ResListEntry>& result)
|
||||
|
||||
bool DocSequence::getEnclosing(Rcl::Doc& doc, Rcl::Doc& pdoc)
|
||||
{
|
||||
// Note: no need for setQuery here, we're just passing through a
|
||||
// query-independant request
|
||||
|
||||
Rcl::Db *db = getDb();
|
||||
if (db == 0) {
|
||||
LOGERR(("DocSequence::getEnclosing: no db\n"));
|
||||
return false;
|
||||
}
|
||||
string udi;
|
||||
if (!FileInterner::getEnclosing(doc.url, doc.ipath, pdoc.url, pdoc.ipath,
|
||||
udi))
|
||||
if (!FileInterner::getEnclosingUDI(doc, udi))
|
||||
return false;
|
||||
bool dbret = getDb()->getDoc(udi, pdoc);
|
||||
|
||||
bool dbret = db->getDoc(udi, doc, pdoc);
|
||||
return dbret && pdoc.pc != -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -136,7 +136,10 @@ bool DocSequenceHistory::getDoc(int num, Rcl::Doc &doc, string *sh)
|
||||
} else
|
||||
sh->erase();
|
||||
}
|
||||
bool ret = m_db->getDoc(m_it->udi, doc);
|
||||
|
||||
// For now history does not store an index id. Use empty doc as ref.
|
||||
Rcl::Doc idxdoc;
|
||||
bool ret = m_db->getDoc(m_it->udi, idxdoc, doc);
|
||||
if (!ret || doc.pc == -1) {
|
||||
doc.url = "UNKNOWN";
|
||||
doc.ipath = "";
|
||||
|
||||
Reference in New Issue
Block a user