[Libreoffice-commits] core.git: sw/source
Michael Stahl (via logerrit)
logerrit at kemper.freedesktop.org
Sat Nov 16 18:10:03 UTC 2019
sw/source/filter/ww8/rtfexport.cxx | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
New commits:
commit 87b9b9cbffd788c67b195e0ad54ca425ac259e0c
Author: Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Fri Nov 15 16:24:04 2019 +0100
Commit: Michael Stahl <michael.stahl at cib.de>
CommitDate: Sat Nov 16 19:09:15 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.stahl at cib.de>
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;
}
}
More information about the Libreoffice-commits
mailing list