diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-10-15 14:51:42 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-10-15 14:51:42 -0700 |
commit | 86adb658843658969041a13bf6cf0cc950ffe8ed (patch) | |
tree | 374cd2cb1fa62dd95301d7a777c6e03bfbf8d780 /fpdfsdk/src/fpdfdoc.cpp | |
parent | bb51c4fb6bc6095984c303c95e5336f83e66bc67 (diff) | |
download | pdfium-86adb658843658969041a13bf6cf0cc950ffe8ed.tar.xz |
Fix layering violation in CPDF_Document::FromFPDFDocument().
Make this a function in the fpdfsdk/ layer, rather than a method
in the core/ layer. Nothing in core should know about public FPDF
types.
BUG=pdfium:217
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1396283006 .
Diffstat (limited to 'fpdfsdk/src/fpdfdoc.cpp')
-rw-r--r-- | fpdfsdk/src/fpdfdoc.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/fpdfsdk/src/fpdfdoc.cpp b/fpdfsdk/src/fpdfdoc.cpp index ffdad281c6..05b151e0a7 100644 --- a/fpdfsdk/src/fpdfdoc.cpp +++ b/fpdfsdk/src/fpdfdoc.cpp @@ -52,7 +52,7 @@ CPDF_LinkList* GetLinkList(CPDF_Page* page) { DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_GetFirstChild(FPDF_DOCUMENT document, FPDF_BOOKMARK pDict) { - CPDF_Document* pDoc = CPDF_Document::FromFPDFDocument(document); + CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc) return nullptr; CPDF_BookmarkTree tree(pDoc); @@ -64,7 +64,7 @@ DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_GetNextSibling(FPDF_DOCUMENT document, FPDF_BOOKMARK pDict) { if (!pDict) return nullptr; - CPDF_Document* pDoc = CPDF_Document::FromFPDFDocument(document); + CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc) return nullptr; CPDF_BookmarkTree tree(pDoc); @@ -91,7 +91,7 @@ DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_Find(FPDF_DOCUMENT document, FPDF_WIDESTRING title) { if (!title || title[0] == 0) return nullptr; - CPDF_Document* pDoc = CPDF_Document::FromFPDFDocument(document); + CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc) return nullptr; CPDF_BookmarkTree tree(pDoc); @@ -104,7 +104,7 @@ DLLEXPORT FPDF_DEST STDCALL FPDFBookmark_GetDest(FPDF_DOCUMENT document, FPDF_BOOKMARK pDict) { if (!pDict) return nullptr; - CPDF_Document* pDoc = CPDF_Document::FromFPDFDocument(document); + CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc) return nullptr; CPDF_Bookmark bookmark((CPDF_Dictionary*)pDict); @@ -150,7 +150,7 @@ DLLEXPORT FPDF_DEST STDCALL FPDFAction_GetDest(FPDF_DOCUMENT document, FPDF_ACTION pDict) { if (!pDict) return nullptr; - CPDF_Document* pDoc = CPDF_Document::FromFPDFDocument(document); + CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc) return nullptr; CPDF_Action action((CPDF_Dictionary*)pDict); @@ -177,7 +177,7 @@ DLLEXPORT unsigned long STDCALL FPDFAction_GetURIPath(FPDF_DOCUMENT document, unsigned long buflen) { if (!pDict) return 0; - CPDF_Document* pDoc = CPDF_Document::FromFPDFDocument(document); + CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc) return 0; CPDF_Action action((CPDF_Dictionary*)pDict); @@ -192,7 +192,7 @@ DLLEXPORT unsigned long STDCALL FPDFDest_GetPageIndex(FPDF_DOCUMENT document, FPDF_DEST pDict) { if (!pDict) return 0; - CPDF_Document* pDoc = CPDF_Document::FromFPDFDocument(document); + CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc) return 0; CPDF_Dest dest((CPDF_Array*)pDict); @@ -226,7 +226,7 @@ DLLEXPORT FPDF_DEST STDCALL FPDFLink_GetDest(FPDF_DOCUMENT document, FPDF_LINK pDict) { if (!pDict) return nullptr; - CPDF_Document* pDoc = CPDF_Document::FromFPDFDocument(document); + CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document); if (!pDoc) return nullptr; CPDF_Link link((CPDF_Dictionary*)pDict); @@ -325,7 +325,7 @@ DLLEXPORT unsigned long STDCALL FPDF_GetMetaText(FPDF_DOCUMENT doc, unsigned long buflen) { if (!tag) return 0; - CPDF_Document* pDoc = CPDF_Document::FromFPDFDocument(doc); + CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(doc); if (!pDoc) return 0; CPDF_Dictionary* pInfo = pDoc->GetInfo(); |