When reading PDML files, skip all XML tokens at the start of the file till you reach the first element and then check whether it is 'pdml'
Fixes issue 132
This commit is contained in:
parent
50f20a5452
commit
42f716e693
@ -141,7 +141,14 @@ bool PdmlFileFormat::isMyFileFormat(const QString fileName)
|
|||||||
if (xml.hasError() || !xml.isStartDocument())
|
if (xml.hasError() || !xml.isStartDocument())
|
||||||
goto _close_exit;
|
goto _close_exit;
|
||||||
|
|
||||||
|
// skip everything until the start of the first element
|
||||||
|
while (!xml.isStartElement())
|
||||||
|
{
|
||||||
xml.readNext();
|
xml.readNext();
|
||||||
|
if (xml.hasError())
|
||||||
|
goto _close_exit;
|
||||||
|
}
|
||||||
|
|
||||||
if (!xml.hasError() && xml.isStartElement() && (xml.name() == "pdml"))
|
if (!xml.hasError() && xml.isStartElement() && (xml.name() == "pdml"))
|
||||||
ret = true;
|
ret = true;
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user