--- kdelibs-3.5.6.org/khtml/rendering/break_lines.cpp 2005-09-10 15:27:15.000000000 +0700 +++ kdelibs-3.5.6/khtml/rendering/break_lines.cpp 2007-09-28 00:21:20.000000000 +0700 @@ -3,6 +3,7 @@ #include "qcstring.h" #include #include +#include #include @@ -31,19 +32,19 @@ numwbrpos = 0; numisbreakable = 0x400; isbreakable = (int *) malloc(numisbreakable*sizeof(int)); - library = 0; + //library = 0; } ~ThaiCache() { free(wbrpos); free(isbreakable); - if (library) library->unload(); + //if (library) library->unload(); } const QChar *string; int *wbrpos; int *isbreakable; int allocated; int numwbrpos,numisbreakable; - KLibrary *library; + //KLibrary *library; }; static ThaiCache *cache = 0; @@ -63,9 +64,12 @@ #ifndef HAVE_LIBTHAI +/* KLibrary *lib = 0; +*/ /* load libthai dynamically */ +/* if (( !th_brk ) && thaiCodec ) { printf("Try to load libthai dynamically...\n"); KLibLoader *loader = KLibLoader::self(); @@ -80,6 +84,19 @@ lib->unload(); } } +*/ + + // KLibLoader requires libthai.la which is usually in libthai-dev package or doesn't exist at all + // QLibrary::resolve will look for libthai.so.0 directly + /* load libthai dynamically */ + if (!th_brk && thaiCodec) { + printf("Try to load libthai dynamically...\n"); + th_brk = (th_brk_def)QLibrary::resolve("thai", "th_brk"); + if (!th_brk) { + printf("Error, can't load libthai...\n"); + thaiCodec = 0; + } + } if (!th_brk ) { return true; @@ -89,7 +106,7 @@ if (!cache ) { cache = new ThaiCache; #ifndef HAVE_LIBTHAI - cache->library = lib; + //cache->library = lib; #endif }