Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package gpxsee for openSUSE:Factory checked 
in at 2021-10-26 20:13:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gpxsee (Old)
 and      /work/SRC/openSUSE:Factory/.gpxsee.new.1890 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "gpxsee"

Tue Oct 26 20:13:39 2021 rev:80 rq:927308 version:9.10

Changes:
--------
--- /work/SRC/openSUSE:Factory/gpxsee/gpxsee.changes    2021-10-16 
22:48:27.180733013 +0200
+++ /work/SRC/openSUSE:Factory/.gpxsee.new.1890/gpxsee.changes  2021-10-26 
20:14:00.458019754 +0200
@@ -1,0 +2,8 @@
+Mon Oct 25 12:35:14 CEST 2021 - tu...@cbox.cz
+
+- Update to version 9.10
+  * Added waypoint icons highlighting.
+  * Various GPI parser fixes/improvements (icons related).
+  * Added support for East Asian encodings in Garmin formats.
+
+-------------------------------------------------------------------

Old:
----
  GPXSee-9.9.tar.gz

New:
----
  GPXSee-9.10.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ gpxsee.spec ++++++
--- /var/tmp/diff_new_pack.FP2jnp/_old  2021-10-26 20:14:01.166020128 +0200
+++ /var/tmp/diff_new_pack.FP2jnp/_new  2021-10-26 20:14:01.170020130 +0200
@@ -19,7 +19,7 @@
 # See also http://en.opensuse.org/openSUSE:Specfile_guidelines
 
 Name:           gpxsee
-Version:        9.9
+Version:        9.10
 Release:        1
 Summary:        GPS log file visualization and analysis tool
 License:        GPL-3.0-only

++++++ GPXSee-9.9.tar.gz -> GPXSee-9.10.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/GPXSee-9.9/.appveyor.yml 
new/GPXSee-9.10/.appveyor.yml
--- old/GPXSee-9.9/.appveyor.yml        2021-10-15 19:27:45.000000000 +0200
+++ new/GPXSee-9.10/.appveyor.yml       2021-10-25 11:32:50.000000000 +0200
@@ -1,4 +1,4 @@
-version: 9.9.{build}
+version: 9.10.{build}
 
 configuration:
   - Release
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/GPXSee-9.9/gpxsee.pro new/GPXSee-9.10/gpxsee.pro
--- old/GPXSee-9.9/gpxsee.pro   2021-10-15 19:27:45.000000000 +0200
+++ new/GPXSee-9.10/gpxsee.pro  2021-10-25 11:32:50.000000000 +0200
@@ -3,7 +3,7 @@
 } else {
     TARGET = GPXSee
 }
-VERSION = 9.9
+VERSION = 9.10
 
 QT += core \
     gui \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/GPXSee-9.9/pkg/gpxsee.nsi 
new/GPXSee-9.10/pkg/gpxsee.nsi
--- old/GPXSee-9.9/pkg/gpxsee.nsi       2021-10-15 19:27:45.000000000 +0200
+++ new/GPXSee-9.10/pkg/gpxsee.nsi      2021-10-25 11:32:50.000000000 +0200
@@ -9,7 +9,7 @@
 ; The name of the installer
 Name "GPXSee"
 ; Program version
-!define VERSION "9.9"
+!define VERSION "9.10"
 
 ; The file to write
 OutFile "GPXSee-${VERSION}.exe"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/GPXSee-9.9/pkg/gpxsee64.nsi 
new/GPXSee-9.10/pkg/gpxsee64.nsi
--- old/GPXSee-9.9/pkg/gpxsee64.nsi     2021-10-15 19:27:45.000000000 +0200
+++ new/GPXSee-9.10/pkg/gpxsee64.nsi    2021-10-25 11:32:50.000000000 +0200
@@ -9,7 +9,7 @@
 ; The name of the installer
 Name "GPXSee"
 ; Program version
-!define VERSION "9.9"
+!define VERSION "9.10"
 
 ; The file to write
 OutFile "GPXSee-${VERSION}_x64.exe"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/GPXSee-9.9/src/GUI/waypointitem.cpp 
