summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdfview.cpp')
-rw-r--r--fpdfsdk/fpdfview.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp
index 06e72b3a71..7dbaf7f9e7 100644
--- a/fpdfsdk/fpdfview.cpp
+++ b/fpdfsdk/fpdfview.cpp
@@ -1322,7 +1322,7 @@ DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDestByName(FPDF_DOCUMENT document,
return nullptr;
CPDF_NameTree name_tree(pDoc, "Dests");
- return name_tree.LookupNamedDest(pDoc, name);
+ return name_tree.LookupNamedDest(pDoc, PDF_DecodeText(CFX_ByteString(name)));
}
#ifdef PDF_ENABLE_XFA
@@ -1398,6 +1398,7 @@ DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDest(FPDF_DOCUMENT document,
CPDF_Object* pDestObj = nullptr;
CFX_ByteString bsName;
+ CFX_WideString wsName;
CPDF_NameTree nameTree(pDoc, "Dests");
int count = nameTree.GetCount();
if (index >= count) {
@@ -1421,8 +1422,9 @@ DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDest(FPDF_DOCUMENT document,
break;
i++;
}
+ wsName = PDF_DecodeText(bsName);
} else {
- pDestObj = nameTree.LookupValueAndName(index, &bsName);
+ pDestObj = nameTree.LookupValueAndName(index, &wsName);
}
if (!pDestObj)
return nullptr;
@@ -1434,7 +1436,6 @@ DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDest(FPDF_DOCUMENT document,
if (!pDestObj->IsArray())
return nullptr;
- CFX_WideString wsName = PDF_DecodeText(bsName);
CFX_ByteString utf16Name = wsName.UTF16LE_Encode();
int len = utf16Name.GetLength();
if (!buffer) {