Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions 3rdparty/deepin-pdfium/src/dpdfpage.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later

Expand Down Expand Up @@ -328,18 +328,22 @@ bool DPdfPagePrivate::loadAnnots()

//获取类型
if (PDFACTION_URI == type) {
char uri[256] = {0};
unsigned long lenth = FPDFAction_GetURIPath(m_doc, action, uri, 256);
if (0 != lenth) {
dAnnot->setUrl(uri);
// 先获取所需缓冲区大小
unsigned long length = FPDFAction_GetURIPath(m_doc, action, nullptr, 0);
if (length > 0) {
QByteArray uriBuffer(length, 0);
FPDFAction_GetURIPath(m_doc, action, uriBuffer.data(), length);
dAnnot->setUrl(QString::fromUtf8(uriBuffer.constData()));
}

dAnnot->setLinkType(DPdfLinkAnnot::Uri);
} else if (PDFACTION_REMOTEGOTO == type) {
char filePath[256] = {0};
unsigned long lenth = FPDFAction_GetFilePath(action, filePath, 256);
if (0 != lenth) {
dAnnot->setFilePath(filePath);
// 先获取所需缓冲区大小
unsigned long length = FPDFAction_GetFilePath(action, nullptr, 0);
if (length > 0) {
QByteArray pathBuffer(length, 0);
FPDFAction_GetFilePath(action, pathBuffer.data(), length);
dAnnot->setFilePath(QString::fromUtf8(pathBuffer.constData()));
}

dAnnot->setLinkType(DPdfLinkAnnot::RemoteGoTo);
Expand Down
Loading