diff options
Diffstat (limited to 'lib/libchmfile/libchmfileimpl.cpp')
-rw-r--r-- | lib/libchmfile/libchmfileimpl.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/libchmfile/libchmfileimpl.cpp b/lib/libchmfile/libchmfileimpl.cpp index c8e8801..63fc376 100644 --- a/lib/libchmfile/libchmfileimpl.cpp +++ b/lib/libchmfile/libchmfileimpl.cpp @@ -27,7 +27,11 @@ #include <tqapplication.h> #include "config.h" +#if USE_BUILTIN_CHMLIB #include "chm_lib.h" +#else +#include <chm_lib.h> +#endif #include "bitfiddle.h" #include "libchmfile.h" #include "libchmurlfactory.h" @@ -527,13 +531,8 @@ bool LCHMFileImpl::ResolveObject(const TQString& fileName, chmUnitInfo *ui) cons size_t LCHMFileImpl::RetrieveObject(const chmUnitInfo *ui, unsigned char *buffer, LONGUINT64 fileOffset, LONGINT64 bufferSize) const { -#if USE_BUILTIN_CHMLIB - return ::chm_retrieve_object(m_chmFile, ui, buffer, - fileOffset, bufferSize); -#else return ::chm_retrieve_object(m_chmFile, const_cast<chmUnitInfo*>(ui), buffer, fileOffset, bufferSize); -#endif } @@ -865,7 +864,7 @@ TQCString LCHMFileImpl::convertSearchWord( const TQString & src ) }; if ( !m_textCodec ) - return (TQCString) src.lower(); + return src.lower().utf8(); TQCString dest = m_textCodec->fromUnicode (src); @@ -997,7 +996,7 @@ bool LCHMFileImpl::parseFileAndFillArray( const TQString & file, QT34VECTOR< LCH else if ( tagword == "/object" && in_object ) { // a topic entry closed. Add a tree item - if ( entry.name ) + if ( !entry.name.isEmpty() ) { if ( !root_indent_offset_set ) { @@ -1033,18 +1032,18 @@ bool LCHMFileImpl::parseFileAndFillArray( const TQString & file, QT34VECTOR< LCH TQString name_pattern = "name=", value_pattern = "value="; TQString pname, pvalue; - if ( (offset = tag.find (name_pattern, 0, FALSE)) == -1 ) + if ( (offset = tag.find (name_pattern, 0, false)) == -1 ) tqFatal ("LCHMFileImpl::ParseAndFillTopicsTree: bad <param> tag '%s': no name=\n", tag.ascii()); // offset+5 skips 'name=' - offset = findStringInQuotes (tag, offset + name_pattern.length(), pname, TRUE, FALSE); + offset = findStringInQuotes (tag, offset + name_pattern.length(), pname, true, false); pname = pname.lower(); - if ( (offset = tag.find (value_pattern, offset, FALSE)) == -1 ) + if ( (offset = tag.find (value_pattern, offset, false)) == -1 ) tqFatal ("LCHMFileImpl::ParseAndFillTopicsTree: bad <param> tag '%s': no value=\n", tag.ascii()); // offset+6 skips 'value=' - findStringInQuotes (tag, offset + value_pattern.length(), pvalue, FALSE, TRUE); + findStringInQuotes (tag, offset + value_pattern.length(), pvalue, false, true); //tqDebug ("<param>: name '%s', value '%s'", pname.ascii(), pvalue.ascii()); |