From 270f959c38b47eee778a03ecfe18ef3bb1909634 Mon Sep 17 00:00:00 2001 From: iaom <18504285112@163.com> Date: Tue, 13 Apr 2021 13:57:02 +0800 Subject: [PATCH] Trying to optimize xml parser. --- libsearch/file-utils.cpp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/libsearch/file-utils.cpp b/libsearch/file-utils.cpp index 73dc8f5..6860ffd 100644 --- a/libsearch/file-utils.cpp +++ b/libsearch/file-utils.cpp @@ -548,7 +548,6 @@ void FileUtils::getDocxTextContent(QString &path,QString &textcontent) void FileUtils::getPptxTextContent(QString &path, QString &textcontent) { - //fix me :optimized by xpath?? QFileInfo info = QFileInfo(path); if(!info.exists()||info.isDir()) return; @@ -569,7 +568,9 @@ void FileUtils::getPptxTextContent(QString &path, QString &textcontent) QDomElement txbody; QDomElement ap; QDomElement ar; + QDomDocument doc; QDomElement at; +// QDomNodeList atList; for(int i =0;i= MAX_CONTENT_LENGTH/3) +// { +// file.close(); +// return; +// } +// } +// } + //This is ugly but seems more efficient when handel a large file. sptree = doc.firstChildElement("p:sld").firstChildElement("p:cSld").firstChildElement("p:spTree"); while(!sptree.isNull()) {