From 3ec1db95c3cca73168cf3520aea2eccda877570b Mon Sep 17 00:00:00 2001 From: Kristian Duske Date: Sun, 17 Sep 2023 18:05:56 +0200 Subject: [PATCH 1/2] Don't crash trying to merge a group into an open group --- common/src/View/MapViewBase.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/common/src/View/MapViewBase.cpp b/common/src/View/MapViewBase.cpp index c7ad548ac3..0a10365084 100644 --- a/common/src/View/MapViewBase.cpp +++ b/common/src/View/MapViewBase.cpp @@ -1556,16 +1556,14 @@ Model::GroupNode* MapViewBase::findGroupToMergeGroupsInto( const auto hits = pickResult().all(type(Model::nodeHitType())); if (!hits.empty()) { - auto* mergeTarget = findOutermostClosedGroup(Model::hitToNode(hits.front())); - - const auto canReparentAll = std::all_of( - selectedNodes.nodes().begin(), selectedNodes.nodes().end(), [&](const auto* node) { - return node == mergeTarget || canReparentNode(node, mergeTarget); - }); - - if (canReparentAll) + if (auto* mergeTarget = findOutermostClosedGroup(Model::hitToNode(hits.front()))) { - return mergeTarget; + if (kdl::all_of(selectedNodes.nodes(), [&](const auto* node) { + return node == mergeTarget || canReparentNode(node, mergeTarget); + })) + { + return mergeTarget; + } } } From 814a76d9c13a8fc70ae4bdd786ef8118f3ae54fe Mon Sep 17 00:00:00 2001 From: Kristian Duske Date: Sun, 17 Sep 2023 21:25:44 +0200 Subject: [PATCH 2/2] Disable unreliable test on Win32 --- common/test/src/View/tst_CompilationRunner.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/test/src/View/tst_CompilationRunner.cpp b/common/test/src/View/tst_CompilationRunner.cpp index d65138ca0c..806765b780 100644 --- a/common/test/src/View/tst_CompilationRunner.cpp +++ b/common/test/src/View/tst_CompilationRunner.cpp @@ -162,8 +162,9 @@ TEST_CASE_METHOD( CHECK(exec.ended == !treatNonZeroResultCodeAsError); } -#if !defined(_WIN32) || defined(NDEBUG) +#if (defined(_WIN64) && defined(NDEBUG)) || !defined(_WIN32) // std::abort pops up a dialog when run in debug mode on Windows +// the test is unreliable on Windows 32bit TEST_CASE_METHOD(MapDocumentTest, "CompilationRunToolTaskRunner.toolAborts") { auto variables = EL::NullVariableStore{};