From ae2ff99be8ff16bc79481bbb9e248835c75b7ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Wed, 22 Jan 2020 07:46:58 +0100 Subject: [PATCH] Do not fetch polygon labels as they are unused anyway --- src/map/IMG/rgnfile.cpp | 10 +++++----- src/map/IMG/rgnfile.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/map/IMG/rgnfile.cpp b/src/map/IMG/rgnfile.cpp index 5662a151..839668a0 100644 --- a/src/map/IMG/rgnfile.cpp +++ b/src/map/IMG/rgnfile.cpp @@ -118,7 +118,7 @@ bool RGNFile::init(Handle &hdl) bool RGNFile::polyObjects(const RectC &rect, Handle &hdl, const SubDiv *subdiv, const Segment &segment, LBLFile *lbl, Handle &lblHdl, NETFile *net, - Handle &netHdl, QList *polys) const + Handle &netHdl, QList *polys, bool line) const { if (!seek(hdl, segment.start())) return false; @@ -172,7 +172,7 @@ bool RGNFile::polyObjects(const RectC &rect, Handle &hdl, const SubDiv *subdiv, if (!rect.intersects(br)) continue; - if (lbl && (labelPtr & 0x3FFFFF)) { + if (line && lbl && (labelPtr & 0x3FFFFF)) { if (labelPtr & 0x800000) { quint32 lblOff; if (net && net->lblOffset(netHdl, labelPtr & 0x3FFFFF, lblOff) @@ -278,7 +278,7 @@ bool RGNFile::extPolyObjects(const RectC &rect, Handle &hdl, if (!rect.intersects(br)) continue; - if (lbl && (labelPtr & 0x3FFFFF)) + if (line && lbl && (labelPtr & 0x3FFFFF)) poly.label = lbl->label(lblHdl, labelPtr & 0x3FFFFF); polys->append(poly); @@ -409,12 +409,12 @@ void RGNFile::objects(const RectC &rect, const SubDiv *subdiv, case Segment::Line: if (lines) polyObjects(rect, rgnHdl, subdiv, segment, lbl, lblHdl, net, - netHdl, lines); + netHdl, lines, true); break; case Segment::Polygon: if (polygons) polyObjects(rect, rgnHdl, subdiv, segment, lbl, lblHdl, net, - netHdl, polygons); + netHdl, polygons, false); break; case Segment::RoadReference: break; diff --git a/src/map/IMG/rgnfile.h b/src/map/IMG/rgnfile.h index d1533a5b..0d8735c9 100644 --- a/src/map/IMG/rgnfile.h +++ b/src/map/IMG/rgnfile.h @@ -62,7 +62,7 @@ private: QVector segments(Handle &hdl, const SubDiv *subdiv) const; bool polyObjects(const RectC &rect, Handle &hdl, const SubDiv *subdiv, const Segment &segment, LBLFile *lbl, Handle &lblHdl, NETFile *net, - Handle &netHdl, QList *polys) const; + Handle &netHdl, QList *polys, bool line) const; bool pointObjects(const RectC &rect, Handle &hdl, const SubDiv *subdiv, const Segment &segment, LBLFile *lbl, Handle &lblHdl, QList *points) const;