new/GPXSee-9.10/src/GUI/waypointitem.cpp
--- old/GPXSee-9.9/src/GUI/waypointitem.cpp     2021-10-15 19:27:45.000000000 
+0200
+++ new/GPXSee-9.10/src/GUI/waypointitem.cpp    2021-10-25 11:32:50.000000000 
+0200
@@ -104,8 +104,12 @@
                _labelBB = fm.tightBoundingRect(_waypoint.name());
 
                if (_showIcon && _icon) {
-                       p.addRect(-_icon->width()/2.0, -_icon->height(), 
_icon->width(),
-                         _icon->height());
+                       if (_font.bold())
+                               p.addRect(-_icon->width() * 0.625, 
-_icon->height() * 1.25,
+                                 _icon->width() * 1.25, _icon->height() * 
1.25);
+                       else
+                               p.addRect(-_icon->width()/2.0, 
-_icon->height(), _icon->width(),
+                                 _icon->height());
                        p.addRect(0, 0, _labelBB.width(), _labelBB.height() + 
fm.descent());
                } else {
                        p.addRect(-pointSize/2, -pointSize/2, pointSize, 
pointSize);
@@ -113,10 +117,14 @@
                          _labelBB.height() + fm.descent());
                }
        } else {
-               if (_showIcon && _icon)
-                       p.addRect(-_icon->width()/2, -_icon->height(), 
_icon->width(),
-                         _icon->height());
-               else
+               if (_showIcon && _icon) {
+                       if (_font.bold())
+                               p.addRect(-_icon->width() * 0.625, 
-_icon->height() * 1.25,
+                                 _icon->width() * 1.25, _icon->height() * 
1.25);
+                       else
+                               p.addRect(-_icon->width()/2, -_icon->height(), 
_icon->width(),
+                                 _icon->height());
+               } else
                        p.addRect(-pointSize/2, -pointSize/2, pointSize, 
pointSize);
        }
 
@@ -143,16 +151,19 @@
        }
 
        painter->setBrush(QBrush(_color, Qt::SolidPattern));
