diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-01-05 21:02:46 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-01-06 08:58:39 +0100 |
commit | 8373d6b1dd1096d3ce1d1f1d3845b6061c365fab (patch) | |
tree | dab35e7eb41f8848503b8aeff497450cc92cc368 /vcl/source | |
parent | 94d34e53ac9eb41cba96a56bf715d4b02794a12a (diff) |
pdfium: add wrapper for FPDF_OBJECT_* defines
So that client code doesn't have to include fpdfview.h manually.
Change-Id: I0cb9569f84e85953a308519ea89bed39fe4a1390
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108817
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/pdf/PDFiumLibrary.cxx | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/vcl/source/pdf/PDFiumLibrary.cxx b/vcl/source/pdf/PDFiumLibrary.cxx index 291e340abc40..a75b2b92d62f 100644 --- a/vcl/source/pdf/PDFiumLibrary.cxx +++ b/vcl/source/pdf/PDFiumLibrary.cxx @@ -62,6 +62,27 @@ static_assert(static_cast<int>(vcl::pdf::PDFBitmapType::BGRx) == FPDFBitmap_BGRx static_assert(static_cast<int>(vcl::pdf::PDFBitmapType::BGRA) == FPDFBitmap_BGRA, "PDFBitmapType::BGRA value mismatch"); +static_assert(static_cast<int>(vcl::pdf::PDFObjectType::Unknown) == FPDF_OBJECT_UNKNOWN, + "PDFObjectType::Unknown value mismatch"); +static_assert(static_cast<int>(vcl::pdf::PDFObjectType::Boolean) == FPDF_OBJECT_BOOLEAN, + "PDFObjectType::Boolean value mismatch"); +static_assert(static_cast<int>(vcl::pdf::PDFObjectType::Number) == FPDF_OBJECT_NUMBER, + "PDFObjectType::Number value mismatch"); +static_assert(static_cast<int>(vcl::pdf::PDFObjectType::String) == FPDF_OBJECT_STRING, + "PDFObjectType::String value mismatch"); +static_assert(static_cast<int>(vcl::pdf::PDFObjectType::Name) == FPDF_OBJECT_NAME, + "PDFObjectType::Name value mismatch"); +static_assert(static_cast<int>(vcl::pdf::PDFObjectType::Array) == FPDF_OBJECT_ARRAY, + "PDFObjectType::Array value mismatch"); +static_assert(static_cast<int>(vcl::pdf::PDFObjectType::Dictionary) == FPDF_OBJECT_DICTIONARY, + "PDFObjectType::Dictionary value mismatch"); +static_assert(static_cast<int>(vcl::pdf::PDFObjectType::Stream) == FPDF_OBJECT_STREAM, + "PDFObjectType::Stream value mismatch"); +static_assert(static_cast<int>(vcl::pdf::PDFObjectType::Nullobj) == FPDF_OBJECT_NULLOBJ, + "PDFObjectType::Nullobj value mismatch"); +static_assert(static_cast<int>(vcl::pdf::PDFObjectType::Reference) == FPDF_OBJECT_REFERENCE, + "PDFObjectType::Reference value mismatch"); + namespace { /// Callback class to be used with FPDF_SaveWithVersion(). @@ -849,9 +870,9 @@ bool PDFiumAnnotation::hasKey(OString const& rKey) return FPDFAnnot_HasKey(mpAnnotation, rKey.getStr()); } -int PDFiumAnnotation::getValueType(OString const& rKey) +PDFObjectType PDFiumAnnotation::getValueType(OString const& rKey) { - return FPDFAnnot_GetValueType(mpAnnotation, rKey.getStr()); + return static_cast<PDFObjectType>(FPDFAnnot_GetValueType(mpAnnotation, rKey.getStr())); } OUString PDFiumAnnotation::getString(OString const& rKey) |