summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2022-11-30 13:59:53 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2022-12-01 17:01:20 +0100
commit56ff8262d8ace8fd99326e290597cb901654ea11 (patch)
tree75eaa8bfe45414fdaabe2164aaaa2c014c71c2d2 /svx/source
parent336602a15d481c4502e66778aec8d37727922152 (diff)
tdf#135192 svx: PDF/UA export: implement tags for SdrTableObj
There seems to be no way to check for isExportTaggedPDF() in ViewContactOfTableObj::createViewIndependentPrimitive2DSequence() so simply always add the tags. Change-Id: I816ed1f3811c4efad6ca28366591d135bf823c5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143499 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/sdr/contact/viewobjectcontact.cxx2
-rw-r--r--svx/source/table/viewcontactoftableobj.cxx30
2 files changed, 30 insertions, 2 deletions
diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx b/svx/source/sdr/contact/viewobjectcontact.cxx
index 8580603850ea..9d88819a9fe2 100644
--- a/svx/source/sdr/contact/viewobjectcontact.cxx
+++ b/svx/source/sdr/contact/viewobjectcontact.cxx
@@ -400,6 +400,8 @@ drawinglayer::primitive2d::Primitive2DContainer const & ViewObjectContact::getPr
{
if ( nIdentifier == SdrObjKind::Group )
eElement = vcl::PDFWriter::Section;
+ else if (nIdentifier == SdrObjKind::Table)
+ eElement = vcl::PDFWriter::Table;
else if ( nIdentifier == SdrObjKind::TitleText )
eElement = vcl::PDFWriter::Heading;
else if ( nIdentifier == SdrObjKind::OutlineText )
diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx
index 2d71f83ef337..df271a3e2404 100644
--- a/svx/source/table/viewcontactoftableobj.cxx
+++ b/svx/source/table/viewcontactoftableobj.cxx
@@ -33,8 +33,10 @@
#include <drawinglayer/attribute/sdrlineattribute.hxx>
#include <drawinglayer/attribute/sdrshadowattribute.hxx>
#include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
+#include <drawinglayer/primitive2d/structuretagprimitive2d.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <svx/svdpage.hxx>
#include <svx/framelink.hxx>
#include <svx/framelinkarray.hxx>
#include <svx/sdooitm.hxx>
@@ -217,6 +219,7 @@ namespace sdr::contact
const sal_Int32 nRowCount(xTable->getRowCount());
const sal_Int32 nColCount(xTable->getColumnCount());
const sal_Int32 nAllCount(nRowCount * nColCount);
+ SdrPage const*const pPage(rTableObj.getSdrPageFromSdrObject());
if(nAllCount)
{
@@ -230,7 +233,7 @@ namespace sdr::contact
// GetGeoRect() to not trigger any calculations. It's the unrotated geometry.
const basegfx::B2DRange aObjectRange = vcl::unotools::b2DRectangleFromRectangle(rTableObj.GetGeoRect());
- // To create the CellBorderPrimitives, use the tolling from svx::frame::Array
+ // To create the CellBorderPrimitives, use the tooling from svx::frame::Array
// which is capable of creating the needed visualization. Fill it during the
// anyways needed run over the table.
svx::frame::Array aArray;
@@ -241,11 +244,13 @@ namespace sdr::contact
// create single primitives per cell
for(aCellPos.mnRow = 0; aCellPos.mnRow < nRowCount; aCellPos.mnRow++)
{
+ drawinglayer::primitive2d::Primitive2DContainer row;
// add RowHeight to CellBorderArray for primitive creation
aArray.SetRowHeight(aCellPos.mnRow, rTableLayouter.getRowHeight(aCellPos.mnRow));
for(aCellPos.mnCol = 0; aCellPos.mnCol < nColCount; aCellPos.mnCol++)
{
+ drawinglayer::primitive2d::Primitive2DContainer cell;
// add ColWidth to CellBorderArray for primitive creation, only
// needs to be done in the 1st run
if(0 == aCellPos.mnRow)
@@ -324,7 +329,7 @@ namespace sdr::contact
const drawinglayer::primitive2d::Primitive2DReference xCellReference(
new drawinglayer::primitive2d::SdrCellPrimitive2D(
aCellMatrix, aAttribute));
- aRetval.append(xCellReference);
+ cell.append(xCellReference);
}
// Create cell primitive without text.
@@ -347,7 +352,28 @@ namespace sdr::contact
aRetvalForShadow.append(xCellReference);
}
}
+ if (pPage)
+ {
+ cell = drawinglayer::primitive2d::Primitive2DContainer {
+ new drawinglayer::primitive2d::StructureTagPrimitive2D(
+ vcl::PDFWriter::TableData,
+ pPage->IsMasterPage(),
+ false,
+ std::move(cell)) };
+ }
+ row.append(cell);
+ }
+
+ if (pPage)
+ {
+ row = drawinglayer::primitive2d::Primitive2DContainer {
+ new drawinglayer::primitive2d::StructureTagPrimitive2D(
+ vcl::PDFWriter::TableRow,
+ pPage->IsMasterPage(),
+ false,
+ std::move(row)) };
}
+ aRetval.append(row);
}
// now create all CellBorderPrimitives