diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2020-10-15 14:11:54 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-10-18 21:22:46 +0200 |
commit | aa301119c98bc5103d3738263b1df90b30013e32 (patch) | |
tree | b108e03ef1bff7d33dd1dccfea1036f9b4227919 /external/pdfium | |
parent | 2a1b5af875d8ee84fec18c781020d836c4650dc9 (diff) |
pdfium: add reading of line points to the wrapper
Change-Id: I3e596254b2e4ecc9f56ff09eeb63b66195ea6a2e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104376
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'external/pdfium')
-rw-r--r-- | external/pdfium/AnnotationLineStartAndEnd.patch.1 | 48 | ||||
-rw-r--r-- | external/pdfium/UnpackedTarball_pdfium.mk | 1 |
2 files changed, 49 insertions, 0 deletions
diff --git a/external/pdfium/AnnotationLineStartAndEnd.patch.1 b/external/pdfium/AnnotationLineStartAndEnd.patch.1 new file mode 100644 index 000000000000..00ebb6d20ed1 --- /dev/null +++ b/external/pdfium/AnnotationLineStartAndEnd.patch.1 @@ -0,0 +1,48 @@ +diff --git a/fpdfsdk/fpdf_annot.cpp b/fpdfsdk/fpdf_annot.cpp +index 229651d82..b43f378bc 100644 +--- a/fpdfsdk/fpdf_annot.cpp ++++ b/fpdfsdk/fpdf_annot.cpp +@@ -552,6 +552,25 @@ FPDFAnnot_GetInkStrokePoints(FPDF_ANNOTATION annot, int index, + return true; + } + ++FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_GetLine(FPDF_ANNOTATION annot, ++ FS_POINTF* start, ++ FS_POINTF* end) { ++ CPDF_Dictionary* pAnnotDict = GetAnnotDictFromFPDFAnnotation(annot); ++ if (!pAnnotDict || !start || !end) ++ return false; ++ ++ CPDF_Array* pLineArray = pAnnotDict->GetArrayFor("L"); ++ if (!pLineArray || pLineArray->size() < 4) ++ return false; ++ ++ start->x = pLineArray->GetNumberAt(0); ++ start->y = pLineArray->GetNumberAt(1); ++ end->x = pLineArray->GetNumberAt(2); ++ end->y = pLineArray->GetNumberAt(3); ++ ++ return true; ++} ++ + FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV + FPDFAnnot_AppendObject(FPDF_ANNOTATION annot, FPDF_PAGEOBJECT obj) { + CPDF_AnnotContext* pAnnot = CPDFAnnotContextFromFPDFAnnotation(annot); +diff --git a/public/fpdf_annot.h b/public/fpdf_annot.h +index ce033cde3..c4b0f71b3 100644 +--- a/public/fpdf_annot.h ++++ b/public/fpdf_annot.h +@@ -232,6 +232,10 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV + FPDFAnnot_GetInkStrokePoints(FPDF_ANNOTATION annot, int index, + FS_POINTF* points); + ++FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV ++FPDFAnnot_GetLine(FPDF_ANNOTATION annot, FS_POINTF* start, ++ FS_POINTF* end); ++ + // Experimental API. + // Add |obj| to |annot|. |obj| must have been created by + // FPDFPageObj_CreateNew{Path|Rect}() or FPDFPageObj_New{Text|Image}Obj(), and +-- +2.26.2 + diff --git a/external/pdfium/UnpackedTarball_pdfium.mk b/external/pdfium/UnpackedTarball_pdfium.mk index 5eccb92001eb..152178c2b1ca 100644 --- a/external/pdfium/UnpackedTarball_pdfium.mk +++ b/external/pdfium/UnpackedTarball_pdfium.mk @@ -16,6 +16,7 @@ pdfium_patches += windows7.patch.1 pdfium_patches += c++20-comparison.patch pdfium_patches += AnnotationInkAndVertices.patch.1 pdfium_patches += AnnotationBorderProperties.patch.1 +pdfium_patches += AnnotationLineStartAndEnd.patch.1 # Work around <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94141> "c++20 rewritten operator== # recursive call mixing friend and external operators for template class" in GCC with |