[poppler] qt4/src
Albert Astals Cid
aacid at kemper.freedesktop.org
Thu Dec 20 11:13:20 PST 2007
qt4/src/poppler-document.cc | 28 +---------------------------
1 file changed, 1 insertion(+), 27 deletions(-)
New commits:
commit c06d6f2236d854f05e7621be280109ff27dc73b9
Author: Albert Astals Cid <tsdgeos at bluebox.localdomain>
Date: Thu Dec 20 20:13:08 2007 +0100
Use UnicodeParsedString that does exactly what this code does
diff --git a/qt4/src/poppler-document.cc b/qt4/src/poppler-document.cc
index ef11fdd..04a1d81 100644
--- a/qt4/src/poppler-document.cc
+++ b/qt4/src/poppler-document.cc
@@ -228,38 +228,12 @@ namespace Poppler {
QString result;
Object obj;
GooString *s1;
- GBool isUnicode;
- Unicode u;
- int i;
Dict *infoDict = info.getDict();
if ( infoDict->lookup( type.toLatin1().data(), &obj )->isString() )
{
s1 = obj.getString();
- if ( ( s1->getChar(0) & 0xff ) == 0xfe && ( s1->getChar(1) & 0xff ) == 0xff )
- {
- isUnicode = gTrue;
- i = 2;
- }
- else
- {
- isUnicode = gFalse;
- i = 0;
- }
- while ( i < obj.getString()->getLength() )
- {
- if ( isUnicode )
- {
- u = ( ( s1->getChar(i) & 0xff ) << 8 ) | ( s1->getChar(i+1) & 0xff );
- i += 2;
- }
- else
- {
- u = s1->getChar(i) & 0xff;
- ++i;
- }
- result += unicodeToQString( &u, 1 );
- }
+ result = UnicodeParsedString(s1);
obj.free();
info.free();
return result;
More information about the poppler
mailing list