-       if (_showIcon && _icon)
-               painter->drawPixmap(-_icon->width()/2.0, -_icon->height(), 
*_icon);
-       else
+       if (_showIcon && _icon) {
+               if (_font.bold())
+                       painter->drawPixmap(-_icon->width() * 0.625, 
-_icon->height() * 1.25,
+                         _icon->scaled(_icon->width() * 1.25, _icon->height() 
* 1.25,
+                         Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
+               else
+                       painter->drawPixmap(-_icon->width()/2.0, 
-_icon->height(), *_icon);
+       } else
                painter->drawEllipse(-pointSize/2, -pointSize/2, pointSize, 
pointSize);
 
-/*
-       painter->setPen(Qt::red);
-       painter->setBrush(Qt::NoBrush);
-       painter->drawPath(_shape);
-*/
+       //painter->setPen(Qt::red);
+       //painter->setBrush(Qt::NoBrush);
+       //painter->drawPath(_shape);
 }
 
 void WaypointItem::setSize(int size)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/GPXSee-9.9/src/common/greatcircle.cpp 
new/GPXSee-9.10/src/common/greatcircle.cpp
--- old/GPXSee-9.9/src/common/greatcircle.cpp   2021-10-15 19:27:45.000000000 
+0200
+++ new/GPXSee-9.10/src/common/greatcircle.cpp  2021-10-25 11:32:50.000000000 
+0200
@@ -1,11 +1,41 @@
 #include "greatcircle.h"
 
+#define DELTA 1e-5
+
+static bool antipodes(const Coordinates &c1, const Coordinates &c2)
+{
+       return ((qAbs(c1.lat() + c2.lat()) < DELTA)
+         && (qAbs(180.0 - qAbs(c1.lon() - c2.lon())) < DELTA));
+}
+
 GreatCircle::GreatCircle(const Coordinates &c1, const Coordinates &c2)
 {
-       double lat1 = deg2rad(c1.lat());
-       double lon1 = deg2rad(c1.lon());
-       double lat2 = deg2rad(c2.lat());
-       double lon2 = deg2rad(c2.lon());
+       double lat1, lon1, lat2, lon2;
+
+       if (antipodes(c1, c2)) {
+               /* In case of antipodes (which would lead to garbage output 
without
+                  this hack), move the points DELTA degrees closer to each 
other in
+                  a way that the route never crosses the antimeridian. */
+               if (c1.lon() < c2.lon()) {
+                       lon1 = deg2rad(c1.lon() + DELTA);
+                       lon2 = deg2rad(c2.lon() - DELTA);
+               } else {
+                       lon1 = deg2rad(c1.lon() - DELTA);
+                       lon2 = deg2rad(c2.lon() + DELTA);
+               }
+               if (c1.lat() < c2.lat()) {
+                       lat1 = deg2rad(c1.lat() + DELTA);
+                       lat2 = deg2rad(c2.lat() - DELTA);
+               } else {
+                       lat1 = deg2rad(c1.lat() - DELTA);
+                       lat2 = deg2rad(c2.lat() + DELTA);
+               }
+       } else {
+               lat1 = deg2rad(c1.lat());
+               lon1 = deg2rad(c1.lon());
+               lat2 = deg2rad(c2.lat());
+               lon2 = deg2rad(c2.lon());
+       }
 
        double cosLat1 = cos(lat1);
        double cosLat2 = cos(lat2);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/GPXSee-9.9/src/common/textcodec.cpp 
new/GPXSee-9.10/src/common/textcodec.cpp
--- old/GPXSee-9.9/src/common/textcodec.cpp     2021-10-15 19:27:45.000000000 
+0200
+++ new/GPXSee-9.10/src/common/textcodec.cpp    2021-10-25 11:32:50.000000000 
+0200
@@ -1,6 +1,70 @@
-#include <QVector>
 #include "textcodec.h"
 
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+
+#include <QTextCodec>
+
+TextCodec::TextCodec()
+{
+       _codec = QTextCodec::codecForName("Windows-1252");
+}
+
+TextCodec::TextCodec(int codepage)
+{
+       switch (codepage) {
+               case 65001:
+                       _codec = 0;
+                       break;
+               case 932:
+                       _codec = QTextCodec::codecForName("Shift-JIS");
+                       break;
+               case 936:
+                       _codec = QTextCodec::codecForName("GB18030");
+                       break;
+               case 949:
+                       _codec = QTextCodec::codecForName("EUC-KR");
+                       break;
+               case 950:
+                       _codec = QTextCodec::codecForName("Big5");
+                       break;
+               case 1250:
+                       _codec = QTextCodec::codecForName("Windows-1250");
+                       break;
+               case 1251:
+                       _codec = QTextCodec::codecForName("Windows-1251");
+                       break;
+               case 1253:
+                       _codec = QTextCodec::codecForName("Windows-1253");
+                       break;
+               case 1254:
+                       _codec = QTextCodec::codecForName("Windows-1254");
+                       break;
+               case 1255:
+                       _codec = QTextCodec::codecForName("Windows-1255");
+                       break;
+               case 1256:
+                       _codec = QTextCodec::codecForName("Windows-1256");
+                       break;
+               case 1257:
+                       _codec = QTextCodec::codecForName("Windows-1257");
+                       break;
+               case 1258:
+                       _codec = QTextCodec::codecForName("Windows-1258");
+                       break;
+               default:
+                       _codec = QTextCodec::codecForName("Windows-1252");
+       }
+}
+
+QString TextCodec::toString(const QByteArray &ba) const
+{
+       return _codec ? _codec->toUnicode(ba) : QString::fromUtf8(ba);
+}
+
+#else // QT6
+
+#include <QVector>
+
 static const char32_t cp1250[] = {
        0x20AC, 0x0000, 0x201A, 0x0000, 0x201E, 0x2026, 0x2020, 0x2021,
        0x0000, 0x2030, 0x0160, 0x2039, 0x015A, 0x0164, 0x017D, 0x0179,
@@ -192,10 +256,7 @@
 
 QString TextCodec::toString(const QByteArray &ba) const
 {
-       if (_table)
-               return from8bCp(ba);
-       else
-               return QString::fromUtf8(ba);
+       return _table ? from8bCp(ba) : QString::fromUtf8(ba);
 }
 
 QString TextCodec::from8bCp(const QByteArray &ba) const
@@ -212,3 +273,4 @@
 
        return QString::fromUcs4(ucs4.constData(), ucs4.size());
 }
+#endif // QT6
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/GPXSee-9.9/src/common/textcodec.h 
new/GPXSee-9.10/src/common/textcodec.h
--- old/GPXSee-9.9/src/common/textcodec.h       2021-10-15 19:27:45.000000000 
+0200
+++ new/GPXSee-9.10/src/common/textcodec.h      2021-10-25 11:32:50.000000000 
+0200
@@ -3,6 +3,8 @@
 
 #include <QString>
 
+class QTextCodec;
+
 class TextCodec
 {
 public:
@@ -12,9 +14,12 @@
        QString toString(const QByteArray &ba) const;
 
 private:
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+       QTextCodec *_codec;
+#else // QT6
        QString from8bCp(const QByteArray &ba) const;
-
        const char32_t *_table;
+#endif // QT6
 };
 
 #endif // TEXTCODEC_H
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/GPXSee-9.9/src/data/gpiparser.cpp 
new/GPXSee-9.10/src/data/gpiparser.cpp
--- old/GPXSee-9.9/src/data/gpiparser.cpp       2021-10-15 19:27:45.000000000 
+0200
+++ new/GPXSee-9.10/src/data/gpiparser.cpp      2021-10-25 11:32:50.000000000 
+0200
@@ -537,7 +537,7 @@
        quint8 rs;
        quint32 ds;
        qint32 lat, lon;
-       quint16 s3, id;
+       quint16 s3, iconId = 0;
        QList<TranslatedString> obj;
 
        rs = stream.readRecordHeader(rh);
@@ -553,8 +553,7 @@
        while (stream.status() == QDataStream::Ok && ds < rh.size) {
                switch (stream.nextHeaderType()) {
                        case 4:
-                               ds += readIconId(stream, id);
-                               icons.append(QPair<int, 
quint16>(waypoints.size() - 1, id));
+                               ds += readIconId(stream, iconId);
                                break;
                        case 10:
                                ds += readDescription(stream, waypoints.last());
@@ -576,6 +575,8 @@
                }
        }
 
+       icons.append(QPair<int, quint16>(waypoints.size() - 1, iconId));
+
        if (ds != rh.size)
                stream.setStatus(QDataStream::ReadCorruptData);
 
@@ -659,11 +660,16 @@
                img.setColorTable(palette);
        } else
                img = QImage((uchar*)data.data(), width, height, lineSize,
-                 QImage::Format_RGB32);
+                 QImage::Format_RGBX8888).rgbSwapped();
        pixmap = QPixmap::fromImage(img);
 
