summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-02-15 21:06:01 +0100
committerMiklos Vajna <vmiklos@collabora.com>2021-02-16 09:04:59 +0100
commit9487e0dff64e234169863f69b677f9616401f459 (patch)
tree7fbd8b060b80f28af2e6448ceb9abd15c52c4502 /include
parent7874cba9709dd0973a81d5894d6daa9570ac86bf (diff)
pdfium: add a FPDF_GetLastError() wrapper
And also an enum class for its return values. Change-Id: I9a001386831b2230a397194df3cf3b331d5242ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110952 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'include')
-rw-r--r--include/vcl/filter/PDFiumLibrary.hxx2
-rw-r--r--include/vcl/pdf/PDFErrorType.hxx28
2 files changed, 30 insertions, 0 deletions
diff --git a/include/vcl/filter/PDFiumLibrary.hxx b/include/vcl/filter/PDFiumLibrary.hxx
index eea1be960291..8a3e05b5b2d2 100644
--- a/include/vcl/filter/PDFiumLibrary.hxx
+++ b/include/vcl/filter/PDFiumLibrary.hxx
@@ -37,6 +37,7 @@
#include <vcl/pdf/PDFTextRenderMode.hxx>
#include <vcl/pdf/PDFFillMode.hxx>
#include <vcl/pdf/PDFFindFlags.hxx>
+#include <vcl/pdf/PDFErrorType.hxx>
#include <fpdf_doc.h>
@@ -69,6 +70,7 @@ public:
const OUString& getLastError() const { return maLastError; }
std::unique_ptr<PDFiumDocument> openDocument(const void* pData, int nSize);
+ static PDFErrorType getLastErrorCode();
std::unique_ptr<PDFiumBitmap> createBitmap(int nWidth, int nHeight, int nAlpha);
};
diff --git a/include/vcl/pdf/PDFErrorType.hxx b/include/vcl/pdf/PDFErrorType.hxx
new file mode 100644
index 000000000000..82cee9e5e744
--- /dev/null
+++ b/include/vcl/pdf/PDFErrorType.hxx
@@ -0,0 +1,28 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#pragma once
+
+namespace vcl::pdf
+{
+enum class PDFErrorType
+{
+ Success = 0,
+ Unknown = 1,
+ File = 2,
+ Format = 3,
+ Password = 4,
+ Security = 5,
+ Page = 6,
+};
+
+} // namespace vcl::pdf
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */