[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/filters/kword/msword-odf
From:       Inge Wallin <inge () lysator ! liu ! se>
Date:       2010-05-31 21:38:44
Message-ID: 20100531213844.7BA44AC8C6 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1133005 by ingwa:

Handle conversion of special MS characters.


 M  +18 -0     conversion.h  
 M  +7 -1      texthandler.cpp  


--- trunk/koffice/filters/kword/msword-odf/conversion.h #1133004:1133005
@@ -43,6 +43,24 @@
 
 namespace Conversion
 {
+    const int MS_SYMBOL_ENCODING[256] = {
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        32, 33, 8704, 35, 8707, 37, 38, 8715, 40, 41, 8727, 43, 44, 8722, 46, 47,
+        48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+        8773, 913, 914, 935, 916, 917, 934, 915, 919, 921, 977, 922, 923, 924, 925, 927,
+        928, 920, 929, 931, 932, 933, 962, 937, 926, 936, 918, 91, 8756, 93, 8869, 95,
+        8254, 945, 946, 967, 948, 949, 966, 947, 951, 953, 981, 954, 955, 956, 957, 959,
+        960, 952, 961, 963, 964, 965, 982, 969, 958, 968, 950, 123, 124, 125, 8764, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 978, 8242, 8804, 8725, 8734, 402, 9827, 9830, 9829, 9824, 8596, 8592, 8593, 8594, 8595,
+        176, 177, 8243, 8805, 215, 8733, 8706, 8729, 247, 8800, 8801, 8776, 8943, 0, 0, 8629,
+        0, 8465, 8476, 8472, 8855, 8853, 8709, 8745, 8746, 8835, 8839, 8836, 8834, 8838, 8712, 8713,
+        8736, 8711, 174, 169, 8482, 8719, 8730, 8901, 172, 8743, 8744, 8660, 8656, 8657, 8658, 8659,
+        9674, 9001, 0, 0, 0, 8721, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+        0, 9002, 8747, 8992, 0, 8993, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+    };
 // UString -> QString conversion. Use .string() to get the QString.
 // Always store the QString into a variable first, to avoid a deep copy.
 inline QString string(const wvWare::UString& str)
--- trunk/koffice/filters/kword/msword-odf/texthandler.cpp #1133004:1133005
@@ -1195,8 +1195,14 @@
                 // With bullets, text can only be one character, which
                 // tells us what kind of bullet to use
                 unsigned int code = text[0].unicode();
-                if ((code & 0xFF00) == 0xF000)   // see wv2
+                if ((code & 0xFF00) == 0xF000) {  // unicode: private use area (0xf000 - 0xf0ff)
+                    if (code >= 0x20) {
+                        // microsoft symbol charset shall apply here.
+                        code = Conversion::MS_SYMBOL_ENCODING[code%256];
+                    } else {
                     code &= 0x00FF;
+                    }
+                }
                 listStyleWriter.addAttribute("text:bullet-char", QString(code).toUtf8());
             } else
                 kWarning(30513) << "Bullet with more than one character, not supported";
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic