summaryrefslogtreecommitdiffstats
path: root/quanta/parsers/dtd/dtdparser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'quanta/parsers/dtd/dtdparser.cpp')
-rw-r--r--quanta/parsers/dtd/dtdparser.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/quanta/parsers/dtd/dtdparser.cpp b/quanta/parsers/dtd/dtdparser.cpp
index 502551fd..9de0f39a 100644
--- a/quanta/parsers/dtd/dtdparser.cpp
+++ b/quanta/parsers/dtd/dtdparser.cpp
@@ -13,6 +13,10 @@
* *
***************************************************************************/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
//qt includes
#include <tqcheckbox.h>
#include <tqfile.h>
@@ -32,10 +36,6 @@
#include <tdeio/netaccess.h>
//other includes
-#ifdef LIBXML_2_5
-#include <libxml/hash.h>
-#endif
-
#include <libxml/parser.h>
#include <libxml/valid.h>
@@ -82,8 +82,8 @@ bool DTDParser::parse(const TQString &targetDir, bool entitiesOnly)
if( DTD::dtd_ptr == NULL )
{
TQString errorStr = i18n("Unknown");
-#ifndef LIBXML_2_5
- xmlErrorPtr errorPtr = xmlGetLastError();
+ // The type used is either xmlErrorPtr or const xmlError*
+ auto errorPtr = xmlGetLastError();
if (errorPtr != NULL)
{
TQString s = TQString::fromLatin1(errorPtr->message);
@@ -99,9 +99,8 @@ bool DTDParser::parse(const TQString &targetDir, bool entitiesOnly)
if (!s.isEmpty())
errorStr += "<br>" + s;
errorStr += TQString("(%1, %2)").arg(errorPtr->line).arg(errorPtr->int2);
- xmlResetError(errorPtr);
+ xmlResetLastError();
}
-#endif
KMessageBox::error(0, i18n("<qt>Error while parsing the DTD.<br>The error message is:<br><i>%1</i></qt>").arg(errorStr));
return false;
}
@@ -144,7 +143,7 @@ bool DTDParser::parse(const TQString &targetDir, bool entitiesOnly)
TQFile file( DTD::dirName + "entities.tag" );
if ( file.open( IO_WriteOnly ) )
{
- DTD::entityStream.setDevice(TQT_TQIODEVICE(&file));
+ DTD::entityStream.setDevice(&file);
DTD::entityStream.setEncoding(TQTextStream::UnicodeUTF8);
DTD::entityStream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
DTD::entityStream << "<!DOCTYPE TAGS>" << endl