diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2022-09-13 15:23:31 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-09-13 18:43:09 +0200 |
commit | 9bad5be0ffdcdee92d40162b598ed2ab2815e5d5 (patch) | |
tree | 1094ed1ba8e503d6d24d5493715205d1ee9f1039 /include/vcl | |
parent | 849601bdec341eaee3cafc46fbe3cf223f06fb7d (diff) |
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 <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'include/vcl')
-rw-r--r-- | include/vcl/filter/PDFiumLibrary.hxx | 2 | ||||
-rw-r--r-- | include/vcl/pdf/PDFFormFieldType.hxx | 29 | ||||
-rw-r--r-- | include/vcl/pdfwriter.hxx | 2 |
3 files changed, 32 insertions, 1 deletions
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 <vcl/pdf/PDFFillMode.hxx> #include <vcl/pdf/PDFFindFlags.hxx> #include <vcl/pdf/PDFErrorType.hxx> +#include <vcl/pdf/PDFFormFieldType.hxx> class SvMemoryStream; @@ -100,6 +101,7 @@ public: virtual size_t getAttachmentPointsCount() = 0; virtual std::vector<basegfx::B2DPoint> getAttachmentPoints(size_t nIndex) = 0; virtual std::vector<basegfx::B2DPoint> 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 |