diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2023-07-12 15:26:25 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2023-07-14 14:56:24 +0200 |
commit | 07d790ca473cd6e71f0343419b819fa6b485dc01 (patch) | |
tree | cdca4b6e130675323362012a2ef23f37a9a70489 /sw | |
parent | 9a148e4fb402d203ab0d2683dc316aa8217b576c (diff) |
tdf#154982 vcl: PDF Export: split BeginStructureElement
... into 3 parts:
EnsureStructureElement/InitStructureElement/BeginStructureElement
So EnsureStructureElement and BeginStructureElement/EndStructureElement
can be called multiple times for the same object, passing in a unique
key and PDFExtOutDevData will only create the element once.
InitStructureElement will be used exactly once for each object when its
actual content is exported.
In PDFExtOutDevData rely on the indexes being the same here and in
PDFWriterImpl, because then only PDFExtOutDevData needs to maintain the
map from key to index.
Change-Id: Idea6e34627fe559038cf13cf01dafe84b759e3c8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154357
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/text/EnhancedPDFExportHelper.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/text/itrform2.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/docvw/AnnotationWin2.cxx | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 7b5732e925da..e48774f2b2c2 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -459,7 +459,7 @@ void SwTaggedPDFHelper::CheckRestoreTag() const void SwTaggedPDFHelper::BeginTag( vcl::PDFWriter::StructElement eType, const OUString& rString ) { // write new tag - const sal_Int32 nId = mpPDFExtOutDevData->BeginStructureElement( eType, rString ); + const sal_Int32 nId = mpPDFExtOutDevData->WrapBeginStructureElement( eType, rString ); ++m_nEndStructureElement; #if OSL_DEBUG_LEVEL > 1 diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 5895825bf668..2f5abb9a5c6b 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -1094,7 +1094,7 @@ bool SwContentControlPortion::DescribePDFControl(const SwTextPaintInfo& rInf) co aLocation.Union(aEndRect); pDescriptor->Location = aLocation.SVRect(); - pPDFExtOutDevData->BeginStructureElement(vcl::PDFWriter::Form); + pPDFExtOutDevData->WrapBeginStructureElement(vcl::PDFWriter::Form); pPDFExtOutDevData->CreateControl(*pDescriptor); pPDFExtOutDevData->EndStructureElement(); diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx index 047afe5e63d5..885c19877dc1 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -166,7 +166,7 @@ void SwAnnotationWin::DrawForPage(OutputDevice* pDev, const Point& rPt) dynamic_cast<vcl::PDFExtOutDevData*>(pDev->GetExtOutDevData())); if (pPDFExtOutDevData && pPDFExtOutDevData->GetIsExportTaggedPDF()) { - pPDFExtOutDevData->BeginStructureElement(vcl::PDFWriter::NonStructElement, OUString()); + pPDFExtOutDevData->WrapBeginStructureElement(vcl::PDFWriter::NonStructElement, OUString()); } pDev->Push(); |