https://bugs.documentfoundation.org/show_bug.cgi?id=172373

BogdanB <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Regression By|                            |Michael Stahl
                 CC|                            |[email protected]
           Keywords|bibisectRequest             |bibisected, bisected

--- Comment #16 from BogdanB <[email protected]> ---
commit 7978401cfcdd68536b47f2dfcf4799a5dcbdd22f
Author: Michael Stahl <[email protected]>
Date:   Wed Sep 17 21:01:28 2025 +0200

    sw: fix "Export Directly as PDF" with set-variable fields in hidden text

    ... 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 <[email protected]>

Michael, please can you take a look?

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to