diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2019-10-29 13:58:13 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2019-10-29 16:31:49 +0100 |
commit | e4ea1d08296755cb765e699325b895cac448e0df (patch) | |
tree | 0bbac9777f3624c452fd20bcb2ffcf1243725c45 /sw | |
parent | b2fe67eb74cfa124d654815eb7897380602a2b66 (diff) |
sw: makeMark(): check position of point fieldmarks
A new point fieldmark must have an empty range, which is expanded when
the CH_TXT_ATR_FORMELEMENT is inserted.
A copied point fieldmark must contain exactly its
CH_TXT_ATR_FORMELEMENT.
Change-Id: Iaf3cdad058539300199fe159d215b7aa37dae35d
Reviewed-on: https://gerrit.libreoffice.org/81672
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/docbm.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index 68914f38c0b3..b3d0470a3124 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -581,6 +581,18 @@ namespace sw { namespace mark return nullptr; } + if ((eType == MarkType::CHECKBOX_FIELDMARK || eType == MarkType::DROPDOWN_FIELDMARK) + && (eMode == InsertMode::New + ? *rPaM.GetPoint() != *rPaM.GetMark() + // CopyText: pam covers CH_TXT_ATR_FORMELEMENT + : (rPaM.GetPoint()->nNode != rPaM.GetMark()->nNode + || rPaM.Start()->nContent.GetIndex() + 1 != rPaM.End()->nContent.GetIndex()))) + { + SAL_WARN("sw.core", "MarkManager::makeMark(..)" + " - invalid range on point fieldmark"); + return nullptr; + } + // create mark std::unique_ptr<::sw::mark::MarkBase> pMark; switch(eType) |