diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-05-29 16:59:04 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-05-30 09:48:46 +0200 |
commit | cc94f402853bbdce40165a00fe317910d6270562 (patch) | |
tree | 0af17665250f6c942b66ef70f725dcf481092be8 /vcl | |
parent | e303b3bba8caaefd3a7897a773deb69643967047 (diff) |
'tagged' pdf export of spreadsheets doesn't perform well
m_aStructure is appended to for every row and cell, so a spreadsheet
with 20 cols and 100,000 rows is many seconds slower to export in 24.8
than 24.4
since:
commit b3c93b16d62e809500005edc749af4b8ad10162c
Date: Wed Jan 3 11:18:19 2024 +0100
tdf#123870 sc: fix tagged content for accessible PDF export
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161581
shave a sliver of work off.
Change-Id: Ibeb817083fef3c9499326abe381527a31917303b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168226
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/pdf/pdfwriter_impl.hxx | 8 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 11 |
2 files changed, 12 insertions, 7 deletions
diff --git a/vcl/inc/pdf/pdfwriter_impl.hxx b/vcl/inc/pdf/pdfwriter_impl.hxx index b0388ecd27a1..2afab075dbe6 100644 --- a/vcl/inc/pdf/pdfwriter_impl.hxx +++ b/vcl/inc/pdf/pdfwriter_impl.hxx @@ -603,6 +603,14 @@ struct PDFStructureElement { } + PDFStructureElement(sal_Int32 nOwnElement, sal_Int32 nParentElement, sal_Int32 nFirstPageObject) + : m_nObject(0) + , m_nOwnElement(nOwnElement) + , m_nParentElement(nParentElement) + , m_nFirstPageObject(nFirstPageObject) + , m_bOpenMCSeq(false ) + { + } }; // helper structure for drawLayout and friends diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 17e7c2744a23..ba786d7bb34b 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -10813,13 +10813,10 @@ sal_Int32 PDFWriterImpl::ensureStructureElement() return -1; sal_Int32 nNewId = sal_Int32(m_aStructure.size()); - m_aStructure.emplace_back(); - PDFStructureElement& rEle = m_aStructure.back(); - // leave rEle.m_oType uninitialised - rEle.m_nOwnElement = nNewId; - // temporary parent - rEle.m_nParentElement = m_nCurrentStructElement; - rEle.m_nFirstPageObject = m_aPages[ m_nCurrentPage ].m_nPageObject; + + // use m_nCurrentStructElement as temporary parent + m_aStructure.emplace_back(nNewId, m_nCurrentStructElement, m_aPages[m_nCurrentPage].m_nPageObject); + m_aStructure[ m_nCurrentStructElement ].m_aChildren.push_back( nNewId ); return nNewId; } |