From 5b9c1b1d55ef1be08cc31a2f1a37dd47b968da5b Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 13 Aug 2022 19:27:47 +0300 Subject: [PATCH] Port changes from mainstream. --- src/libs/vdxf/libdxfrw/drw_base.h | 2 +- src/libs/vdxf/libdxfrw/libdxfrw.cpp | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/libs/vdxf/libdxfrw/drw_base.h b/src/libs/vdxf/libdxfrw/drw_base.h index 386a3b2b3..ce45f7559 100644 --- a/src/libs/vdxf/libdxfrw/drw_base.h +++ b/src/libs/vdxf/libdxfrw/drw_base.h @@ -167,7 +167,7 @@ BAD_READ_BLOCKS, /*!< error in block read process. */ BAD_READ_ENTITIES, /*!< error in entities read process. */ BAD_READ_OBJECTS, /*!< error in objects read process. */ BAD_READ_SECTION, /*!< error in sections read process. */ -BAD_CODE_PARSED, /*!< error in any parseCodes() method. */ +BAD_CODE_PARSED, /*!< error in any parseCodes() method. */ }; enum class DebugLevel { diff --git a/src/libs/vdxf/libdxfrw/libdxfrw.cpp b/src/libs/vdxf/libdxfrw/libdxfrw.cpp index 48cd65df0..1f0231c21 100644 --- a/src/libs/vdxf/libdxfrw/libdxfrw.cpp +++ b/src/libs/vdxf/libdxfrw/libdxfrw.cpp @@ -2494,7 +2494,6 @@ bool dxfRW::processViewport() { if (!vp.parseCode(code, reader)) { return setError( DRW::BAD_CODE_PARSED); } - break; } return setError(DRW::BAD_READ_ENTITIES); @@ -2684,11 +2683,10 @@ bool dxfRW::processPolyline() { nextentity = reader->getString(); DRW_DBG(nextentity); DRW_DBG("\n"); if (nextentity != "VERTEX") { - iface->addPolyline(pl); - return true; //found new entity or ENDSEC, terminate - } else { - processVertex(&pl); + iface->addPolyline(pl); + return true; //found new entity or ENDSEC, terminate } + processVertex(&pl); } if (!pl.parseCode(code, reader)) { //parseCode just initialize the members of pl @@ -2710,8 +2708,9 @@ bool dxfRW::processVertex(DRW_Polyline *pl) { nextentity = reader->getString(); DRW_DBG(nextentity); DRW_DBG("\n"); if (nextentity == "SEQEND") { - return true; //found SEQEND no more vertex, terminate - } else if (nextentity == "VERTEX"){ + return true; //found SEQEND no more vertex, terminate + } + if (nextentity == "VERTEX"){ v.reset(new DRW_Vertex()); //another vertex } }