From 2553da38b4c33b626d10b976ca99676014fb4641 Mon Sep 17 00:00:00 2001 From: Roberto Fernandez Bautista Date: Fri, 3 Jun 2022 23:05:59 +0200 Subject: [PATCH] CADSTAR Schematic: Fix parsing of ATTRCOLORS. Apparently there can be a `INVISIBLE` token. Unclear what it means, but lets read it anyway (cherry picked from commit 41bf397d24fdad3f75d1a3cb460d497a2c242ae2) --- common/plugins/cadstar/cadstar_archive_parser.cpp | 4 ++++ common/plugins/cadstar/cadstar_archive_parser.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/common/plugins/cadstar/cadstar_archive_parser.cpp b/common/plugins/cadstar/cadstar_archive_parser.cpp index 1460c63089..2327c7cb23 100644 --- a/common/plugins/cadstar/cadstar_archive_parser.cpp +++ b/common/plugins/cadstar/cadstar_archive_parser.cpp @@ -2258,6 +2258,10 @@ void CADSTAR_ARCHIVE_PARSER::ATTRCOLORS::Parse( XNODE* aNode, PARSER_CONTEXT* aC attrcol.Parse( cNode, aContext ); AttributeColors.insert( { attrcol.AttributeID, attrcol } ); } + else if( cNodeName == wxT( "INVISIBLE" ) ) + { + IsVisible = false; + } else { THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, aNode->GetName() ); diff --git a/common/plugins/cadstar/cadstar_archive_parser.h b/common/plugins/cadstar/cadstar_archive_parser.h index 81a11be438..871f9efc1b 100644 --- a/common/plugins/cadstar/cadstar_archive_parser.h +++ b/common/plugins/cadstar/cadstar_archive_parser.h @@ -1253,6 +1253,8 @@ public: DFLTSETTINGS DefaultSettings; std::map AttributeColors; + bool IsVisible = true; // unclear what this represents - maybe all attributes are hidden? + void Parse( XNODE* aNode, PARSER_CONTEXT* aContext ) override; };