From 9bad5be0ffdcdee92d40162b598ed2ab2815e5d5 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 13 Sep 2022 15:23:31 +0200 Subject: sw content controls, checkbox: add PDF export Map this to vcl::PDFWriter::CheckBoxWidget, which uses the /FT/Btn widget, i.e. a (toggle) button which is not a pushbutton or a radiobutton). Also avoid a border for content controls: it just cuts out some part of the rich text/plain text content control filled in text + causes a double border for checkboxes, so not useful. Change-Id: If8dd63fe71d7c2ba9bea4bf2ecc6621fefb74fd6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139864 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- include/vcl/filter/PDFiumLibrary.hxx | 2 ++ include/vcl/pdf/PDFFormFieldType.hxx | 29 +++++++++++++++++++++++++++++ include/vcl/pdfwriter.hxx | 2 +- 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 include/vcl/pdf/PDFFormFieldType.hxx (limited to 'include/vcl') diff --git a/include/vcl/filter/PDFiumLibrary.hxx b/include/vcl/filter/PDFiumLibrary.hxx index 3a4d0d83faf6..8274ded92e1f 100644 --- a/include/vcl/filter/PDFiumLibrary.hxx +++ b/include/vcl/filter/PDFiumLibrary.hxx @@ -33,6 +33,7 @@ #include #include #include +#include class SvMemoryStream; @@ -100,6 +101,7 @@ public: virtual size_t getAttachmentPointsCount() = 0; virtual std::vector getAttachmentPoints(size_t nIndex) = 0; virtual std::vector getLineGeometry() = 0; + virtual PDFFormFieldType getFormFieldType(PDFiumDocument* pDoc) = 0; }; class PDFiumTextPage; diff --git a/include/vcl/pdf/PDFFormFieldType.hxx b/include/vcl/pdf/PDFFormFieldType.hxx new file mode 100644 index 000000000000..96be9bffc188 --- /dev/null +++ b/include/vcl/pdf/PDFFormFieldType.hxx @@ -0,0 +1,29 @@ +/* -*- 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 PDFFormFieldType +{ + Unknown = 0, + PushButton = 1, + CheckBox = 2, + RadioButton = 3, + ComboBox = 4, + ListBox = 5, + TextField = 6, + Signature = 7 +}; + +} // namespace vcl::pdf + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx index cb008fcec280..8860675de688 100644 --- a/include/vcl/pdfwriter.hxx +++ b/include/vcl/pdfwriter.hxx @@ -334,7 +334,7 @@ public: } }; - struct CheckBoxWidget final : public AnyWidget + struct VCL_DLLPUBLIC CheckBoxWidget final : public AnyWidget { bool Checked; OUString OnValue; // the value of the checkbox if it is selected -- cgit