summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorTibor Nagy <tibor.nagy.extern@allotropia.de>2024-01-19 03:19:41 +0100
committerNagy Tibor <tibor.nagy.extern@allotropia.de>2024-01-19 11:55:12 +0100
commit01e41414847bcc3670df9537bbcba6a98ebd5190 (patch)
tree800dbd4fc1d7fcaae6ff968e70a3211aa4a3909f /drawinglayer
parent18e579761cb622e8ff7e67f319ef80c61b3bd588 (diff)
tdf#159067 drawinglayer: fix untagged form control (PDF/UA export)
If the form object is marked as decorative, the form control should be exported as "Artifact" Change-Id: I615d308ae966bf3d0f156899a0b4fad2d5a7c492 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162268 Tested-by: Jenkins Reviewed-by: Nagy Tibor <tibor.nagy.extern@allotropia.de>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/primitive2d/structuretagprimitive2d.cxx4
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx10
2 files changed, 10 insertions, 4 deletions
diff --git a/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx b/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx
index 47af55ab9b57..783a54a4c409 100644
--- a/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/structuretagprimitive2d.cxx
@@ -30,13 +30,15 @@ namespace drawinglayer::primitive2d
const vcl::PDFWriter::StructElement& rStructureElement,
bool bBackground,
bool bIsImage,
+ bool bIsDecorative,
Primitive2DContainer&& aChildren,
void const*const pAnchorStructureElementKey,
::std::vector<sal_Int32> const*const pAnnotIds)
: GroupPrimitive2D(std::move(aChildren)),
maStructureElement(rStructureElement),
mbBackground(bBackground),
- mbIsImage(bIsImage)
+ mbIsImage(bIsImage),
+ mbIsDecorative(bIsDecorative)
, m_pAnchorStructureElementKey(pAnchorStructureElementKey)
{
if (pAnnotIds)
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 22f464d70b7f..e4441bbda327 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -1116,8 +1116,9 @@ void VclMetafileProcessor2D::processControlPrimitive2D(
const bool bPDFExport(mpPDFExtOutDevData && mpPDFExtOutDevData->GetIsExportFormFields());
bool bDoProcessRecursively(true);
+ bool bDecorative = (mpCurrentStructureTag && mpCurrentStructureTag->isDecorative());
- if (bPDFExport)
+ if (bPDFExport && !bDecorative)
{
// PDF export. Emulate data handling from UnoControlPDFExportContact
std::unique_ptr<vcl::PDFWriter::AnyWidget> pPDFControl(
@@ -1190,7 +1191,10 @@ void VclMetafileProcessor2D::processControlPrimitive2D(
if (mpPDFExtOutDevData)
{ // no corresponding PDF Form, use Figure instead
- mpPDFExtOutDevData->WrapBeginStructureElement(vcl::PDFWriter::Figure);
+ if (!bDecorative)
+ mpPDFExtOutDevData->WrapBeginStructureElement(vcl::PDFWriter::Figure);
+ else
+ mpPDFExtOutDevData->WrapBeginStructureElement(vcl::PDFWriter::NonStructElement);
mpPDFExtOutDevData->SetStructureAttribute(vcl::PDFWriter::Placement, vcl::PDFWriter::Block);
auto const range(rControlPrimitive.getB2DRange(getViewInformation2D()));
tools::Rectangle const aLogicRect(
@@ -1198,7 +1202,7 @@ void VclMetafileProcessor2D::processControlPrimitive2D(
basegfx::fround(range.getMaxX()), basegfx::fround(range.getMaxY()));
mpPDFExtOutDevData->SetStructureBoundingBox(aLogicRect);
OUString const& rAltText(rControlPrimitive.GetAltText());
- if (!rAltText.isEmpty())
+ if (!rAltText.isEmpty() && !bDecorative)
{
mpPDFExtOutDevData->SetAlternateText(rAltText);
}