sw/source/filter/ww8/rtfexport.cxx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
New commits: commit 08950492b9a9ce1abcf35c00ca48ccbbb1a29988 Author: Michael Stahl <michael.st...@cib.de> AuthorDate: Fri Nov 15 16:24:04 2019 +0100 Commit: Michael Stahl <michael.st...@cib.de> CommitDate: Mon Nov 18 13:31:11 2019 +0100 sw: RTF export: only enable \formprot if there is actually a section ... that is protected; Writer can also protect the content of text frames, which doesn't(?) appear to be possible in Word. Form protection has annoying side effects like disabling field UI for the whole document, even inside sections that are unprotected via \sectunlocked1. Change-Id: I2bf9503202779f5cb7c6e27ea7f533b2e3acb9d2 Reviewed-on: https://gerrit.libreoffice.org/82804 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@cib.de> (cherry picked from commit 87b9b9cbffd788c67b195e0ad54ca425ac259e0c) Reviewed-on: https://gerrit.libreoffice.org/82999 diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 9b98ce3bd4aa..787833bbac71 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -745,16 +745,12 @@ ErrCode RtfExport::ExportDocument_Impl() // enable it on a per-section basis. OTOH don't always enable it as it // breaks moving of drawings - so write it only in case there is really a // protected section in the document. + for (auto const& pSectionFormat : m_pDoc->GetSections()) { - const SfxItemPool& rPool = m_pDoc->GetAttrPool(); - for (const SfxPoolItem* pItem2 : rPool.GetItemSurrogates(RES_PROTECT)) + if (!pSectionFormat->IsInUndo() && pSectionFormat->GetProtect().IsContentProtected()) { - auto pProtect = dynamic_cast<const SvxProtectItem*>(pItem2); - if (pProtect && pProtect->IsContentProtected()) - { - Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_FORMPROT); - break; - } + Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_FORMPROT); + break; } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits