summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdf_structtree.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/fpdfsdk/fpdf_structtree.cpp b/fpdfsdk/fpdf_structtree.cpp
index 8a93d2299d..96d40b41c2 100644
--- a/fpdfsdk/fpdf_structtree.cpp
+++ b/fpdfsdk/fpdf_structtree.cpp
@@ -8,17 +8,18 @@
#include "core/fpdfapi/page/cpdf_page.h"
#include "core/fpdfapi/parser/cpdf_dictionary.h"
-#include "core/fpdfdoc/fpdf_tagged.h"
+#include "core/fpdfdoc/cpdf_structelement.h"
+#include "core/fpdfdoc/cpdf_structtree.h"
#include "fpdfsdk/fsdk_define.h"
namespace {
-IPDF_StructTree* ToStructTree(FPDF_STRUCTTREE struct_tree) {
- return reinterpret_cast<IPDF_StructTree*>(struct_tree);
+CPDF_StructTree* ToStructTree(FPDF_STRUCTTREE struct_tree) {
+ return reinterpret_cast<CPDF_StructTree*>(struct_tree);
}
-IPDF_StructElement* ToStructTreeElement(FPDF_STRUCTELEMENT struct_element) {
- return reinterpret_cast<IPDF_StructElement*>(struct_element);
+CPDF_StructElement* ToStructTreeElement(FPDF_STRUCTELEMENT struct_element) {
+ return reinterpret_cast<CPDF_StructElement*>(struct_element);
}
unsigned long WideStringToBuffer(const CFX_WideString& str,
@@ -40,23 +41,23 @@ DLLEXPORT FPDF_STRUCTTREE STDCALL FPDF_StructTree_GetForPage(FPDF_PAGE page) {
CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
if (!pPage)
return nullptr;
- return IPDF_StructTree::LoadPage(pPage->m_pDocument, pPage->m_pFormDict)
+ return CPDF_StructTree::LoadPage(pPage->m_pDocument, pPage->m_pFormDict)
.release();
}
DLLEXPORT void STDCALL FPDF_StructTree_Close(FPDF_STRUCTTREE struct_tree) {
- std::unique_ptr<IPDF_StructTree>(ToStructTree(struct_tree));
+ std::unique_ptr<CPDF_StructTree>(ToStructTree(struct_tree));
}
DLLEXPORT int STDCALL
FPDF_StructTree_CountChildren(FPDF_STRUCTTREE struct_tree) {
- IPDF_StructTree* tree = ToStructTree(struct_tree);
+ CPDF_StructTree* tree = ToStructTree(struct_tree);
return tree ? tree->CountTopElements() : -1;
}
DLLEXPORT FPDF_STRUCTELEMENT STDCALL
FPDF_StructTree_GetChildAtIndex(FPDF_STRUCTTREE struct_tree, int index) {
- IPDF_StructTree* tree = ToStructTree(struct_tree);
+ CPDF_StructTree* tree = ToStructTree(struct_tree);
if (!tree || index < 0 || index >= tree->CountTopElements())
return nullptr;
return tree->GetTopElement(index);
@@ -66,7 +67,7 @@ DLLEXPORT unsigned long STDCALL
FPDF_StructElement_GetAltText(FPDF_STRUCTELEMENT struct_element,
void* buffer,
unsigned long buflen) {
- IPDF_StructElement* elem = ToStructTreeElement(struct_element);
+ CPDF_StructElement* elem = ToStructTreeElement(struct_element);
return (elem && elem->GetDict())
? WideStringToBuffer(elem->GetDict()->GetUnicodeTextFor("Alt"),
buffer, buflen)
@@ -77,21 +78,21 @@ DLLEXPORT unsigned long STDCALL
FPDF_StructElement_GetType(FPDF_STRUCTELEMENT struct_element,
void* buffer,
unsigned long buflen) {
- IPDF_StructElement* elem = ToStructTreeElement(struct_element);
+ CPDF_StructElement* elem = ToStructTreeElement(struct_element);
return elem ? WideStringToBuffer(elem->GetType().UTF8Decode(), buffer, buflen)
: 0;
}
DLLEXPORT int STDCALL
FPDF_StructElement_CountChildren(FPDF_STRUCTELEMENT struct_element) {
- IPDF_StructElement* elem = ToStructTreeElement(struct_element);
+ CPDF_StructElement* elem = ToStructTreeElement(struct_element);
return elem ? elem->CountKids() : -1;
}
DLLEXPORT FPDF_STRUCTELEMENT STDCALL
FPDF_StructElement_GetChildAtIndex(FPDF_STRUCTELEMENT struct_element,
int index) {
- IPDF_StructElement* elem = ToStructTreeElement(struct_element);
+ CPDF_StructElement* elem = ToStructTreeElement(struct_element);
if (!elem || index < 0 || index >= elem->CountKids())
return nullptr;