summaryrefslogtreecommitdiff
path: root/vcl/qa
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2022-11-30 15:06:02 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2022-12-01 17:01:42 +0100
commit0bc96b8805f2cfa2278729a9f3e56a350ddd69ad (patch)
tree2b368af8b0bca447ab9c18cdfbbc42a5156a0035 /vcl/qa
parent56ff8262d8ace8fd99326e290597cb901654ea11 (diff)
tdf#135192 drawinglayer,svx: PDF/UA export: also tag TH for SdrTableObj
There isn't really an indication of anything being a header row, but the table template application has a flag to apply special formatting to the first row, so let's use that as indication that it's a header row Change-Id: Ic361c84d9a1a4e91109d6f9d2cd626c9633b311f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143500 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'vcl/qa')
-rw-r--r--vcl/qa/cppunit/pdfexport/pdfexport.cxx41
1 files changed, 40 insertions, 1 deletions
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index 8756dc9b5d77..ea8f83e6ba8f 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -3461,7 +3461,46 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf135192)
auto pS3 = dynamic_cast<
vcl::filter::PDFNameElement*>(
pObject3->Lookup("S"));
- if (pS3 && pS3->GetValue() == "TD")
+ if (nTR == 0 && pS3 && pS3->GetValue() == "TH")
+ {
+ int nOTable(0);
+ auto pAttrs = dynamic_cast<
+ vcl::filter::PDFArrayElement*>(
+ pObject3->Lookup("A"));
+ CPPUNIT_ASSERT(pAttrs != nullptr);
+ for (const auto& rAttrRef :
+ pAttrs->GetElements())
+ {
+ auto pARef = dynamic_cast<
+ vcl::filter::PDFReferenceElement*>(
+ rAttrRef);
+ CPPUNIT_ASSERT(pARef != nullptr);
+ auto pAttr = pARef->LookupObject();
+ CPPUNIT_ASSERT(pAttr != nullptr);
+ auto pAttrDict = pAttr->GetDictionary();
+ CPPUNIT_ASSERT(pAttrDict != nullptr);
+ auto pOwner = dynamic_cast<
+ vcl::filter::PDFNameElement*>(
+ pAttrDict->LookupElement("O"));
+ CPPUNIT_ASSERT(pOwner != nullptr);
+ if (pOwner->GetValue() == "Table")
+ {
+ auto pScope = dynamic_cast<
+ vcl::filter::PDFNameElement*>(
+ pAttrDict->LookupElement(
+ "Scope"));
+ CPPUNIT_ASSERT(pScope != nullptr);
+ CPPUNIT_ASSERT_EQUAL(
+ OString("Column"),
+ pScope->GetValue());
+ ++nOTable;
+ }
+ }
+ CPPUNIT_ASSERT_EQUAL(int(1), nOTable);
+ ++nTD;
+ }
+ else if (nTR != 0 && pS3
+ && pS3->GetValue() == "TD")
{
++nTD;
}