-       if (ds != rh.size)
+       /* There should be no more data left in the record, but broken GPI files
+          generated by pinns.co.uk tools exist in the wild so we read out
+          the record as a workaround for such files. */
+       if (ds > rh.size)
                stream.setStatus(QDataStream::ReadCorruptData);
+       else if (ds < rh.size)
+               stream.skipRawData(rh.size - ds);
 
        return rs + rh.size;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/GPXSee-9.9/src/map/IMG/huffmanstream.h 
new/GPXSee-9.10/src/map/IMG/huffmanstream.h
--- old/GPXSee-9.9/src/map/IMG/huffmanstream.h  2021-10-15 19:27:45.000000000 
+0200
+++ new/GPXSee-9.10/src/map/IMG/huffmanstream.h 2021-10-25 11:32:50.000000000 
+0200
@@ -24,7 +24,7 @@
        }
 
        bool atEnd() const
-         {return _symbolDataSize + _bs.bitsAvailable() < 
_table.maxSymbolSize();}
+         {return _symbolDataSize + _bs.bitsAvailable() < _table.symBits();}
        bool flush() {return _bs.flush();}
 
 protected:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/GPXSee-9.9/src/map/IMG/huffmantable.cpp 
new/GPXSee-9.10/src/map/IMG/huffmantable.cpp
--- old/GPXSee-9.9/src/map/IMG/huffmantable.cpp 2021-10-15 19:27:45.000000000 
+0200
+++ new/GPXSee-9.10/src/map/IMG/huffmantable.cpp        2021-10-25 
11:32:50.000000000 +0200
@@ -8,8 +8,8 @@
 {
        quint32 val = 0;
 
-       for (quint32 i = bytes; i; i--)
-               val |= ((quint32)*(buffer + i)) << ((i-1) * 8);
+       for (quint32 i = 0; i < bytes; i++)
+               val |= ((quint32)*(buffer + i)) << (i * 8);
 
        return val;
 }
@@ -19,89 +19,83 @@
        if (!_buffer.load(rgn, rgnHdl))
                return false;
 
-       _s0 = (quint8)_buffer.at(0) & 0x0F;
-       _s1e = (quint8)_buffer.at(0) & 0x10;
-       _s2 = (quint8)_buffer.at(1);
-       _s3 = bs(_s2);
-       _s1d = (quint8)_buffer.at(2);
-       _s1f = (quint8)_buffer.at(3);
-       _s20 = bs(_s1f);
-       _s1 = _s20 + 1;
-       _s22 = vs(_buffer.at(4));
-       _s1c = _s3 + 1 + _s22;
-       _s14 = (quint8*)(_buffer.data()) + 4 + _s22;
-       _s10 = _s14 + _s1c * _s1d;
-       _s18 = _s10 + (_s1 << _s0);
+       _aclBits = (quint8)_buffer.at(0) & 0x0F;
+       _huffman = (quint8)_buffer.at(0) & 0x10;
+       _symBits = (quint8)_buffer.at(1);
+       _symBytes = bs(_symBits);
+       _bsrchEntries = (quint8)_buffer.at(2);
+       _symbolBits = (quint8)_buffer.at(3);
+       _symbolBytes = bs(_symbolBits);
+       _aclEntryBytes = _symbolBytes + 1;
+       _indexBytes = vs(_buffer.at(4));
+       _bsrchEntryBytes = _symBytes + _indexBytes + 1;
+       _bsrchTable = (const quint8*)(_buffer.constData()) + 4 + _indexBytes;
+       _aclTable = _bsrchTable + _bsrchEntryBytes * _bsrchEntries;
+       _huffmanTable = _aclTable + (_aclEntryBytes << _aclBits);
 
