OSDN Git Service

remove code for always false condition
authorIvailo Monev <xakepa10@gmail.com>
Fri, 17 Sep 2021 21:35:16 +0000 (00:35 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Fri, 17 Sep 2021 21:35:16 +0000 (00:35 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/gui/text/qfontsubset.cpp
src/gui/text/qfontsubset_p.h

index 6c4af11..2d0c0f8 100644 (file)
@@ -200,53 +200,10 @@ static const struct UnicodeAglData {
     {0x03D5, 3212}, {0x03D6, 3217}, {0xFFFF, 3224}
 };
 
-// This map is used for symbol fonts to get the correct glyph names for the latin range
-static const unsigned short symbol_map[0x100] = {
-    0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007,
-    0x0008, 0x0009, 0x000a, 0x000b, 0x000c, 0x000d, 0x000e, 0x000f,
-    0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017,
-    0x0018, 0x0019, 0x001a, 0x001b, 0x001c, 0x001d, 0x001e, 0x001f,
-    0x0020, 0x0021, 0x2200, 0x0023, 0x2203, 0x0025, 0x0026, 0x220b,
-    0x0028, 0x0029, 0x2217, 0x002b, 0x002c, 0x2212, 0x002e, 0x002f,
-    0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
-    0x0038, 0x0039, 0x003a, 0x003b, 0x003c, 0x003d, 0x003e, 0x003f,
-
-    0x2245, 0x0391, 0x0392, 0x03a7, 0x0394, 0x0395, 0x03a6, 0x0393,
-    0x0397, 0x0399, 0x03d1, 0x039a, 0x039b, 0x039c, 0x039d, 0x039f,
-    0x03a0, 0x0398, 0x03a1, 0x03a3, 0x03a4, 0x03a5, 0x03c2, 0x03a9,
-    0x039e, 0x03a8, 0x0396, 0x005b, 0x2234, 0x005d, 0x22a5, 0x005f,
-    0xf8e5, 0x03b1, 0x03b2, 0x03c7, 0x03b4, 0x03b5, 0x03c6, 0x03b3,
-    0x03b7, 0x03b9, 0x03d5, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03bf,
-    0x03c0, 0x03b8, 0x03c1, 0x03c3, 0x03c4, 0x03c5, 0x03d6, 0x03c9,
-    0x03be, 0x03c8, 0x03b6, 0x007b, 0x007c, 0x007d, 0x223c, 0x007f,
-
-    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
-    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
-    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
-    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
-    0x20ac, 0x03d2, 0x2023, 0x2264, 0x2044, 0x221e, 0x0192, 0x2263,
-    0x2666, 0x2665, 0x2660, 0x2194, 0x2190, 0x2191, 0x2192, 0x2193,
-    0x00b0, 0x00b1, 0x2033, 0x2265, 0x00d7, 0x221d, 0x2202, 0x2022,
-    0x00f7, 0x2260, 0x2261, 0x2248, 0x2026, 0xf8e6, 0xf8e7, 0x21b5,
-
-    0x2135, 0x2111, 0x211c, 0x2118, 0x2297, 0x2295, 0x2205, 0x2229,
-    0x222a, 0x2283, 0x2287, 0x2284, 0x2282, 0x2286, 0x2208, 0x2209,
-    0x2220, 0x2207, 0xf6da, 0xf6d9, 0xf6db, 0x220f, 0x221a, 0x22c5,
-    0x00ac, 0x2227, 0x2228, 0x21d4, 0x21d0, 0x21d1, 0x21d2, 0x21d3,
-    0x25ca, 0x2329, 0xf8e8, 0xf8e9, 0xf8ea, 0x2211, 0xf8eb, 0xf8ec,
-    0xf8ed, 0xf8ee, 0xf8ef, 0xf8f0, 0xf8f1, 0xf8f2, 0xf8f3, 0xf8f4,
-    0x0000, 0x232a, 0x222b, 0x2320, 0xf8f5, 0x2321, 0xf8f6, 0xf8f7,
-    0xf8f8, 0xf8f9, 0xf8fa, 0xf8fb, 0xf8fc, 0xf8fd, 0xf8fe, 0x0000,
-};
-
 // ---------------------------- PS/PDF helper methods -----------------------------------
 
-QByteArray QFontSubset::glyphName(unsigned short unicode, bool symbol)
+QByteArray QFontSubset::glyphName(unsigned short unicode)
 {
-    if (symbol && unicode < 0x100)
-        // map from latin1 to symbol
-        unicode = symbol_map[unicode];
-
     int l = 0;
     while(unicode_to_aglindex[l].u < unicode)
         l++;
@@ -292,7 +249,7 @@ QByteArray QFontSubset::glyphName(unsigned int glyph, const QVector<int> reverse
     if (name[0]) {
         s << '/' << name;
     } else if (reverseMap[glyphIndex] && reverseMap[glyphIndex] < 0x10000) {
-        s << '/' << glyphName(reverseMap[glyphIndex], false);
+        s << '/' << glyphName(reverseMap[glyphIndex]);
     } else {
         s << "/gl" << (int)glyphIndex;
     }
index 5ed11ec..e4d46fd 100644 (file)
@@ -58,7 +58,7 @@ public:
     QVector<int> getReverseMap() const;
     QByteArray glyphName(unsigned int glyph, const QVector<int> reverseMap) const;
 
-    static QByteArray glyphName(unsigned short unicode, bool symbol);
+    static QByteArray glyphName(unsigned short unicode);
 
     int addGlyph(int index);
     const int object_id;