summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdftext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdftext.cpp')
-rw-r--r--fpdfsdk/fpdftext.cpp130
1 files changed, 63 insertions, 67 deletions
diff --git a/fpdfsdk/fpdftext.cpp b/fpdfsdk/fpdftext.cpp
index 70acf54ec7..916233c56e 100644
--- a/fpdfsdk/fpdftext.cpp
+++ b/fpdfsdk/fpdftext.cpp
@@ -43,7 +43,7 @@ CPDF_LinkExtract* CPDFLinkExtractFromFPDFPageLink(FPDF_PAGELINK link) {
} // namespace
-FPDF_EXPORT FPDF_TEXTPAGE FPDF_CALLCONV FPDFText_LoadPage(FPDF_PAGE page) {
+DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page) {
CPDF_Page* pPDFPage = CPDFPageFromFPDFPage(page);
if (!pPDFPage)
return nullptr;
@@ -63,11 +63,11 @@ FPDF_EXPORT FPDF_TEXTPAGE FPDF_CALLCONV FPDFText_LoadPage(FPDF_PAGE page) {
return textpage;
}
-FPDF_EXPORT void FPDF_CALLCONV FPDFText_ClosePage(FPDF_TEXTPAGE text_page) {
+DLLEXPORT void STDCALL FPDFText_ClosePage(FPDF_TEXTPAGE text_page) {
delete CPDFTextPageFromFPDFTextPage(text_page);
}
-FPDF_EXPORT int FPDF_CALLCONV FPDFText_CountChars(FPDF_TEXTPAGE text_page) {
+DLLEXPORT int STDCALL FPDFText_CountChars(FPDF_TEXTPAGE text_page) {
if (!text_page)
return -1;
@@ -75,8 +75,8 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFText_CountChars(FPDF_TEXTPAGE text_page) {
return textpage->CountChars();
}
-FPDF_EXPORT unsigned int FPDF_CALLCONV
-FPDFText_GetUnicode(FPDF_TEXTPAGE text_page, int index) {
+DLLEXPORT unsigned int STDCALL FPDFText_GetUnicode(FPDF_TEXTPAGE text_page,
+ int index) {
if (!text_page)
return 0;
@@ -89,8 +89,8 @@ FPDFText_GetUnicode(FPDF_TEXTPAGE text_page, int index) {
return charinfo.m_Unicode;
}
-FPDF_EXPORT double FPDF_CALLCONV FPDFText_GetFontSize(FPDF_TEXTPAGE text_page,
- int index) {
+DLLEXPORT double STDCALL FPDFText_GetFontSize(FPDF_TEXTPAGE text_page,
+ int index) {
if (!text_page)
return 0;
CPDF_TextPage* textpage = CPDFTextPageFromFPDFTextPage(text_page);
@@ -103,12 +103,12 @@ FPDF_EXPORT double FPDF_CALLCONV FPDFText_GetFontSize(FPDF_TEXTPAGE text_page,
return charinfo.m_FontSize;
}
-FPDF_EXPORT void FPDF_CALLCONV FPDFText_GetCharBox(FPDF_TEXTPAGE text_page,
- int index,
- double* left,
- double* right,
- double* bottom,
- double* top) {
+DLLEXPORT void STDCALL FPDFText_GetCharBox(FPDF_TEXTPAGE text_page,
+ int index,
+ double* left,
+ double* right,
+ double* bottom,
+ double* top) {
if (!text_page)
return;
CPDF_TextPage* textpage = CPDFTextPageFromFPDFTextPage(text_page);
@@ -124,12 +124,11 @@ FPDF_EXPORT void FPDF_CALLCONV FPDFText_GetCharBox(FPDF_TEXTPAGE text_page,
}
// select
-FPDF_EXPORT int FPDF_CALLCONV
-FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page,
- double x,
- double y,
- double xTolerance,
- double yTolerance) {
+DLLEXPORT int STDCALL FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page,
+ double x,
+ double y,
+ double xTolerance,
+ double yTolerance) {
if (!text_page)
return -3;
@@ -140,10 +139,10 @@ FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page,
static_cast<float>(yTolerance)));
}
-FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetText(FPDF_TEXTPAGE text_page,
- int start,
- int count,
- unsigned short* result) {
+DLLEXPORT int STDCALL FPDFText_GetText(FPDF_TEXTPAGE text_page,
+ int start,
+ int count,
+ unsigned short* result) {
if (!text_page)
return 0;
@@ -163,9 +162,9 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetText(FPDF_TEXTPAGE text_page,
return cbUTF16str.GetLength() / sizeof(unsigned short);
}
-FPDF_EXPORT int FPDF_CALLCONV FPDFText_CountRects(FPDF_TEXTPAGE text_page,
- int start,
- int count) {
+DLLEXPORT int STDCALL FPDFText_CountRects(FPDF_TEXTPAGE text_page,
+ int start,
+ int count) {
if (!text_page)
return 0;
@@ -173,12 +172,12 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFText_CountRects(FPDF_TEXTPAGE text_page,
return textpage->CountRects(start, count);
}
-FPDF_EXPORT void FPDF_CALLCONV FPDFText_GetRect(FPDF_TEXTPAGE text_page,
- int rect_index,
- double* left,
- double* top,
- double* right,
- double* bottom) {
+DLLEXPORT void STDCALL FPDFText_GetRect(FPDF_TEXTPAGE text_page,
+ int rect_index,
+ double* left,
+ double* top,
+ double* right,
+ double* bottom) {
if (!text_page)
return;
@@ -191,13 +190,13 @@ FPDF_EXPORT void FPDF_CALLCONV FPDFText_GetRect(FPDF_TEXTPAGE text_page,
*bottom = rect.bottom;
}
-FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page,
- double left,
- double top,
- double right,
- double bottom,
- unsigned short* buffer,
- int buflen) {
+DLLEXPORT int STDCALL FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page,
+ double left,
+ double top,
+ double right,
+ double bottom,
+ unsigned short* buffer,
+ int buflen) {
if (!text_page)
return 0;
@@ -220,11 +219,10 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page,
// Search
// -1 for end
-FPDF_EXPORT FPDF_SCHHANDLE FPDF_CALLCONV
-FPDFText_FindStart(FPDF_TEXTPAGE text_page,
- FPDF_WIDESTRING findwhat,
- unsigned long flags,
- int start_index) {
+DLLEXPORT FPDF_SCHHANDLE STDCALL FPDFText_FindStart(FPDF_TEXTPAGE text_page,
+ FPDF_WIDESTRING findwhat,
+ unsigned long flags,
+ int start_index) {
if (!text_page)
return nullptr;
@@ -236,7 +234,7 @@ FPDFText_FindStart(FPDF_TEXTPAGE text_page,
return textpageFind;
}
-FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_FindNext(FPDF_SCHHANDLE handle) {
+DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindNext(FPDF_SCHHANDLE handle) {
if (!handle)
return false;
@@ -244,7 +242,7 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_FindNext(FPDF_SCHHANDLE handle) {
return textpageFind->FindNext();
}
-FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_FindPrev(FPDF_SCHHANDLE handle) {
+DLLEXPORT FPDF_BOOL STDCALL FPDFText_FindPrev(FPDF_SCHHANDLE handle) {
if (!handle)
return false;
@@ -252,8 +250,7 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFText_FindPrev(FPDF_SCHHANDLE handle) {
return textpageFind->FindPrev();
}
-FPDF_EXPORT int FPDF_CALLCONV
-FPDFText_GetSchResultIndex(FPDF_SCHHANDLE handle) {
+DLLEXPORT int STDCALL FPDFText_GetSchResultIndex(FPDF_SCHHANDLE handle) {
if (!handle)
return 0;
@@ -261,7 +258,7 @@ FPDFText_GetSchResultIndex(FPDF_SCHHANDLE handle) {
return textpageFind->GetCurOrder();
}
-FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetSchCount(FPDF_SCHHANDLE handle) {
+DLLEXPORT int STDCALL FPDFText_GetSchCount(FPDF_SCHHANDLE handle) {
if (!handle)
return 0;
@@ -269,7 +266,7 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFText_GetSchCount(FPDF_SCHHANDLE handle) {
return textpageFind->GetMatchedCount();
}
-FPDF_EXPORT void FPDF_CALLCONV FPDFText_FindClose(FPDF_SCHHANDLE handle) {
+DLLEXPORT void STDCALL FPDFText_FindClose(FPDF_SCHHANDLE handle) {
if (!handle)
return;
@@ -279,8 +276,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDFText_FindClose(FPDF_SCHHANDLE handle) {
}
// web link
-FPDF_EXPORT FPDF_PAGELINK FPDF_CALLCONV
-FPDFLink_LoadWebLinks(FPDF_TEXTPAGE text_page) {
+DLLEXPORT FPDF_PAGELINK STDCALL FPDFLink_LoadWebLinks(FPDF_TEXTPAGE text_page) {
if (!text_page)
return nullptr;
@@ -290,7 +286,7 @@ FPDFLink_LoadWebLinks(FPDF_TEXTPAGE text_page) {
return pageLink;
}
-FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountWebLinks(FPDF_PAGELINK link_page) {
+DLLEXPORT int STDCALL FPDFLink_CountWebLinks(FPDF_PAGELINK link_page) {
if (!link_page)
return 0;
@@ -298,10 +294,10 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountWebLinks(FPDF_PAGELINK link_page) {
return pdfium::base::checked_cast<int>(pageLink->CountLinks());
}
-FPDF_EXPORT int FPDF_CALLCONV FPDFLink_GetURL(FPDF_PAGELINK link_page,
- int link_index,
- unsigned short* buffer,
- int buflen) {
+DLLEXPORT int STDCALL FPDFLink_GetURL(FPDF_PAGELINK link_page,
+ int link_index,
+ unsigned short* buffer,
+ int buflen) {
CFX_WideString wsUrl(L"");
if (link_page && link_index >= 0) {
CPDF_LinkExtract* pageLink = CPDFLinkExtractFromFPDFPageLink(link_page);
@@ -320,8 +316,8 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFLink_GetURL(FPDF_PAGELINK link_page,
return size;
}
-FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountRects(FPDF_PAGELINK link_page,
- int link_index) {
+DLLEXPORT int STDCALL FPDFLink_CountRects(FPDF_PAGELINK link_page,
+ int link_index) {
if (!link_page || link_index < 0)
return 0;
@@ -329,13 +325,13 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFLink_CountRects(FPDF_PAGELINK link_page,
return pdfium::CollectionSize<int>(pageLink->GetRects(link_index));
}
-FPDF_EXPORT void FPDF_CALLCONV FPDFLink_GetRect(FPDF_PAGELINK link_page,
- int link_index,
- int rect_index,
- double* left,
- double* top,
- double* right,
- double* bottom) {
+DLLEXPORT void STDCALL FPDFLink_GetRect(FPDF_PAGELINK link_page,
+ int link_index,
+ int rect_index,
+ double* left,
+ double* top,
+ double* right,
+ double* bottom) {
if (!link_page || link_index < 0 || rect_index < 0)
return;
@@ -350,6 +346,6 @@ FPDF_EXPORT void FPDF_CALLCONV FPDFLink_GetRect(FPDF_PAGELINK link_page,
*bottom = rectArray[rect_index].bottom;
}
-FPDF_EXPORT void FPDF_CALLCONV FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page) {
+DLLEXPORT void STDCALL FPDFLink_CloseWebLinks(FPDF_PAGELINK link_page) {
delete CPDFLinkExtractFromFPDFPageLink(link_page);
}