-       return true;
+       return (_symBits <= 32 && _symbolBits <= 32);
 }
 
 quint32 HuffmanTable::symbol(quint32 data, quint8 &size) const
 {
-       quint32 ss, sym;
-       quint8 *tp;
+       quint32 lo, hi;
+       const quint8 *tp;
 
 
-       if (_s0 == 0) {
-               sym = _s1d - 1;
-               ss = 0;
+       if (!_aclBits) {
+               hi = _bsrchEntries - 1;
+               lo = 0;
        } else {
-               quint32 offset = _s1 * (data >> (0x20U - _s0));
-               tp = _s10 + offset;
+               quint32 offset = _aclEntryBytes * (data >> (32 - _aclBits));
+               tp = _aclTable + offset;
 
-               if ((*tp & 1) != 0) {
-                       sym = readVUint32(tp, _s20);
+               if (*tp & 1) {
                        size = *tp >> 1;
-                       return sym;
+                       return readVUint32(tp + 1, _symbolBytes);;
                }
 
-               ss = *tp >> 1;
-               sym = tp[1];
+               lo = *tp >> 1;
+               hi = *(tp + 1);
        }
 
-       tp = ss * _s1c + _s14;
-       data = data >> (0x20U - _s2);
+       tp = _bsrchTable + (lo * _bsrchEntryBytes);
+       data >>= 32 - _symBits;
 
-       quint8 *prev = tp;
-       while (ss < sym) {
-               quint32 cnt = (ss + 1 + sym) >> 1;
-               tp = _s14 + (cnt * _s1c);
-               quint32 nd = readVUint32(tp - 1, _s3);
-
-               if (data <= nd) {
-                       if (data == nd)
-                               ss = cnt;
-                       else
-                               tp = prev;
-
-                       sym = cnt - (data < nd);
-                       cnt = ss;
+       while (lo < hi) {
+               const quint8 *prev = tp;
+               quint32 m = (lo + 1 + hi) >> 1;
+               tp = _bsrchTable + (m * _bsrchEntryBytes);
+               quint32 nd = readVUint32(tp, _symBytes);
+
+               if (data < nd) {
+                       tp = prev;
+                       hi = m - 1;
+               } else if (data > nd) {
+                       lo = m;
+               } else {
+                       lo = m;
+                       hi = m;
                }
-               ss = cnt;
-               prev = tp;
        }
 
-       sym = readVUint32(tp - 1, _s3);
-       tp = tp + _s3;
-       ss = readVUint32(tp, _s22);
+       quint32 i = readVUint32(tp, _symBytes);
+       tp = tp + _symBytes;
        size = *tp;
-       sym = (data - sym) >> (_s2 - *tp);
 
-       if (!_s1e)
-               sym = readVUint32(tp, _s20);
+       if (!_huffman)
+               return readVUint32(tp + 1, _symbolBytes);
        else {
-               sym = (sym + ss) * _s1f;
-               ss = sym >> 3;
-               sym = sym & 7;
-               quint32 shift = 8 - sym;
-               sym = *(_s18 + ss) >> sym;
-
-               if (shift < _s1f) {
-                       tp = _s18 + ss;
-                       ss = readVUint32(tp, ((_s1f + 7) - shift) >> 3);
-                       sym = (ss << shift) | sym;
-               }
+               quint32 bi = readVUint32(tp + 1, _indexBytes);
+               quint32 ci = (data - i) >> (_symBits - size);
+               quint32 si = (ci + bi) * _symbolBits;
+               quint32 sbi = si & 7;
+               quint32 shift = 8 - sbi;
+               tp = _huffmanTable + (si >> 3);
+
+               if (shift < _symbolBits) {
+                       quint32 val = readVUint32(tp + 1, bs(_symbolBits - 
shift));
+                       return (val << shift) | (*tp >> sbi);
+               } else
+                       return (*tp >> sbi);
        }
-
-       return sym;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/GPXSee-9.9/src/map/IMG/huffmantable.h 
new/GPXSee-9.10/src/map/IMG/huffmantable.h
--- old/GPXSee-9.9/src/map/IMG/huffmantable.h   2021-10-15 19:27:45.000000000 
+0200
+++ new/GPXSee-9.10/src/map/IMG/huffmantable.h  2021-10-25 11:32:50.000000000 
+0200
@@ -12,18 +12,19 @@
        HuffmanTable(quint8 id) : _buffer(id) {}
 
        bool load(const RGNFile *rgn, SubFile::Handle &rgnHdl);
-       quint8 maxSymbolSize() const {return _s2;}
-       quint32 symbol(quint32 data, quint8 &size) const;
 
+       quint32 symbol(quint32 data, quint8 &size) const;
        quint8 id() const {return _buffer.id();}
 
+       quint8 symBits() const {return _symBits;}
+       quint8 symbolBits() const {return _symbolBits;}
+
 private:
        HuffmanBuffer _buffer;
-       quint8 _s0, _s1, _s2, _s3;
-       quint8 *_s10, *_s14, *_s18;
-       quint8 _s1c, _s1d, _s1f, _s20;
-       quint16 _s22;
-       bool _s1e;
+       const quint8 *_aclTable, *_bsrchTable, *_huffmanTable;
+       quint8 _aclBits, _aclEntryBytes, _symBits, _symBytes, _indexBytes,
+         _bsrchEntryBytes, _bsrchEntries, _symbolBits, _symbolBytes;
+       bool _huffman;
 };
 
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/GPXSee-9.9/src/map/IMG/huffmantext.cpp 
new/GPXSee-9.10/src/map/IMG/huffmantext.cpp
--- old/GPXSee-9.9/src/map/IMG/huffmantext.cpp  2021-10-15 19:27:45.000000000 
+0200
+++ new/GPXSee-9.10/src/map/IMG/huffmantext.cpp 2021-10-25 11:32:50.000000000 
+0200
@@ -1,64 +1,30 @@
-#include "common/garmin.h"
 #include "subfile.h"
 #include "huffmantext.h"
 
-using namespace Garmin;
 using namespace IMG;
 
-static inline quint32 readVUint32(const quint8 *buffer, quint32 bytes)
-{
-       quint32 val = 0;
-
-       for (quint32 i = 0; i < bytes; i++)
-               val = val | (quint32)*(buffer - i) << ((bytes - i - 1) << 3);
-
-       return val;
-}
-
-bool HuffmanText::load(const RGNFile *rgn, SubFile::Handle &rgnHdl)
-{
-       if (!_buffer.load(rgn, rgnHdl))
-               return false;
-
-       quint8 *buffer = (quint8 *)_buffer.constData();
-       _b0 = buffer[0];
-       _b1 = buffer[1];
-       _b2 = buffer[2];
-       _b3 = buffer[3];
-       _vs = vs(buffer[4]);
-       _bs3 = bs(_b3);
-       _bs1 = bs(_b1);
-       _mul = _bs1 + 1 + _vs;
-       _bp1 = buffer + _vs + 4;
-       _bp2 = _bp1 + _mul * _b2;
-       _bp3 = _bp2 + ((_bs3 + 1) << (_b0 & 0xf));
-       _bp4 = _bp3 - 1;
-
-       return true;
-}
-
 bool HuffmanText::fetch(const SubFile *file, SubFile::Handle &hdl,
   quint32 &data, quint32 &bits, quint32 &usedBits, quint32 &usedData) const
 {
        quint32 rs, ls, old;
 
-       bits = _b1 - bits;
+       bits = _table.symBits() - bits;
 
        if (usedBits < bits) {
-               old = usedBits ? usedData >> (0x20 - usedBits) : 0;
+               old = usedBits ? usedData >> (32 - usedBits) : 0;
                if (!file->readVUInt32SW(hdl, 4, usedData))
                        return false;
                ls = bits - usedBits;
-               rs = 0x20 - (bits - usedBits);
+               rs = 32 - (bits - usedBits);
                old = usedData >> rs | old << ls;
        } else {
                ls = bits;
                rs = usedBits - bits;
-               old = usedData >> (0x20 - bits);
+               old = usedData >> (32 - bits);
        }
 
        usedData = usedData << ls;
-       data = data | old << (0x20 - _b1);
+       data = data | old << (32 - _table.symBits());
        usedBits = rs;
 
        return true;
@@ -71,101 +37,29 @@
        quint32 data = 0;
        quint32 usedBits = 0;
        quint32 usedData = 0;
-       quint32 ls = 8;
-       quint32 lo = _vs * 8 - 8;
-
 
        while (true) {
                if (!fetch(file, hdl, data, bits, usedBits, usedData))
                        return false;
 
-               quint32 off = (data >> (0x20 - (_b0 & 0xf))) * (_bs3 + 1);
-               quint32 sb = _bp2[off];
-               quint32 ss = 0;
-               quint32 sym = _b2 - 1;
-               quint32 size;
-
-               if ((_b0 & 0xf) == 0 || (sb & 1) == 0) {
-                       if ((_b0 & 0xf) != 0) {
-                               ss = sb >> 1;
-                               sym = _bp2[off + 1];
-                       }
-
-                       quint8 *tp = _bp1 + ss * _mul;
-                       quint32 sd = data >> (0x20 - _b1);
-                       while (ss < sym) {
-                               quint32 cnt = (sym + 1 + ss) >> 1;
-                               quint8 *prev = _bp1 + cnt * _mul;
-                               quint32 nd = readVUint32(prev + _bs1 - 1, _bs1);
-
-                               if (sd <= nd) {
-                                       sym = cnt - (sd < nd);
-                                       if (sd < nd) {
-                                               prev = tp;
-                                               cnt = ss;
-                                       }
-                               }
-                               tp = prev;
-                               ss = cnt;
-                       }
+               quint8 size;
+               quint32 sym = _table.symbol(data, size);
 
-                       quint32 o1 = readVUint32(tp + _bs1 - 1, _bs1);
-                       tp = tp + _bs1;
-                       quint32 o2 = readVUint32(tp + _vs, _vs);
-                       size = tp[0];
-                       quint32 os = (sd - o1) >> (_b1 - size);
-
-                       if ((_b0 & 0x10) == 0) {
-                               sym = readVUint32(_bp4 + (o2 + 1 + os) * _bs3, 
_bs3);
-                       } else {
-                               quint32 v = (os + o2) * _b3;
-                               quint32 idx = v >> 3;
-                               quint32 r = v & 7;
-                               quint32 shift = 8 - r;
-                               sym = _bp3[idx] >> r;
-                               if (shift < _b3) {
-                                       quint32 sz = bs(_b3 - shift);
-                                       quint32 val = readVUint32(_bp3 + idx + 
sz, sz);
-                                       sym = sym | val << shift;
-                               }
-                       }
-               } else {
-                       sym = readVUint32(_bp2 + off + _bs3, _bs3);
-                       size = (sb >> 1);
-               }
-
-               if (_b1 < size)
+               if (_table.symBits() < size)
                        return false;
                data = data << size;
-               bits = _b1 - size;
+               bits = _table.symBits() - size;
 
-               if ((_b3 & 7) == 0) {
-                       for (quint32 i = 0; i < (_b3 >> 3); i++) {
+               if (!(_table.symbolBits() & 7)) {
+                       for (quint32 i = 0; i < (_table.symbolBits() >> 3); 
i++) {
                                str.append((quint8)sym);
                                if (((quint8)sym == '\0'))
                                        return true;
                                sym = sym >> 8;
                        }
                } else {
-                       quint32 cnt = _b3;
-
-                       if (ls <= _b3) {
-                               do {
-                                       quint32 shift = ls;
-                                       lo = sym << (8 - shift) | 
(quint32)((quint8)lo >> shift);
-                                       sym = sym >> shift;
-                                       str.append((uchar)lo);
-                                       if (((uchar)lo == '\0'))
-                                               return true;
-                                       cnt = cnt - ls;
-                                       ls = 8;
-                               } while (7 < cnt);
-                               ls = 8;
-                       }
-                       if (cnt != 0) {
-                               lo = sym << (8 - cnt) | (quint32)((quint8)lo >> 
cnt);
-                               ls = ls - cnt;
-                       }
+                       Q_ASSERT(false);
+                       return false;
                }
        }
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/GPXSee-9.9/src/map/IMG/huffmantext.h 
new/GPXSee-9.10/src/map/IMG/huffmantext.h
--- old/GPXSee-9.9/src/map/IMG/huffmantext.h    2021-10-15 19:27:45.000000000 
+0200
+++ new/GPXSee-9.10/src/map/IMG/huffmantext.h   2021-10-25 11:32:50.000000000 
+0200
@@ -1,16 +1,17 @@
 #ifndef IMG_HUFFMANTEXT_H
 #define IMG_HUFFMANTEXT_H
 
-#include "huffmanbuffer.h"
+#include "huffmantable.h"
 
 namespace IMG {
 
 class HuffmanText
 {
 public:
-       HuffmanText() : _buffer(0) {}
+       HuffmanText() : _table(0) {}
 
-       bool load(const RGNFile *rgn, SubFile::Handle &rgnHdl);
+       bool load(const RGNFile *rgn, SubFile::Handle &rgnHdl)
+         {return _table.load(rgn, rgnHdl);}
        bool decode(const SubFile *file, SubFile::Handle &hdl,
          QVector<quint8> &str) const;
 
@@ -18,20 +19,7 @@
        bool fetch(const SubFile *file, SubFile::Handle &hdl, quint32 &data,
          quint32 &bits, quint32 &usedBits, quint32 &usedData) const;
 
-       HuffmanBuffer _buffer;
-
-       quint32 _b0;
-       quint32 _b1;
-       quint32 _b2;
-       quint32 _b3;
-       quint32 _vs;
-       quint32 _bs3;
-       quint32 _bs1;
-       quint32 _mul;
-       quint8 *_bp1;
-       quint8 *_bp2;
-       quint8 *_bp3;
-       quint8 *_bp4;
+       HuffmanTable _table;
 };
 
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/GPXSee-9.9/src/map/IMG/rastertile.cpp 
new/GPXSee-9.10/src/map/IMG/rastertile.cpp
--- old/GPXSee-9.9/src/map/IMG/rastertile.cpp   2021-10-15 19:27:45.000000000 
+0200
+++ new/GPXSee-9.10/src/map/IMG/rastertile.cpp  2021-10-25 11:32:50.000000000 
+0200
@@ -162,10 +162,12 @@
        drawPolygons(&painter);
        drawLines(&painter);
        drawTextItems(&painter, textItems);
-       //painter.setPen(Qt::red);
-       //painter.drawRect(QRect(_xy, _img.size()));
 
        qDeleteAll(textItems);
+
+       //painter.setPen(Qt::red);
+       //painter.setRenderHint(QPainter::Antialiasing, false);
+       //painter.drawRect(QRect(_xy, _pixmap.size()));
 }
 
 void RasterTile::ll2xy(QList<MapData::Poly> &polys)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/GPXSee-9.9/src/map/IMG/rgnfile.cpp 
new/GPXSee-9.10/src/map/IMG/rgnfile.cpp
--- old/GPXSee-9.9/src/map/IMG/rgnfile.cpp      2021-10-15 19:27:45.000000000 
+0200
+++ new/GPXSee-9.10/src/map/IMG/rgnfile.cpp     2021-10-25 11:32:50.000000000 
+0200
@@ -581,10 +581,9 @@
 
 bool RGNFile::subdivInit(Handle &hdl, SubDiv *subdiv) const
 {
-       SubDiv::Segment seg[5];
-       SubDiv::Segment extPoints, extLines, extPolygons;
+       SubDiv::Segment std[5], extPoints, extLines, extPolygons;
 
-       if (!segments(hdl, subdiv, seg))
+       if (!segments(hdl, subdiv, std))
                return false;
 
        if (subdiv->extPointsOffset() != subdiv->extPointsEnd()) {
@@ -609,8 +608,8 @@
                extLines = SubDiv::Segment(start, end);
        }
 
-       subdiv->init(seg[Point], seg[IndexedPoint], seg[Line], seg[Polygon],
-         seg[RoadReference], extPoints, extLines, extPolygons);
+       subdiv->init(std[Point], std[IndexedPoint], std[Line], std[Polygon],
+         std[RoadReference], extPoints, extLines, extPolygons);
 
        return true;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/GPXSee-9.9/src/map/IMG/subdiv.h 
new/GPXSee-9.10/src/map/IMG/subdiv.h
--- old/GPXSee-9.9/src/map/IMG/subdiv.h 2021-10-15 19:27:45.000000000 +0200
+++ new/GPXSee-9.10/src/map/IMG/subdiv.h        2021-10-25 11:32:50.000000000 
+0200
@@ -2,8 +2,6 @@
 #define IMG_SUBDIV_H
 
 #include <QtGlobal>
-#include "common/coordinates.h"
-#include "common/garmin.h"
 
 namespace IMG {
 

++++++ PKGBUILD ++++++
--- /var/tmp/diff_new_pack.FP2jnp/_old  2021-10-26 20:14:01.606020361 +0200
+++ /var/tmp/diff_new_pack.FP2jnp/_new  2021-10-26 20:14:01.610020363 +0200
@@ -1,5 +1,5 @@
 pkgname=gpxsee
-pkgver=9.9
+pkgver=9.10
 pkgrel=1
 pkgdesc='GPS log files visualizing and analyzing tool'
 arch=('i686' 'x86_64')

++++++ debian.changelog ++++++
--- /var/tmp/diff_new_pack.FP2jnp/_old  2021-10-26 20:14:01.642020380 +0200
+++ /var/tmp/diff_new_pack.FP2jnp/_new  2021-10-26 20:14:01.642020380 +0200
@@ -1,3 +1,11 @@
+gpxsee (9.10) stable; urgency=low
+
+  * Added waypoint icons highlighting.
+  * Various GPI parser fixes/improvements (icons related).
+  * Added support for East Asian encodings in Garmin formats.
+
+ -- Martin Tuma <tu...@cbox.cz>  Mon, 25 Oct 2021 12:40:48 +0200
+
 gpxsee (9.9) stable; urgency=medium
 
   * Fixed scroll wheel zooming on devices with "fine-resolution

++++++ gpxsee.dsc ++++++
--- /var/tmp/diff_new_pack.FP2jnp/_old  2021-10-26 20:14:01.714020417 +0200
+++ /var/tmp/diff_new_pack.FP2jnp/_new  2021-10-26 20:14:01.718020420 +0200
@@ -1,9 +1,9 @@
 Format: 1.0
 Source: gpxsee
-Version: 9.9-1
+Version: 9.10-1
 Binary: gpxsee
 Maintainer: Martin Tuma <tu...@cbox.cz>
 Architecture: any
 Build-Depends: debhelper (>= 9), qtbase5-dev, qtbase5-private-dev, 
qtbase5-dev-tools, qt5-qmake, qttools5-dev-tools, libqt5opengl5-dev
 Files:
- 00000000000000000000000000000000 0 GPXSee-9.9.tar.gz
+ 00000000000000000000000000000000 0 GPXSee-9.10.tar.gz

Reply via email to