From cabcf4afe6a4988679d8e3a52ec18d802210fdba Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Mon, 21 Aug 2023 19:22:20 +0300 Subject: [PATCH] Altium: better message when importing unsupported format versions. Fixes https://gitlab.com/kicad/code/kicad/-/issues/15465 --- pcbnew/plugins/altium/altium_pcb.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pcbnew/plugins/altium/altium_pcb.cpp b/pcbnew/plugins/altium/altium_pcb.cpp index 198525c225..8484c01d96 100644 --- a/pcbnew/plugins/altium/altium_pcb.cpp +++ b/pcbnew/plugins/altium/altium_pcb.cpp @@ -450,6 +450,23 @@ void ALTIUM_PCB::Parse( const ALTIUM_COMPOUND_FILE& altiumPcbFi } } + const auto& boardDirectory = aFileMapping.find( ALTIUM_PCB_DIR::BOARD6 ); + + if( boardDirectory != aFileMapping.end() ) + { + std::vector mappedFile{ boardDirectory->second, "Data" }; + + const CFB::COMPOUND_FILE_ENTRY* file = altiumPcbFile.FindStream( mappedFile ); + + if( !file ) + { + THROW_IO_ERROR( _( + "This file does not appear to be in a valid PCB Binary Version 6.0 format. In " + "Altium Designer, " + "make sure to save as \"PCB Binary Files (*.PcbDoc)\"." ) ); + } + } + // Parse data in specified order for( const std::tuple& cur : parserOrder ) {