make doc.meta an unordered_map

This commit is contained in:
Jean-Francois Dockes
2019-04-20 15:04:19 +02:00
parent 44cd3fd633
commit 54f0eda990
12 changed files with 44 additions and 45 deletions
+4 -5
View File
@@ -954,11 +954,10 @@ void PreviewTextEdit::displayFields()
txt += "|" + QString::fromUtf8(m_ipath.c_str());
txt += "</b><br><br>";
txt += "<dl>\n";
for (map<string,string>::const_iterator it = m_fdoc.meta.begin();
it != m_fdoc.meta.end(); it++) {
if (!it->second.empty())
txt += "<dt>" + QString::fromUtf8(it->first.c_str()) + "</dt> "
+ "<dd>" + QString::fromUtf8(escapeHtml(it->second).c_str())
for (const auto& entry: m_fdoc.meta) {
if (!entry.second.empty())
txt += "<dt>" + QString::fromUtf8(entry.first.c_str()) + "</dt> "
+ "<dd>" + QString::fromUtf8(escapeHtml(entry.second).c_str())
+ "</dd>\n";
}
txt += "</dl></body></html>";
+2 -3
View File
@@ -416,9 +416,8 @@ void RclMain::startNativeViewer(Rcl::Doc doc, int pagenum, QString term)
subs["U"] = url_encode(url);
subs["u"] = url;
// Let %(xx) access all metadata.
for (map<string,string>::const_iterator it = doc.meta.begin();
it != doc.meta.end(); it++) {
subs[it->first] = it->second;
for (const auto& ent :doc.meta) {
subs[ent.first] = ent.second;
}
execViewer(subs, enterHistory, execpath, lcmd, cmd, doc, execwflags);
}
+2 -2
View File
@@ -162,7 +162,7 @@ void ResTableDetailArea::createPopupMenu(const QPoint& pos)
// little processing
static string gengetter(const string& fld, const Rcl::Doc& doc)
{
map<string, string>::const_iterator it = doc.meta.find(fld);
const auto it = doc.meta.find(fld);
if (it == doc.meta.end()) {
return string();
}
@@ -171,7 +171,7 @@ static string gengetter(const string& fld, const Rcl::Doc& doc)
static string sizegetter(const string& fld, const Rcl::Doc& doc)
{
map<string, string>::const_iterator it = doc.meta.find(fld);
const auto it = doc.meta.find(fld);
if (it == doc.meta.end()) {
return string();
}