From b95d6c1ac8a4bfe0f412f50e549941bc8795022f Mon Sep 17 00:00:00 2001 From: skv Date: Tue, 30 Aug 2016 16:53:57 +0300 Subject: [PATCH] 0023326: [CEA 1934] Error when extracting a shape --- src/GEOMImpl/GEOMImpl_ShapeDriver.cxx | 4 ++++ src/OperationGUI/OperationGUI_ExtractionDlg.cxx | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx b/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx index 436e2a927..b7947fdf7 100644 --- a/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx @@ -1015,6 +1015,10 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(LOGBOOK& log) const aShape = anExtractor.GetResult(); + if (aShape.IsNull()) { + Standard_ConstructionError::Raise("Result of extraction is empty"); + } + // Get statistics. const TopTools_ListOfShape &aRemoved = anExtractor.GetRemoved(); const TopTools_ListOfShape &aModified = anExtractor.GetModified(); diff --git a/src/OperationGUI/OperationGUI_ExtractionDlg.cxx b/src/OperationGUI/OperationGUI_ExtractionDlg.cxx index 1e4c61142..0eee97dc7 100644 --- a/src/OperationGUI/OperationGUI_ExtractionDlg.cxx +++ b/src/OperationGUI/OperationGUI_ExtractionDlg.cxx @@ -1298,12 +1298,18 @@ void OperationGUI_ExtractionDlg::eraseSubShape(const int theId) void OperationGUI_ExtractionDlg::eraseAll() { TColStd_MapIteratorOfMapOfInteger anIter(myMapDisplayedIDs); + TColStd_ListOfInteger aDisplayedIDs; for (; anIter.More(); anIter.Next()) { - eraseSubShape(anIter.Key()); + aDisplayedIDs.Append(anIter.Key()); + } + + TColStd_ListIteratorOfListOfInteger aListIter(aDisplayedIDs); + + for (; aListIter.More(); aListIter.Next()) { + eraseSubShape(aListIter.Value()); } - myMapDisplayedIDs.Clear(); getDisplayer()->UpdateViewer(); } -- 2.39.2