Files
odfstudio/sfx2
Michael Stahl 7978401cfc 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 1e007e8f17 - 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 d06a6d2c19
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
f5ccfd60c2 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 1e007e8f17 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>
2025-10-01 11:59:18 +02:00
..
…
2025-09-05 19:45:45 +02:00
2025-09-01 08:49:15 +02:00
…
…
…

Legacy Framework

SFX is the "old" framework, used for historical reasons.

An attempt of documentation of this module is located in [git:sfx2/doc].

It contains base classes for document model, view and controller, used by "old" applications like sw, sc, sd (while "new" applications are based on the "new" UNO based framework in "framework").

The SFX framework is based on dispatching slots identified by integers (SlotIDs) to SfxShells, and there is a dedicated IDL compiler (svidl) involved that generates C++ slot headers from SDI files in modules' sdi/ subdirectory.

Documentation about SFX dispatch, SDI etc.: https://wiki.openoffice.org/wiki/Framework/Article/Implementation_of_the_Dispatch_API_In_SFX2

Document load/save code is maintained in [git:sfx2/source/doc/docfile.cxx] SfxMedium class, which handles all the twisty load and save corner cases.

[git:sfx2/source/appl/sfxhelp.cxx] Start procedure for the online help viewer top level window; handling of help URL creation and dispatch.

There are also some UNO services here that could really be implemented anywhere, e.g. the DocumentProperties or DocumentMetadataAccess.

Notable files: sfx2/source/dialog/backingwindow.cxx Startcenter buttons and the corresponding event handler.