summaryrefslogtreecommitdiff
path: root/sc/qa/unit/data/ods/tdf129940.ods
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@collabora.com>2025-09-17 21:01:28 +0200
committerMichael Stahl <michael.stahl@collabora.com>2025-10-01 11:59:18 +0200
commit7978401cfcdd68536b47f2dfcf4799a5dcbdd22f (patch)
tree9bbb481916b2bd656a6c2c4b7e23017d252182e0 /sc/qa/unit/data/ods/tdf129940.ods
parent169e1f3b914ac590b3719b8129b4f0913d4da228 (diff)
sw: fix "Export Directly as PDF" with set-variable fields in hidden textHEADmaster
... results in wrong conditional text fields. First, add a testHiddenSectionPDFExport2 for the bug that was fixed with commit 1e007e8f1703851b01c68884e87c906f6bae5a5e - and testHiddenSectionPDFExport for a slightly different scenario that also failed. Investigating this, it turns out that the conditions are only evaluated properly inside SwDBManager::Merge(), because this sets up its m_pImpl->pMergeData, and without that SwCalc::VarLook() will not know which record is currently selected and return SbxVoid (if there is no xConnection) or a wrong record (if there is a xConnection). There is even code in SwDBManager::Merge() that tries to store the new state in m_DataSourceParams so that later SwCalc are able to use it, but this broke in 2007 with commit d06a6d2c192076870d67f19653701fdc25d9841c which changed SwNewDBMgr::FindDSData() to return the m_pImpl->pMergeData instead of a m_DataSourceParams entry, and thus the *pTemp assignment became self-assignment. Also, FindDSData(bCreate=true) already does everything that this code was doing anyway, so if we just call that *before* creating m_pImpl->pMergeData we can delete all that code. Now another problem becomes apparent: an obvious mismatch between how SwDBManager::GetColumnCnt() and lcl_MoveAbsolute() treat SwDSParam::aSelection - in the caller the nAbsRecordId is an index that is *contained* in aSelection (see explicit search with std::any_of), in the callee it is an index *into* aSelection. Apparently this is a regression from commit f5ccfd60c2c5dab392d58870fbd079a6286bc239 and testing reveals that for tdf#73025 the lcl_MoveAbsolute() is never called from GetColumnCnt(), but only from SwDBManager::ToRecordId(), so let's have 2 different functions for callers expecting different behaviour. Then revert 1e007e8f1703851b01c68884e87c906f6bae5a5e as this scenario works with the above described fixes. Add a testHiddenTextFieldPDFExport for the new bug. Change-Id: Ibca38edec8782c06a61d4eb5c9065098de8562fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191104 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
Diffstat (limited to 'sc/qa/unit/data/ods/tdf129940.ods')
0 files changed, 0 insertions, 0 deletions