diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2022-06-09 14:23:11 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-06-09 15:48:59 +0200 |
commit | 51eb7b837996384d0155c0841bf69cf068bbe367 (patch) | |
tree | 472d4590933d819815c4851ff844c55526df146d /sw/qa | |
parent | 4308db47d950d6c1038968d22a9a9c453619eb4b (diff) |
sw content controls: fix crash on trying to insert nested dropdown
This went wrong in commit 3dd4f3691458ea537bc1867386269694775cfbcb (sw
content controls: add document model, 2022-03-30).
Change-Id: I8040e02975d1f98cc01ef6f8a22745f27afa5276
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135554
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/core/txtnode/txtnode.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sw/qa/core/txtnode/txtnode.cxx b/sw/qa/core/txtnode/txtnode.cxx index ed8759112ae1..ad44a12f7c9b 100644 --- a/sw/qa/core/txtnode/txtnode.cxx +++ b/sw/qa/core/txtnode/txtnode.cxx @@ -24,6 +24,7 @@ #include <wrtsh.hxx> #include <unotxdoc.hxx> #include <docsh.hxx> +#include <formatcontentcontrol.hxx> constexpr OUStringLiteral DATA_DIRECTORY = u"/sw/qa/core/txtnode/data/"; @@ -208,6 +209,17 @@ CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testSplitNodeSuperscriptCopy) CPPUNIT_ASSERT(!aSet.HasItem(RES_CHRATR_ESCAPEMENT)); } +CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testInsertDropDownContentControlTwice) +{ + // Given an already selected dropdown content control: + SwDoc* pDoc = createSwDoc(); + SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + pWrtShell->InsertContentControl(SwContentControlType::DROP_DOWN_LIST); + + // When trying to insert an inner one, make sure that we don't crash: + pWrtShell->InsertContentControl(SwContentControlType::DROP_DOWN_LIST); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |