[FIX]Some 'doc' type could not be read.

This commit is contained in:
iaom 2021-03-09 09:56:47 +08:00
parent 8fb9eb38c4
commit 74eaa6fdb5
2 changed files with 3 additions and 1 deletions

View File

@ -42,7 +42,7 @@ void FileReader::getTextContent(QString path, QString &textContent)
if(strsfx.endsWith( "txt")) if(strsfx.endsWith( "txt"))
FileUtils::getTxtContent(path,textContent); FileUtils::getTxtContent(path,textContent);
} }
else if(type.inherits("application/msword")) else if(type.inherits("application/msword") || type.name() == "application/x-ole-storage")
{ {
if (strsfx.endsWith("doc")) if (strsfx.endsWith("doc"))
{ {

View File

@ -5067,6 +5067,8 @@ bool KBinaryParser::read8DocText(FILE *pFile, const ppsInfoType *pPPS,
//need more format document //need more format document
ptaucBytes = (UCHAR*)xfree((void*)ptaucBytes); ptaucBytes = (UCHAR*)xfree((void*)ptaucBytes);
qWarning()<<"Parser error:"<<m_strFileName; qWarning()<<"Parser error:"<<m_strFileName;
// content.append(QString::fromStdString((char*)ptaucBytes).replace("\r",""));
// ptaucBytes = (UCHAR*)xfree((void*)ptaucBytes);
} }
} }
} }