From 41bf397d24fdad3f75d1a3cb460d497a2c242ae2 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 --- 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 908909aa7a..3cf02b0bae 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 5fa81a3737..045add139a 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; };