[prev in list] [next in list] [prev in thread] [next in thread]
List: freedesktop-poppler
Subject: [poppler] poppler/Outline.cc
From: carlosgc () kemper ! freedesktop ! org (Carlos Garcia Campos)
Date: 2016-09-04 9:12:54
Message-ID: 20160904091254.B8BE57618E () kemper ! freedesktop ! org
[Download RAW message or body]
poppler/Outline.cc | 18 ++----------------
1 file changed, 2 insertions(+), 16 deletions(-)
New commits:
commit 92175cb29450241fafc6d74170f97aee5b7a6d7a
Author: Jason Crain <jason@inspiresomeone.us>
Date: Sun Jul 31 00:53:24 2016 -0500
Fix UTF16 decoding of document outline title
Use TextStringToUCS4 function and don't ignore astral characters.
Bug #97156
diff --git a/poppler/Outline.cc b/poppler/Outline.cc
index bd4e6d0..cc1bc1a 100644
--- a/poppler/Outline.cc
+++ b/poppler/Outline.cc
@@ -35,6 +35,7 @@
#include "Link.h"
#include "PDFDocEncoding.h"
#include "Outline.h"
+#include "UTF.h"
//------------------------------------------------------------------------
@@ -63,7 +64,6 @@ Outline::~Outline() {
OutlineItem::OutlineItem(Dict *dict, XRef *xrefA) {
Object obj1;
GooString *s;
- int i;
xref = xrefA;
title = NULL;
@@ -72,21 +72,7 @@ OutlineItem::OutlineItem(Dict *dict, XRef *xrefA) {
if (dict->lookup("Title", &obj1)->isString()) {
s = obj1.getString();
- if ((s->getChar(0) & 0xff) == 0xfe &&
- (s->getChar(1) & 0xff) == 0xff) {
- titleLen = (s->getLength() - 2) / 2;
- title = (Unicode *)gmallocn(titleLen, sizeof(Unicode));
- for (i = 0; i < titleLen; ++i) {
- title[i] = ((s->getChar(2 + 2*i) & 0xff) << 8) |
- (s->getChar(3 + 2*i) & 0xff);
- }
- } else {
- titleLen = s->getLength();
- title = (Unicode *)gmallocn(titleLen, sizeof(Unicode));
- for (i = 0; i < titleLen; ++i) {
- title[i] = pdfDocEncoding[s->getChar(i) & 0xff];
- }
- }
+ titleLen = TextStringToUCS4(s, &title);
} else {
titleLen = 0;
}
_______________________________________________
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic