chore(cad-importer): remove dead code and cover named detector branch

- Drop CadImportResult.Document: no caller reads it after the
  migrations (BendDetectorRegistry runs inside CadImporter.Import
  itself, and downstream callers only consume the entity/bend data).
- Drop dead CadConverterForm.GetNextColor() helper: zero callers
  since GetDrawings stopped needing it.
- Drop stale 'using OpenNest.Properties;' and unused 'newItems'
  local in OnSplitClicked.
- Add Import_WhenNamedDetectorDoesNotExist_ReturnsEmptyBends to
  cover the previously untested named-detector branch in
  CadImporter.Import.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-10 14:13:44 -04:00
parent 87b965f895
commit 091e750e1b
4 changed files with 12 additions and 14 deletions
-6
View File
@@ -5,7 +5,6 @@ using OpenNest.Converters;
using OpenNest.Geometry;
using OpenNest.IO;
using OpenNest.IO.Bending;
using OpenNest.Properties;
using System;
using System.Collections.Generic;
using System.Drawing;
@@ -356,7 +355,6 @@ namespace OpenNest.Forms
: Path.GetTempPath();
var index = fileList.SelectedIndex;
var newItems = new List<string>();
var splitWriter = new SplitDxfWriter();
var splitItems = new List<FileListItem>();
@@ -369,7 +367,6 @@ namespace OpenNest.Forms
var splitPath = GetUniquePath(Path.Combine(writableDir, splitName));
splitWriter.Write(splitPath, splitDrawing);
newItems.Add(splitPath);
// Re-import geometry but keep bends from the split drawing
var result = Dxf.Import(splitPath);
@@ -750,9 +747,6 @@ namespace OpenNest.Forms
item.SuppressedEntityIds = null;
}
private static Color GetNextColor() => Drawing.GetNextColor();
private static bool IsDirectoryWritable(string path)
{
try