sfx2/source/doc/objserv.cxx | 20 sw/inc/dbmgr.hxx | 2 sw/qa/extras/layout/data/hideSection.fodt | 39 + sw/qa/extras/layout/data/table-with-hidden-section.fodt | 57 ++ sw/qa/extras/layout/layout2.cxx | 37 + sw/qa/extras/uiwriter/data/database-display-hidden-section.fodt | 60 ++ sw/qa/extras/uiwriter/data/database-display-hidden-section2.fodt | 60 ++ sw/qa/extras/uiwriter/data/set-variable-hidden-text.fodt | 121 +++++ sw/qa/extras/uiwriter/uiwriter9.cxx | 224 ++++++++++ sw/source/core/doc/docfld.cxx | 53 -- sw/source/core/layout/sectfrm.cxx | 9 sw/source/core/layout/trvlfrm.cxx | 4 sw/source/uibase/dbui/dbmgr.cxx | 69 +-- 13 files changed, 638 insertions(+), 117 deletions(-)
New commits: commit 52df03851374e63f13d9f5d3a83bd01cfe0635f5 Author: Michael Stahl <[email protected]> AuthorDate: Wed Sep 17 21:01:28 2025 +0200 Commit: Michael Stahl <[email protected]> CommitDate: Wed Oct 1 12:21:32 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]> (cherry picked from commit 7978401cfcdd68536b47f2dfcf4799a5dcbdd22f) diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 5fb379e8f374..458c1703d57f 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -1086,20 +1086,6 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) SfxViewShell::Current()->SetStoringHelper(xHelper); QueryHiddenInformation(bIsPDFExport ? HiddenWarningFact::WhenCreatingPDF : HiddenWarningFact::WhenSaving); - SfxPoolItemHolder aItem; - if (SID_DIRECTEXPORTDOCASPDF == nId) - aItem = GetSlotState(SID_MAIL_PREPAREEXPORT); - const SfxBoolItem* pItem(dynamic_cast<const SfxBoolItem*>(aItem.getItem())); - - // Fetch value from the pool item early, because GUIStoreModel() can free the pool - // item as part of spinning the main loop if a dialog is opened. - const bool bMailPrepareExport(nullptr != pItem && pItem->GetValue()); - if (bMailPrepareExport) - { - SfxRequest aRequest(SID_MAIL_PREPAREEXPORT, SfxCallMode::SYNCHRON, GetPool()); - aRequest.AppendItem(SfxBoolItem(FN_NOUPDATE, true)); - ExecuteSlot(aRequest); - } xHelper->GUIStoreModel( GetModel(), pSlot->GetUnoName(), @@ -1108,12 +1094,6 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) GetDocumentSignatureState(), bIsAsync ); - if (bMailPrepareExport) - { - SfxRequest aRequest(SID_MAIL_EXPORT_FINISHED, SfxCallMode::SYNCHRON, GetPool()); - ExecuteSlot(aRequest); - } - // merge aDispatchArgs to the request SfxAllItemSet aResultParams( GetPool() ); TransformParameters( nId, diff --git a/sw/inc/dbmgr.hxx b/sw/inc/dbmgr.hxx index 4c6a0c1e7499..26516fc4d7cc 100644 --- a/sw/inc/dbmgr.hxx +++ b/sw/inc/dbmgr.hxx @@ -360,7 +360,7 @@ public: OUString& rResult, double* pNumber); /** create and store or find an already stored connection to a data source for use in SwFieldMgr and SwDBTreeList */ - css::uno::Reference< css::sdbc::XConnection> const & + SW_DLLPUBLIC css::uno::Reference<css::sdbc::XConnection> const& RegisterConnection(OUString const& rSource); void CreateDSData(const SwDBData& rData) diff --git a/sw/qa/extras/uiwriter/data/database-display-hidden-section.fodt b/sw/qa/extras/uiwriter/data/database-display-hidden-section.fodt new file mode 100644 index 000000000000..09fac66f6f11 --- /dev/null +++ b/sw/qa/extras/uiwriter/data/database-display-hidden-section.fodt @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<office:document xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rpt="http://openoffice.org/2005/report" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:d r3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:font-face-decls> + <style:font-face style:name="Liberation Serif" svg:font-family="'Liberation Serif'" style:font-family-generic="roman" style:font-pitch="variable"/> + <style:font-face style:name="Lohit Devanagari" svg:font-family="'Lohit Devanagari'" style:font-family-generic="system" style:font-pitch="variable"/> + <style:font-face style:name="Source Han Serif CN" svg:font-family="'Source Han Serif CN'" style:font-family-generic="system" style:font-pitch="variable"/> + </office:font-face-decls> + <office:styles> + <style:default-style style:family="graphic"> + <style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/> + <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:font-independent-line-spacing="false"> + <style:tab-stops/> + </style:paragraph-properties> + <style:text-properties style:use-window-font-color="true" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Serif CN" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/> + </style:default-style> + <style:default-style style:family="paragraph"> + <style:paragraph-properties fo:orphans="2" fo:widows="2" fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/> + <style:text-properties style:use-window-font-color="true" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Serif CN" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2"/> + </style:default-style> + <style:default-style style:family="table"> + <style:table-properties table:border-model="collapsing"/> + </style:default-style> + <style:default-style style:family="table-row"> + <style:table-row-properties fo:keep-together="auto"/> + </style:default-style> + <style:style style:name="Standard" style:family="paragraph" style:class="text"/> + </office:styles> + <office:automatic-styles> + <style:page-layout style:name="pm1"> + <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" style:layout-grid-base-height="0.706cm" style:layout-grid-ruby-height="0.353cm" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false" style:layout-grid-display="false" style:footnote-max-height="0cm"> + <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/> + </style:page-layout-properties> + <style:header-style/> + <style:footer-style/> + </style:page-layout> + <style:style style:name="Sect1" style:family="section"> + <style:section-properties style:editable="false"> + <style:columns fo:column-count="1" fo:column-gap="0cm"/> + </style:section-properties> + </style:style> + </office:automatic-styles> + <office:master-styles> + <style:master-page style:name="Standard" style:page-layout-name="pm1"/> + </office:master-styles> + <office:body> + <office:text> + + <text:p text:style-name="Standard"> + <text:database-display text:table-name="biblio" text:table-type="table" text:column-name="Custom1" text:database-name="Bibliography"><Custom1></text:database-display> + </text:p> + <text:p text:style-name="Standard"/> + <text:section text:style-name="Sect1" text:name="Section1" text:condition="ooow:Bibliography.biblio.Custom1=="English"" text:is-hidden="true" text:display="condition"> + <text:p text:style-name="Standard"/> + <text:p text:style-name="Standard">Section cachée si "Custom1" = "English"</text:p> + </text:section> + + </office:text> + </office:body> +</office:document> diff --git a/sw/qa/extras/uiwriter/data/database-display-hidden-section2.fodt b/sw/qa/extras/uiwriter/data/database-display-hidden-section2.fodt new file mode 100644 index 000000000000..d7860b9420e4 --- /dev/null +++ b/sw/qa/extras/uiwriter/data/database-display-hidden-section2.fodt @@ -0,0 +1,60 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<office:document xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rpt="http://openoffice.org/2005/report" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:d r3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:grddl="http://www.w3.org/2003/g/data-view#" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:font-face-decls> + <style:font-face style:name="Liberation Serif" svg:font-family="'Liberation Serif'" style:font-family-generic="roman" style:font-pitch="variable"/> + <style:font-face style:name="Lohit Devanagari" svg:font-family="'Lohit Devanagari'" style:font-family-generic="system" style:font-pitch="variable"/> + <style:font-face style:name="Source Han Serif CN" svg:font-family="'Source Han Serif CN'" style:font-family-generic="system" style:font-pitch="variable"/> + </office:font-face-decls> + <office:styles> + <style:default-style style:family="graphic"> + <style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/> + <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:font-independent-line-spacing="false"> + <style:tab-stops/> + </style:paragraph-properties> + <style:text-properties style:use-window-font-color="true" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Serif CN" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/> + </style:default-style> + <style:default-style style:family="paragraph"> + <style:paragraph-properties fo:orphans="2" fo:widows="2" fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/> + <style:text-properties style:use-window-font-color="true" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Source Han Serif CN" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lohit Devanagari" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2"/> + </style:default-style> + <style:default-style style:family="table"> + <style:table-properties table:border-model="collapsing"/> + </style:default-style> + <style:default-style style:family="table-row"> + <style:table-row-properties fo:keep-together="auto"/> + </style:default-style> + <style:style style:name="Standard" style:family="paragraph" style:class="text"/> + </office:styles> + <office:automatic-styles> + <style:page-layout style:name="pm1"> + <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" style:layout-grid-base-height="0.706cm" style:layout-grid-ruby-height="0.353cm" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false" style:layout-grid-display="false" style:footnote-max-height="0cm"> + <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/> + </style:page-layout-properties> + <style:header-style/> + <style:footer-style/> + </style:page-layout> + <style:style style:name="Sect1" style:family="section"> + <style:section-properties style:editable="false"> + <style:columns fo:column-count="1" fo:column-gap="0cm"/> + </style:section-properties> + </style:style> + </office:automatic-styles> + <office:master-styles> + <style:master-page style:name="Standard" style:page-layout-name="pm1"/> + </office:master-styles> + <office:body> + <office:text> + + <text:p text:style-name="Standard"> + <text:database-display text:table-name="biblio" text:table-type="table" text:column-name="Custom1" text:database-name="Bibliography2"><Custom1></text:database-display> + </text:p> + <text:p text:style-name="Standard"/> + <text:section text:style-name="Sect1" text:name="Section1" text:condition="ooow:Bibliography2.biblio.Custom1=="English"" text:is-hidden="true" text:display="condition"> + <text:p text:style-name="Standard"/> + <text:p text:style-name="Standard">Section cachée si "Custom1" = "English"</text:p> + </text:section> + + </office:text> + </office:body> +</office:document> diff --git a/sw/qa/extras/uiwriter/data/set-variable-hidden-text.fodt b/sw/qa/extras/uiwriter/data/set-variable-hidden-text.fodt new file mode 100644 index 000000000000..576604298b33 --- /dev/null +++ b/sw/qa/extras/uiwriter/data/set-variable-hidden-text.fodt @@ -0,0 +1,121 @@ +<?xml version='1.0' encoding='UTF-8'?> +<office:document xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:c alcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns: meta:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" office:version="1.4" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:meta><meta:initial-creator>gcc</meta:initial-creator><meta:creation-date>2025-09-18T14:40:00.300148362</meta:creation-date><dc:date>2025-09-18T14:40:40.278151245</dc:date><dc:creator>gcc</dc:creator><meta:editing-duration>PT41S</meta:editing-duration><meta:editing-cycles>1</meta:editing-cycles><meta:document-statistic meta:table-count="0" meta:image-count="0" meta:object-count="0" meta:page-count="1" meta:paragraph-count="1" meta:word-count="1" meta:character-count="8" meta:non-whitespace-character-count="8"/><meta:generator>LibreOfficeDev/26.2.0.0.alpha0$Linux_X86_64 LibreOffice_project/7954f6cb07c7219cff788ad9e6c4809ceef8f690</meta:generator></office:meta> + <office:font-face-decls> + <style:font-face style:name="Liberation Serif" svg:font-family="'Liberation Serif'" style:font-family-generic="roman" style:font-pitch="variable"/> + <style:font-face style:name="Lucida Sans1" svg:font-family="'Lucida Sans'" style:font-family-generic="system" style:font-pitch="variable"/> + <style:font-face style:name="Noto Serif CJK SC" svg:font-family="'Noto Serif CJK SC'" style:font-family-generic="system" style:font-pitch="variable"/> + </office:font-face-decls> + <office:styles> + <style:default-style style:family="graphic"> + <style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/> + <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" loext:tab-stop-distance="0cm" style:writing-mode="lr-tb" style:font-independent-line-spacing="false"> + <style:tab-stops/> + </style:paragraph-properties> + <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Noto Serif CJK SC" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lucida Sans1" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/> + </style:default-style> + <style:default-style style:family="paragraph"> + <style:paragraph-properties fo:orphans="2" fo:widows="2" fo:hyphenation-ladder-count="no-limit" fo:hyphenation-keep="auto" loext:hyphenation-keep-type="column" loext:hyphenation-keep-line="false" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/> + <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" fo:country="DE" style:letter-kerning="true" style:font-name-asian="Noto Serif CJK SC" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Lucida Sans1" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" loext:hyphenation-no-caps="false" loext:hyphenation-no-last-word="false" loext:hyphenation-word-char-count="5" loext:hyphenation-zone="no-limit"/> + </style:default-style> + <style:default-style style:family="table"> + <style:table-properties table:border-model="collapsing"/> + </style:default-style> + <style:default-style style:family="table-row"> + <style:table-row-properties fo:keep-together="auto"/> + </style:default-style> + <style:style style:name="Standard" style:family="paragraph" style:class="text"/> + <text:outline-style style:name="Outline"> + <text:outline-level-style text:level="1" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="2" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="3" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="4" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="5" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="6" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="7" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="8" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="9" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + <text:outline-level-style text:level="10" style:num-format=""> + <style:list-level-properties text:list-level-position-and-space-mode="label-alignment"> + <style:list-level-label-alignment text:label-followed-by="listtab"/> + </style:list-level-properties> + </text:outline-level-style> + </text:outline-style> + <text:notes-configuration text:note-class="footnote" style:num-format="1" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="document"/> + <text:notes-configuration text:note-class="endnote" style:num-format="i" text:start-value="0"/> + <text:linenumbering-configuration text:number-lines="false" text:offset="0.499cm" style:num-format="1" text:number-position="left" text:increment="5"/> + </office:styles> + <office:automatic-styles> + <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard"> + <style:text-properties text:display="none"/> + </style:style> + <style:style style:name="P2" style:family="paragraph" style:parent-style-name="Standard"> + <style:text-properties/> + </style:style> + <style:page-layout style:name="pm1"> + <style:page-layout-properties fo:page-width="10.5cm" fo:page-height="14.801cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm" loext:margin-gutter="0cm"> + <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="solid" style:adjustment="left" style:rel-width="25%" style:color="#000000"/> + </style:page-layout-properties> + <style:header-style/> + <style:footer-style/> + </style:page-layout> + <number:number-style style:name="N0"> + <number:number number:min-integer-digits="1"/> + </number:number-style> + </office:automatic-styles> + <office:master-styles> + <style:master-page style:name="Standard" style:page-layout-name="pm1"/> + </office:master-styles> + <office:body> + <office:text> + <text:variable-decls> + <text:variable-decl office:value-type="float" text:name="foo"/> + </text:variable-decls> + <text:sequence-decls> + <text:sequence-decl text:display-outline-level="0" text:name="Illustration"/> + <text:sequence-decl text:display-outline-level="0" text:name="Table"/> + <text:sequence-decl text:display-outline-level="0" text:name="Text"/> + <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/> + <text:sequence-decl text:display-outline-level="0" text:name="Figure"/> + </text:sequence-decls> + <text:p text:style-name="P1"><text:variable-set text:name="foo" office:value-type="float" office:value="2" style:data-style-name="N0">2</text:variable-set></text:p> + <text:p text:style-name="P2"><text:conditional-text text:condition="ooow:foo==2" text:string-value-if-true="Expected" text:string-value-if-false="Fail">Expected</text:conditional-text></text:p> + </office:text> + </office:body> +</office:document> \ No newline at end of file diff --git a/sw/qa/extras/uiwriter/uiwriter9.cxx b/sw/qa/extras/uiwriter/uiwriter9.cxx index 3b53a1a3ae1a..d0dd4b1b9879 100644 --- a/sw/qa/extras/uiwriter/uiwriter9.cxx +++ b/sw/qa/extras/uiwriter/uiwriter9.cxx @@ -39,6 +39,8 @@ #include <fmtfsize.hxx> #include <fmtinfmt.hxx> #include <rootfrm.hxx> +#include <dbmgr.hxx> +#include <mmconfigitem.hxx> #include <svx/svxids.hrc> namespace @@ -180,6 +182,228 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testSetStringDeletesShape) CPPUNIT_ASSERT_EQUAL(size_t(1), pDoc->GetFlyCount(FLYCNTTYPE_FRM)); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testHiddenSectionPDFExport) +{ + // this uses biblio.odb + createSwDoc("database-display-hidden-section.fodt"); + + uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xSections(xTextSectionsSupplier->getTextSections(), + uno::UNO_QUERY); + uno::Reference<text::XTextSection> xSection(xSections->getByIndex(0), uno::UNO_QUERY); + + // apparently without a record it evaluates to hidden? + CPPUNIT_ASSERT(!getProperty<bool>(xSection, "IsVisible")); + CPPUNIT_ASSERT(!getProperty<bool>(xSection, "IsCurrentlyVisible")); + + // somehow a timer that constructs toolbars isn't run in unit tests - + // it would query state of .uno:MailMergeEmailDocuments which as a side + // effect (!) calls this: + getSwDocShell()->GetView()->EnsureMailMergeConfigItem(); + + dispatchCommand(mxComponent, u".uno:MailMergeNextEntry"_ustr, {}); + getParagraph(1, "English "); + CPPUNIT_ASSERT(!getProperty<bool>(xSection, "IsCurrentlyVisible")); + + dispatchCommand(mxComponent, u".uno:MailMergeNextEntry"_ustr, {}); + getParagraph(1, "English "); + CPPUNIT_ASSERT(!getProperty<bool>(xSection, "IsCurrentlyVisible")); + + uno::Sequence<css::beans::PropertyValue> args{ + comphelper::makePropertyValue(u"SynchronMode"_ustr, true), + comphelper::makePropertyValue(u"URL"_ustr, maTempFile.GetURL()) + }; + dispatchCommand(mxComponent, u".uno:ExportDirectToPDF"_ustr, args); + + // fetch again in case it was deleted and undo + xSection.set(xSections->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(!getProperty<bool>(xSection, "IsCurrentlyVisible")); + + std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get(); + + int nObjectsHidden; + if (pPDFium) + { + SvFileStream aPDFFile(maTempFile.GetURL(), StreamMode::READ); + SvMemoryStream aMemory; + aMemory.WriteStream(aPDFFile); + + std::unique_ptr<vcl::pdf::PDFiumDocument> pPdfDocument + = pPDFium->openDocument(aMemory.GetData(), aMemory.GetSize(), OString()); + CPPUNIT_ASSERT(pPdfDocument); + CPPUNIT_ASSERT_EQUAL(1, pPdfDocument->getPageCount()); + + std::unique_ptr<vcl::pdf::PDFiumPage> pPdfPage = pPdfDocument->openPage(0); + CPPUNIT_ASSERT(pPdfPage); + nObjectsHidden = pPdfPage->getObjectCount(); + } + + dispatchCommand(mxComponent, u".uno:MailMergeNextEntry"_ustr, {}); + getParagraph(1, "Deutsch "); + CPPUNIT_ASSERT(getProperty<bool>(xSection, "IsCurrentlyVisible")); + + dispatchCommand(mxComponent, u".uno:ExportDirectToPDF"_ustr, args); + + // fetch again in case it was deleted and undo + xSection.set(xSections->getByIndex(0), uno::UNO_QUERY); + // the problem was that PDF export hid the section + CPPUNIT_ASSERT(getProperty<bool>(xSection, "IsCurrentlyVisible")); + + if (pPDFium) + { + SvFileStream aPDFFile(maTempFile.GetURL(), StreamMode::READ); + SvMemoryStream aMemory; + aMemory.WriteStream(aPDFFile); + + std::unique_ptr<vcl::pdf::PDFiumDocument> pPdfDocument + = pPDFium->openDocument(aMemory.GetData(), aMemory.GetSize(), OString()); + CPPUNIT_ASSERT(pPdfDocument); + CPPUNIT_ASSERT_EQUAL(1, pPdfDocument->getPageCount()); + + std::unique_ptr<vcl::pdf::PDFiumPage> pPdfPage = pPdfDocument->openPage(0); + CPPUNIT_ASSERT(pPdfPage); + // there must be more objects on the page now (currently goes 2->3) + CPPUNIT_ASSERT_LESS(pPdfPage->getObjectCount(), nObjectsHidden); + } +} + +CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testHiddenSectionPDFExport2) +{ + // this uses biblio.odb + createSwDoc("database-display-hidden-section2.fodt"); + + uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xSections(xTextSectionsSupplier->getTextSections(), + uno::UNO_QUERY); + uno::Reference<text::XTextSection> xSection(xSections->getByIndex(0), uno::UNO_QUERY); + + // apparently without a record it evaluates to hidden? + CPPUNIT_ASSERT(!getProperty<bool>(xSection, "IsVisible")); + CPPUNIT_ASSERT(!getProperty<bool>(xSection, "IsCurrentlyVisible")); + + // somehow a timer that constructs toolbars isn't run in unit tests - + // it would query state of .uno:MailMergeEmailDocuments which as a side + // effect (!) calls this: + auto pMMConfig = getSwDocShell()->GetView()->EnsureMailMergeConfigItem(); + + // ... but the file has wrong DB name so we first have to fix it + // in the same way as SwChangeDBDlg + SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell(); + pWrtShell->GetDBManager()->RegisterConnection("Bibliography"); + SwDBData data; + data.sDataSource = "Bibliography"; + data.sCommand = "biblio"; + pWrtShell->ChgDBData(data); + // this would be called via a SwXTextView listener + pMMConfig->updateCurrentDBDataFromDocument(); + pWrtShell->ChangeDBFields({ u"Bibliography2ÿbiblioÿ0"_ustr }, u"Bibliographyÿbiblioÿ0"_ustr); + + dispatchCommand(mxComponent, u".uno:MailMergeNextEntry"_ustr, {}); + getParagraph(1, "English "); + CPPUNIT_ASSERT(!getProperty<bool>(xSection, "IsCurrentlyVisible")); + + dispatchCommand(mxComponent, u".uno:MailMergeNextEntry"_ustr, {}); + getParagraph(1, "English "); + CPPUNIT_ASSERT(!getProperty<bool>(xSection, "IsCurrentlyVisible")); + + uno::Sequence<css::beans::PropertyValue> args{ + comphelper::makePropertyValue(u"SynchronMode"_ustr, true), + comphelper::makePropertyValue(u"URL"_ustr, maTempFile.GetURL()) + }; + dispatchCommand(mxComponent, u".uno:ExportDirectToPDF"_ustr, args); + + // fetch again in case it was deleted and undo + xSection.set(xSections->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT(!getProperty<bool>(xSection, "IsCurrentlyVisible")); + + std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get(); + + int nObjectsHidden; + if (pPDFium) + { + SvFileStream aPDFFile(maTempFile.GetURL(), StreamMode::READ); + SvMemoryStream aMemory; + aMemory.WriteStream(aPDFFile); + + std::unique_ptr<vcl::pdf::PDFiumDocument> pPdfDocument + = pPDFium->openDocument(aMemory.GetData(), aMemory.GetSize(), OString()); + CPPUNIT_ASSERT(pPdfDocument); + CPPUNIT_ASSERT_EQUAL(1, pPdfDocument->getPageCount()); + + std::unique_ptr<vcl::pdf::PDFiumPage> pPdfPage = pPdfDocument->openPage(0); + CPPUNIT_ASSERT(pPdfPage); + nObjectsHidden = pPdfPage->getObjectCount(); + } + + dispatchCommand(mxComponent, u".uno:MailMergeNextEntry"_ustr, {}); + getParagraph(1, "Deutsch "); + CPPUNIT_ASSERT(getProperty<bool>(xSection, "IsCurrentlyVisible")); + + dispatchCommand(mxComponent, u".uno:ExportDirectToPDF"_ustr, args); + + // fetch again in case it was deleted and undo + xSection.set(xSections->getByIndex(0), uno::UNO_QUERY); + // the problem was that PDF export hid the section + CPPUNIT_ASSERT(getProperty<bool>(xSection, "IsCurrentlyVisible")); + + if (pPDFium) + { + SvFileStream aPDFFile(maTempFile.GetURL(), StreamMode::READ); + SvMemoryStream aMemory; + aMemory.WriteStream(aPDFFile); + + std::unique_ptr<vcl::pdf::PDFiumDocument> pPdfDocument + = pPDFium->openDocument(aMemory.GetData(), aMemory.GetSize(), OString()); + CPPUNIT_ASSERT(pPdfDocument); + CPPUNIT_ASSERT_EQUAL(1, pPdfDocument->getPageCount()); + + std::unique_ptr<vcl::pdf::PDFiumPage> pPdfPage = pPdfDocument->openPage(0); + CPPUNIT_ASSERT(pPdfPage); + // there must be more objects on the page now (currently goes 2->3) + CPPUNIT_ASSERT_LESS(pPdfPage->getObjectCount(), nObjectsHidden); + } +} + +CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testHiddenTextFieldPDFExport) +{ + createSwDoc("set-variable-hidden-text.fodt"); + + getParagraph(1, "2"); + getParagraph(2, "Expected"); + + uno::Sequence<css::beans::PropertyValue> args{ + comphelper::makePropertyValue(u"SynchronMode"_ustr, true), + comphelper::makePropertyValue(u"URL"_ustr, maTempFile.GetURL()) + }; + dispatchCommand(mxComponent, u".uno:ExportDirectToPDF"_ustr, args); + + getParagraph(1, "2"); + // the problem was that this changed to Wrong + getParagraph(2, "Expected"); + + std::shared_ptr<vcl::pdf::PDFium> pPDFium = vcl::pdf::PDFiumLibrary::get(); + if (pPDFium) + { + SvFileStream aPDFFile(maTempFile.GetURL(), StreamMode::READ); + SvMemoryStream aMemory; + aMemory.WriteStream(aPDFFile); + + std::unique_ptr<vcl::pdf::PDFiumDocument> pPdfDocument + = pPDFium->openDocument(aMemory.GetData(), aMemory.GetSize(), OString()); + CPPUNIT_ASSERT(pPdfDocument); + CPPUNIT_ASSERT_EQUAL(1, pPdfDocument->getPageCount()); + + std::unique_ptr<vcl::pdf::PDFiumPage> pPdfPage = pPdfDocument->openPage(0); + CPPUNIT_ASSERT(pPdfPage); + std::unique_ptr<vcl::pdf::PDFiumTextPage> pPdfTextPage = pPdfPage->getTextPage(); + CPPUNIT_ASSERT(pPdfTextPage); + std::unique_ptr<vcl::pdf::PDFiumPageObject> pPageObject = pPdfPage->getObject(0); + OUString sText = pPageObject->getText(pPdfTextPage); + // the problem was that this changed to Wrong + CPPUNIT_ASSERT_EQUAL(u"Expected"_ustr, sText); + } +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testPDFExportCrash) { createSwDoc("section-table-section.fodt"); diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index bb4cdc12cdbe..458237bb651e 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -356,29 +356,44 @@ static bool lcl_MoveAbsolute(SwDSParam* pParam, tools::Long nAbsPos) bool bRet = false; try { - if(pParam->aSelection.hasElements()) + if(pParam->bScrollable) { - if(pParam->aSelection.getLength() <= nAbsPos) + bRet = pParam->xResultSet->absolute( nAbsPos ); + } + else + { + OSL_FAIL("no absolute positioning available"); + } + } + catch(const uno::Exception&) + { + } + return bRet; +} + +static bool lcl_MoveSelectionOrAbsolute(SwDSParam *const pParam, tools::Long const nAbsPos) +{ + bool bRet = false; + try + { + if (pParam->aSelection.hasElements()) + { + if (pParam->aSelection.getLength() <= nAbsPos) { pParam->bEndOfDB = true; - bRet = false; } else { pParam->nSelectionIndex = nAbsPos; sal_Int32 nPos = 0; pParam->aSelection.getConstArray()[ pParam->nSelectionIndex ] >>= nPos; - pParam->bEndOfDB = !pParam->xResultSet->absolute( nPos ); - bRet = !pParam->bEndOfDB; + pParam->bEndOfDB = !pParam->xResultSet->absolute(nPos); } - } - else if(pParam->bScrollable) - { - bRet = pParam->xResultSet->absolute( nAbsPos ); + bRet = !pParam->bEndOfDB; } else { - OSL_FAIL("no absolute positioning available"); + bRet = lcl_MoveAbsolute(pParam, nAbsPos); } } catch(const uno::Exception&) @@ -483,33 +498,13 @@ bool SwDBManager::Merge( const SwMergeDescriptor& rMergeDesc ) return false; } + SwDSParam *const pTemp{FindDSData(aData, true)}; + assert(pTemp && pTemp != m_pImpl->pMergeData.get()); m_pImpl->pMergeData.reset(new SwDSParam(aData, xResSet, aSelection)); - SwDSParam* pTemp = FindDSData(aData, false); - if(pTemp) - *pTemp = *m_pImpl->pMergeData; - else - { - // calls from the calculator may have added a connection with an invalid commandtype - //"real" data base connections added here have to re-use the already available - //DSData and set the correct CommandType - aData.nCommandType = -1; - pTemp = FindDSData(aData, false); - if(pTemp) - *pTemp = *m_pImpl->pMergeData; - else - { - m_DataSourceParams.push_back(std::make_unique<SwDSParam>(*m_pImpl->pMergeData)); - try - { - uno::Reference<lang::XComponent> xComponent(m_DataSourceParams.back()->xConnection, uno::UNO_QUERY); - if(xComponent.is()) - xComponent->addEventListener(m_pImpl->m_xDisposeListener); - } - catch(const uno::Exception&) - { - } - } - } + // assign state with selection to existing entry in m_DataSourceParams + // so later SwCalc can find correct record + *pTemp = *m_pImpl->pMergeData; + if(!m_pImpl->pMergeData->xConnection.is()) m_pImpl->pMergeData->xConnection = xConnection; // add an XEventListener @@ -2303,7 +2298,7 @@ bool SwDBManager::ToRecordId(sal_Int32 nSet) bool bRet = false; sal_Int32 nAbsPos = nSet; assert(nAbsPos >= 0); - bRet = lcl_MoveAbsolute(m_pImpl->pMergeData.get(), nAbsPos); + bRet = lcl_MoveSelectionOrAbsolute(m_pImpl->pMergeData.get(), nAbsPos); m_pImpl->pMergeData->bEndOfDB = !bRet; return bRet; } commit 0596cea926c3342696cc97d4a3ce9615b029b89e Author: Mike Kaganski <[email protected]> AuthorDate: Sat Jun 21 17:25:25 2025 +0500 Commit: Michael Stahl <[email protected]> CommitDate: Wed Oct 1 12:21:32 2025 +0200 tdf#166978: replace HUGE_POSITIVE hack with proper upper invalidation The problem was, that the change of section's height (either to zero when hiding, or from zero to some height when showing) could keep its upper's size unchanged and valid. Invalidating the upper's size in SfxHintId::SwSectionHidden handler was not enough; in the following layout calculation, the upper sets its mbFrameAreaSizeValid to true before its lowers' calculation. Then, during their calculation: * If the section was hiding, SwFrame::MakeValidZeroHeight would fail in ShrinkFrame, then force its height to 0 in 'if (IsLayoutFrame())' block, and not notify upper; * If the section was showing, SwSectionFrame::Grow_ could see that the upper has space enough for the section (e.g., when there are more children after this section), and also not notify upper. The HUGE_POSITIVE hack allowed to force following re-layout in some cases; but the bugdoc failed when the cell was initially made very tall, and hat to split; then the section in it was shrinked to 0,and that didn't cause the merge with the follow. This fixes the problem by: 1. Removing of the HUGE_POSITIVE hack; 2. Invalidating upper cell frame in SwSectionFrame::Grow_, similar to commit ee57229154a91cf632871cfcb1eb9609908f3882 (Fix #88178#: Sectionframe in headerframe, don't grow without invalidation, 2001-06-13); 3. Invalidating layout frame's upper in SwFrame::MakeValidZeroHeight, when ShrinkFrame didn't make it 0-height. In #3, I decided to not check the upper's kind, for robustness; if needed, checks may be added in follow-ups, for specific problems. Change-Id: Iafdd1c41b52d2170d5dd2b3bc2cbc1a5f657c0fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186779 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> (cherry picked from commit 4cfd0c99d1bd85a4927cb3b433b903cc26f5ef95) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186788 Reviewed-by: Michael Stahl <[email protected]> (cherry picked from commit f1fa292d4a8f5553990215fb4aef919746c5bec5) diff --git a/sw/qa/extras/layout/data/hideSection.fodt b/sw/qa/extras/layout/data/hideSection.fodt new file mode 100644 index 000000000000..ba953e5103e8 --- /dev/null +++ b/sw/qa/extras/layout/data/hideSection.fodt @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" office:version="1.4" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:automatic-styles> + <style:style style:name="Table1" style:family="table"> + <style:table-properties table:align="margins"/> + </style:style> + <style:style style:name="Table1.A1" style:family="table-cell"> + <style:table-cell-properties fo:border="0.05pt solid #000000"/> + </style:style> + </office:automatic-styles> + <office:body> + <office:text> + <table:table table:name="Table1" table:style-name="Table1"> + <table:table-column/> + <table:table-column/> + <table:table-row> + <table:table-cell table:style-name="Table1.A1" office:value-type="string"> + <text:p>A1</text:p> + </table:table-cell> + <table:table-cell table:style-name="Table1.A1" office:value-type="string"> + <text:section text:name="Section1"> + <text:p>Section1: hide me</text:p> + </text:section> + <text:p>B1</text:p> + </table:table-cell> + </table:table-row> + <table:table-row> + <table:table-cell table:style-name="Table1.A1" office:value-type="string"> + <text:p>A2: this row suddenly jumps to the next page</text:p> + </table:table-cell> + <table:table-cell table:style-name="Table1.A1" office:value-type="string"> + <text:p>B2</text:p> + </table:table-cell> + </table:table-row> + </table:table> + </office:text> + </office:body> +</office:document> \ No newline at end of file diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx index 07c9c29d17ec..28522a2ef515 100644 --- a/sw/qa/extras/layout/layout2.cxx +++ b/sw/qa/extras/layout/layout2.cxx @@ -19,6 +19,7 @@ #include <unotools/syslocaleoptions.hxx> #include <editeng/unolingu.hxx> #include <o3tl/string_view.hxx> +#include <vcl/scheduler.hxx> #include <unotxdoc.hxx> #include <rootfrm.hxx> @@ -3043,6 +3044,30 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf166691) assertXPath(pXmlDoc, "//page", 1); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf166978) +{ + // Given a document with a table, which cell has a section: + createSwDoc("hideSection.fodt"); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + + // Hide the section + auto xTextSectionsSupplier = mxComponent.queryThrow<css::text::XTextSectionsSupplier>(); + auto xSections = xTextSectionsSupplier->getTextSections(); + CPPUNIT_ASSERT(xSections); + auto xSection = xSections->getByName(u"Section1"_ustr).queryThrow<css::beans::XPropertySet>(); + xSection->setPropertyValue(u"IsVisible"_ustr, css::uno::Any(false)); + Scheduler::ProcessEventsToIdle(); + + CPPUNIT_ASSERT_EQUAL(1, getPages()); // must not split the second row of the table to page 2 + // Check the layout dump; the whole table must be still on the first page + auto pXmlDoc = parseLayoutDump(); + assertXPath(pXmlDoc, "//page", 1); + assertXPath(pXmlDoc, "//page[1]/body/tab", 1); + assertXPath(pXmlDoc, "//page[1]/body/tab/row", 2); + assertXPathContent(pXmlDoc, "//page[1]/body/tab/row[2]/cell[1]/txt", + u"A2: this row suddenly jumps to the next page"_ustr); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx index fd5c74d1c3ec..be091389eaca 100644 --- a/sw/source/core/layout/sectfrm.cxx +++ b/sw/source/core/layout/sectfrm.cxx @@ -2329,7 +2329,7 @@ SwTwips SwSectionFrame::Grow_( SwTwips nDist, bool bTst ) SetCompletePaint(); InvalidatePage(); } - if( GetUpper() && GetUpper()->IsHeaderFrame() ) + if (GetUpper() && (GetUpper()->IsHeaderFrame() || GetUpper()->IsCellFrame())) GetUpper()->InvalidateSize(); } @@ -2748,13 +2748,6 @@ void SwSectionFrame::SwClientNotify(const SwModify& rMod, const SfxHint& rHint) { InvalidateAll(); InvalidateObjs(false); - { - // Set it to a huge positive value, to make sure a recalculation fires - constexpr SwTwips HUGE_POSITIVE = o3tl::toTwips(100, o3tl::Length::m); - SwFrameAreaDefinition::FrameAreaWriteAccess area(*this); - SwRectFnSet(this).SetHeight(area, HUGE_POSITIVE); - } - GetUpper()->InvalidateSize(); InvalidateFramesInSection(Lower()); Lower()->HideAndShowObjects(); // recursive diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index df07d117c374..076a0818d7be 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -1745,10 +1745,12 @@ void SwFrame::MakeValidZeroHeight() aRectFnSet.SetHeight(area, 0); } ShrinkFrame(aRectFnSet.GetHeight(getFrameArea())); - if (IsLayoutFrame()) // ShrinkFrame might do nothing! + if (IsLayoutFrame() && aRectFnSet.GetHeight(getFrameArea())) // ShrinkFrame might do nothing! { SwFrameAreaDefinition::FrameAreaWriteAccess area(*this); aRectFnSet.SetHeight(area, 0); + if (GetUpper()) + GetUpper()->InvalidateSize(); } setFrameAreaSizeValid(true); setFramePrintAreaValid(true); commit 0b1f177cde8fcd68ec35df1931596d559eec13e8 Author: Mike Kaganski <[email protected]> AuthorDate: Sun Jun 1 16:06:42 2025 +0500 Commit: Michael Stahl <[email protected]> CommitDate: Wed Oct 1 12:21:31 2025 +0200 tdf#166691: don't unhide sections temporarily to create their frames Commit 0c96119895b347f8eb5bb89f393351bd3c02b9f1 (tdf#159565 prerequisite: make hidden sections have zero-height frames, 2024-02-14) made hidden sections have frames. This removes the need to unhide them to get their frames, which happened in SwDocUpdateField::MakeFieldList_. Commit 6db63bb533a5c7436793eab86e83f92322b37044 (tdf#166210: invalidate parent's size when hiding section, 2025-04-28) started to invalidate the section frame's parent size on section hidden state change. This created a loop, where a calculation of the condition, that made a section hidden, caused the section to unhide then hide, invalidating parent frame; that caused repagination, and then another recalculation (because the number of pages may affect the conditions). This change drops the code in SwDocUpdateField::MakeFieldList_, that did the work to unhide then hide sections again, as obsolete. Change-Id: Ia144835548defaa38d53f03520ac0cc550bdfc23 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186108 Reviewed-by: Mike Kaganski <[email protected]> Tested-by: Jenkins (cherry picked from commit ca3e88728f29422ad9e4bd7f9bec08b59cdf4192) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186124 Reviewed-by: Xisco Fauli <[email protected]> (cherry picked from commit 65684ffbe89638407cc855e38838c5ae20cc38ee) diff --git a/sw/qa/extras/layout/data/table-with-hidden-section.fodt b/sw/qa/extras/layout/data/table-with-hidden-section.fodt new file mode 100644 index 000000000000..1360b872aef2 --- /dev/null +++ b/sw/qa/extras/layout/data/table-with-hidden-section.fodt @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:ooow="http://openoffice.org/2004/writer" office:version="1.4" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:font-face-decls> + <style:font-face style:name="Liberation Serif" svg:font-family="'Liberation Serif'" style:font-family-generic="roman" style:font-pitch="variable"/> + </office:font-face-decls> + <office:styles> + <style:default-style style:family="paragraph"> + <style:paragraph-properties fo:orphans="2" fo:widows="2" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:writing-mode="page"/> + <style:text-properties style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="zxx" fo:country="none" style:letter-kerning="true" fo:hyphenate="false"/> + </style:default-style> + <style:style style:name="Standard" style:family="paragraph" style:class="text"/> + </office:styles> + <office:automatic-styles> + <style:style style:name="Table1" style:family="table"> + <style:table-properties table:align="margins" style:may-break-between-rows="false"/> + </style:style> + <style:style style:name="Table1.1" style:family="table-row"> + <style:table-row-properties fo:keep-together="always"/> + </style:style> + <style:style style:name="Table1.A1" style:family="table-cell"> + <style:table-cell-properties fo:padding="1mm" fo:border="0.5pt solid #000000"/> + </style:style> + <style:page-layout style:name="pm1"> + <style:page-layout-properties fo:page-width="210mm" fo:page-height="297mm" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb"/> + </style:page-layout> + </office:automatic-styles> + <office:master-styles> + <style:master-page style:name="Standard" style:page-layout-name="pm1"/> + </office:master-styles> + <office:body> + <office:text> + <text:user-field-decls> + <text:user-field-decl office:value-type="float" office:value="1" text:name="MyVariable"/> + </text:user-field-decls> + <text:p>User variable used in section's hide condition: <text:user-field-get style:data-style-name="N0" text:name="MyVariable">1</text:user-field-get></text:p> + <text:p>He heard quiet steps behind him. That didn't bode well. Who could be following him this late at night and in this deadbeat part of town? And at this particular moment, just after he pulled off the big time and was making off with the greenbacks. Was there another crook who'd had the same idea, and was now watching him and waiting for a chance to grab the fruit of his labour? Or did the steps behind him mean that one of many law officers in town was on to him and just waiting to pounce and snap those cuffs on his wrists? He nervously looked all around. Suddenly he saw the alley. Like lightning he darted off to the left and disappeared between the two warehouses almost falling over the bin lying in the middle of the pavement. He tried to nervously tap his way along in the inky darkness and suddenly stiffened: it was a dead-end, he would have to go back the way he had come. The steps got louder and louder, he saw the black outline of a figure coming around the corn er. Is this the end of the line? he thought pressing himself back against the wall trying to make himself invisible in the dark, was all that planning and energy wasted? He was dripping with sweat now, cold and wet, he could smell the fear coming off his clothes. Suddenly next to him, with a barely noticeable squeak, a door swung quietly to and fro in the night's breeze. Could this be the haven he'd prayed for? Slowly he slid toward the door, pressing himself more and more into the wall, into the dark, away from his enemy. Would this door save his hide?</text:p> + <table:table table:name="Table1" table:style-name="Table1"> + <table:table-column/> + <table:table-row table:style-name="Table1.1"> + <table:table-cell table:style-name="Table1.A1" office:value-type="string"> + <text:p>Some text in the cell above the hidden section. The total height of the single table cell, when the inner section is unhidden, is tall enough to not fit to the first page; and since the table rows aren't allowed to split across pages, the whole table would move to page 2. But with the section hidden, the cell is short enough to fit to the first page, and must appear there immediately below the dummy text.</text:p> + <text:section text:name="Section1" text:condition="ooow:MyVariable" text:is-hidden="true" text:display="condition"> + <text:p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum consequat mi quis pretium semper. Proin luctus orci ac neque venenatis, quis commodo dolor posuere. Curabitur dignissim sapien quis cursus egestas. Donec blandit auctor arcu, nec pellentesque eros molestie eget. In consectetur aliquam hendrerit. Sed cursus mauris vitae ligula pellentesque, non pellentesque urna aliquet. Fusce placerat mauris enim, nec rutrum purus semper vel. Praesent tincidunt neque eu pellentesque pharetra. Fusce pellentesque est orci.</text:p> + <text:p>Integer sodales tincidunt tristique. Sed a metus posuere, adipiscing nunc et, viverra odio. Donec auctor molestie sem, sit amet tristique lectus hendrerit sed. Cras sodales nisl sed orci mattis iaculis. Nunc eget dolor accumsan, pharetra risus a, vestibulum mauris. Nunc vulputate lobortis mollis. Vivamus nec tellus faucibus, tempor magna nec, facilisis felis. Donec commodo enim a vehicula pellentesque. Nullam vehicula vestibulum est vel ultricies.</text:p> + <text:p>Aliquam velit massa, laoreet vel leo nec, volutpat facilisis eros. Donec consequat arcu ut diam tempor luctus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Praesent vitae lacus vel leo sodales pharetra a a nibh. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nam luctus tempus nibh, fringilla dictum augue consectetur eget. Curabitur at ante sit amet tortor pharetra molestie eu nec ante. Mauris tincidunt, nibh eu sollicitudin molestie, dolor sapien congue tortor, a pulvinar sapien turpis sed ante. Donec nec est elementum, euismod nulla in, mollis nunc.</text:p> + </text:section> + <text:p>Some text in the cell below the hidden section.</text:p> + <text:p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum consequat mi quis pretium semper. Proin luctus orci ac neque venenatis, quis commodo dolor posuere. Curabitur dignissim sapien quis cursus egestas. Donec blandit auctor arcu, nec pellentesque eros molestie eget. In consectetur aliquam hendrerit. Sed cursus mauris vitae ligula pellentesque, non pellentesque urna aliquet. Fusce placerat mauris enim, nec rutrum purus semper vel. Praesent tincidunt neque eu pellentesque pharetra. Fusce pellentesque est orci.</text:p> + <text:p>Integer sodales tincidunt tristique. Sed a metus posuere, adipiscing nunc et, viverra odio. Donec auctor molestie sem, sit amet tristique lectus hendrerit sed. Cras sodales nisl sed orci mattis iaculis. Nunc eget dolor accumsan, pharetra risus a, vestibulum mauris. Nunc vulputate lobortis mollis. Vivamus nec tellus faucibus, tempor magna nec, facilisis felis. Donec commodo enim a vehicula pellentesque. Nullam vehicula vestibulum est vel ultricies.</text:p> + <text:p>Aliquam velit massa, laoreet vel leo nec, volutpat facilisis eros. Donec consequat arcu ut diam tempor luctus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Praesent vitae lacus vel leo sodales pharetra a a nibh. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nam luctus tempus nibh, fringilla dictum augue consectetur eget. Curabitur at ante sit amet tortor pharetra molestie eu nec ante. Mauris tincidunt, nibh eu sollicitudin molestie, dolor sapien congue tortor, a pulvinar sapien turpis sed ante. Donec nec est elementum, euismod nulla in, mollis nunc.</text:p> + </table:table-cell> + </table:table-row> + </table:table> + </office:text> + </office:body> +</office:document> \ No newline at end of file diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx index 683c39c72d0a..07c9c29d17ec 100644 --- a/sw/qa/extras/layout/layout2.cxx +++ b/sw/qa/extras/layout/layout2.cxx @@ -3031,6 +3031,18 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf153136) // CPPUNIT_ASSERT_GREATER(large, height); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf166691) +{ + // Given a document with a table which disallows breaking across pages, and that has a cell + // with an inner section with hide condition (evaluated to true), such as to have the cell + // height enough to fit on page 1, when the section is hidden, but too tall when it's shown: + createSwDoc("table-with-hidden-section.fodt"); + auto pXmlDoc = parseLayoutDump(); + + // Check that there is only a single page + assertXPath(pXmlDoc, "//page", 1); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index c723ee162e3a..c1602cbe41d3 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -836,9 +836,6 @@ void SwDocUpdateField::MakeFieldList_( SwDoc& rDoc, int eGetMode ) // new version: walk all fields of the attribute pool m_pFieldSortList.reset(new SetGetExpFields); - // remember sections that were unhidden and need to be hidden again - std::vector<std::reference_wrapper<SwSection>> aUnhiddenSections; - // consider and unhide sections // with hide condition, only in mode GETFLD_ALL (<eGetMode == GETFLD_ALL>) // notes by OD: @@ -858,56 +855,19 @@ void SwDocUpdateField::MakeFieldList_( SwDoc& rDoc, int eGetMode ) // In order for the frames to be created the right way, they have to be expanded // from top to bottom std::vector<SwNodeOffset> aTmpArr; - std::vector<SwNodeOffset>::size_type nArrStt = 0; - SwSectionFormats& rArr = rDoc.GetSections(); - SwSectionNode* pSectNd = nullptr; - SwNodeOffset nSttContent = rDoc.GetNodes().GetEndOfExtras().GetIndex(); - - for (SwSectionFormats::size_type n = rArr.size(); n; ) + for (const auto& rFormat : rDoc.GetSections()) { - SwSection* pSect = rArr[ --n ]->GetSection(); + SwSection* pSect = rFormat->GetSection(); if( !pSect || !pSect->IsHidden() || pSect->GetCondition().isEmpty() ) continue; - pSectNd = pSect->GetFormat()->GetSectionNode(); - if( pSectNd ) + if (SwSectionNode* pSectNd = pSect->GetFormat()->GetSectionNode()) { SwNodeOffset nIdx = pSectNd->GetIndex(); aTmpArr.push_back( nIdx ); - if( nIdx < nSttContent ) - ++nArrStt; } } std::sort(aTmpArr.begin(), aTmpArr.end()); - // Display all first so that we have frames. The BodyAnchor is defined by that. - // First the ContentArea, then the special areas! - for (std::vector<sal_uLong>::size_type n = nArrStt; n < aTmpArr.size(); ++n) - { - pSectNd = rDoc.GetNodes()[ aTmpArr[ n ] ]->GetSectionNode(); - OSL_ENSURE( pSectNd, "Where is my SectionNode" ); - - auto& rSection = pSectNd->GetSection(); - // unhide and remember the conditionally hidden sections - if (rSection.IsHidden() && !rSection.GetCondition().isEmpty() && rSection.IsCondHidden()) - { - aUnhiddenSections.push_back(std::ref(rSection)); // remember to later hide again - rSection.SetCondHidden(false); - } - } - for (std::vector<sal_uLong>::size_type n = 0; n < nArrStt; ++n) - { - pSectNd = rDoc.GetNodes()[ aTmpArr[ n ] ]->GetSectionNode(); - OSL_ENSURE( pSectNd, "Where is my SectionNode" ); - - auto& rSection = pSectNd->GetSection(); - // unhide and remember the conditionally hidden sections - if (rSection.IsHidden() && !rSection.GetCondition().isEmpty() && rSection.IsCondHidden()) - { - aUnhiddenSections.push_back(std::ref(rSection)); // remember to later hide again - rSection.SetCondHidden(false); - } - } - // add all to the list so that they are sorted for (const auto &nId : aTmpArr) { @@ -1046,13 +1006,6 @@ void SwDocUpdateField::MakeFieldList_( SwDoc& rDoc, int eGetMode ) } m_nFieldListGetMode = eGetMode; m_nNodes = rDoc.GetNodes().Count(); - - // return the conditional hidden value back to the previous value - for (auto& rSectionWrapper : aUnhiddenSections) - { - auto& rSection = rSectionWrapper.get(); - rSection.SetCondHidden(true); - } } void SwDocUpdateField::GetBodyNode( const SwTextField& rTField, SwFieldIds nFieldWhich )
