summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/ww8par5.cxx
blob: 3692432d5f56eae8af4e4308a6c26b0d5a28fe80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
/*************************************************************************
 *
 *  $RCSfile: ww8par5.cxx,v $
 *
 *  $Revision: 1.3 $
 *
 *  last change: $Author: khz $ $Date: 2000-10-25 14:19:04 $
 *
 *  The Contents of this file are made available subject to the terms of
 *  either of the following licenses
 *
 *         - GNU Lesser General Public License Version 2.1
 *         - Sun Industry Standards Source License Version 1.1
 *
 *  Sun Microsystems Inc., October, 2000
 *
 *  GNU Lesser General Public License Version 2.1
 *  =============================================
 *  Copyright 2000 by Sun Microsystems, Inc.
 *  901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License version 2.1, as published by the Free Software Foundation.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *  MA  02111-1307  USA
 *
 *
 *  Sun Industry Standards Source License Version 1.1
 *  =================================================
 *  The contents of this file are subject to the Sun Industry Standards
 *  Source License Version 1.1 (the "License"); You may not use this file
 *  except in compliance with the License. You may obtain a copy of the
 *  License at http://www.openoffice.org/license.html.
 *
 *  Software provided under this License is provided on an "AS IS" basis,
 *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
 *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
 *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
 *  See the License for the specific provisions governing your rights and
 *  obligations concerning the Software.
 *
 *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
 *
 *  Copyright: 2000 by Sun Microsystems, Inc.
 *
 *  All Rights Reserved.
 *
 *  Contributor(s): _______________________________________
 *
 *
 ************************************************************************/

#ifdef PCH
#include "filt_pch.hxx"
#endif

#pragma hdrstop

#include <ctype.h>              // tolower
#include <stdio.h>              // sscanf()

#ifndef _HINTIDS_HXX
#include <hintids.hxx>
#endif

#ifndef SVTOOLS_URIHELPER_HXX
#include <svtools/urihelper.hxx>
#endif
#ifndef _UCBHELPER_CONTENT_HXX
#include <ucbhelper/content.hxx>
#endif
#include <tools/solar.h>
#ifndef _SVX_FONTITEM_HXX //autogen
#include <svx/fontitem.hxx>
#endif
#ifndef _SVX_FHGTITEM_HXX //autogen
#include <svx/fhgtitem.hxx>
#endif
#ifndef _URLOBJ_HXX //autogen
#include <tools/urlobj.hxx>
#endif
#ifndef _LINKMGR_HXX //autogen
#include <so3/linkmgr.hxx>
#endif

#ifndef _ZFORLIST_HXX
#include <svtools/zforlist.hxx>
#endif
#ifndef _SVX_LANGITEM_HXX //autogen
#include <svx/langitem.hxx>
#endif
#ifndef _UNOTOOLS_CHARCLASS_HXX
#include <unotools/charclass.hxx>
#endif

#ifndef _FMTFLD_HXX //autogen
#include <fmtfld.hxx>
#endif
#ifndef _FMTHBSH_HXX //autogen
#include <fmthbsh.hxx>
#endif
#ifndef _FMTANCHR_HXX //autogen
#include <fmtanchr.hxx>
#endif
#ifndef _PAM_HXX
#include <pam.hxx>              // fuer SwPam
#endif
#ifndef _DOC_HXX
#include <doc.hxx>
#endif
#ifndef _CHARATR_HXX
#include <charatr.hxx>          // class SwFmtFld
#endif
#ifndef _FLDDAT_HXX
#include <flddat.hxx>           // class SwDateTimeField
#endif
#ifndef _DOCUFLD_HXX
#include <docufld.hxx>          // class SwPageNumberField
#endif
#ifndef _REFFLD_HXX
#include <reffld.hxx>           // class SwGetRefField
#endif
#ifndef _BOOKMRK_HXX            // class SwBookmark
#include <bookmrk.hxx>
#endif
#ifndef _EXPFLD_HXX
#include <expfld.hxx>           // class SwSetExpField
#endif
#ifndef _DBFLD_HXX
#include <dbfld.hxx>            // class SwDBField
#endif
#ifndef _TOX_HXX
#include <tox.hxx>
#endif
#ifndef _FLTINI_HXX
#include <fltini.hxx>           // ReadFilterFlags
#endif
#ifndef _SECTION_HXX
#include <section.hxx>          // class SwSection
#endif
#ifndef _WW8SCAN_HXX
#include <ww8scan.hxx>          // WW8FieldDesc
#endif
#ifndef _FLTSHELL_HXX
#include <fltshell.hxx>         // fuer den Attribut Stack
#endif
#ifndef _WW8PAR_HXX
#include <ww8par.hxx>
#endif
#ifndef _NDTXT_HXX
#include <ndtxt.hxx>
#endif
#ifndef _FMTINFMT_HXX
#include <fmtinfmt.hxx>
#endif
#ifndef _CHPFLD_HXX
#include <chpfld.hxx>
#endif
#ifndef _FTNIDX_HXX
#include <ftnidx.hxx>
#endif
#ifndef _TXTFTN_HXX
#include <txtftn.hxx>
#endif
#ifndef _VIEWSH_HXX
#include <viewsh.hxx>
#endif
#ifndef _SHELLRES_HXX
#include <shellres.hxx>
#endif

#define WWF_INVISIBLE 86            // Bit-Nummer fuer Invisible ( IniFlags )
#define MAX_FIELDLEN 64000


using namespace ::com::sun::star;
using namespace ::com::sun::star::ucb;
using namespace ::com::sun::star::uno;
using namespace ::ucb;
using namespace ::rtl;

extern void sw3io_ConvertFromOldField( SwDoc& rDoc, USHORT& rWhich,
                                USHORT& rSubType, ULONG &rFmt,
                                USHORT nVersion );



class _ReadFieldParams
{
    String aData;
    xub_StrLen nLen, nFnd, nNext, nSavPtr;
//  sal_Unicode cLastChar;

public:
    _ReadFieldParams( const String& rData );
    ~_ReadFieldParams();

    xub_StrLen GoToTokenParam();
    long SkipToNextToken();
    xub_StrLen GetTokenSttPtr() const   { return nFnd;  }
    void SetNextPtr( xub_StrLen _nNext ) { nNext = _nNext; }

    xub_StrLen FindNextStringPiece( xub_StrLen _nStart = STRING_NOTFOUND );
    BOOL GetTokenSttFromTo(xub_StrLen* _pFrom, xub_StrLen* _pTo, xub_StrLen _nMax);

    String GetResult() const;
};


_ReadFieldParams::_ReadFieldParams( const String& _rData )
    : aData( _rData ), nLen( _rData.Len() ), nNext( 0 )
{
    /*
        erstmal nach einer oeffnenden Klammer oder einer Leerstelle oder einem
        Anfuehrungszeichen oder einem Backslash suchen, damit der Feldbefehl
        (also INCLUDEPICTURE bzw EINFUeGENGRAFIK bzw ...) ueberlesen wird
    */
    while( (nLen > nNext) && (aData.GetChar( nNext ) == ' ') )
        ++nNext;

    sal_Unicode c;
    while(     nLen > nNext
            && (c = aData.GetChar( nNext )) != ' '
            && c != '"'
            && c != '\\'
            && c != 132  )
        ++nNext;

    nFnd      = nNext;
    nSavPtr   = nNext;
//  cLastChar = aData.GetChar( nSavPtr );
}


_ReadFieldParams::~_ReadFieldParams()
{
//  aData.SetChar( nSavPtr, cLastChar );
}


String _ReadFieldParams::GetResult() const
{
    return    (STRING_NOTFOUND == nFnd)
            ? aEmptyStr
            : aData.Copy( nFnd, (nSavPtr - nFnd) );
}


xub_StrLen _ReadFieldParams::GoToTokenParam()
{
    xub_StrLen nOld = nNext;
    if( -2 == SkipToNextToken() )
        return GetTokenSttPtr();
    nNext = nOld;
    return STRING_NOTFOUND;
}

long _ReadFieldParams::SkipToNextToken() // ret: -2: NOT a '\' parameter but normal Text
{
    long nRet = -1;     // Ende
//  aData.SetChar( nSavPtr, cLastChar );
    if(    (STRING_NOTFOUND != nNext)
        && (nLen > nNext)
        && STRING_NOTFOUND != ( nFnd = FindNextStringPiece( nNext ) ))
    {
        nSavPtr = nNext;
//      cLastChar = aData.GetChar( nSavPtr );

        if(    '\\' == aData.GetChar( nFnd )
            && '\\' != aData.GetChar( nFnd + 1 ) ) // Options-Parameter gefunden
        {
            nRet = aData.GetChar( ++nFnd );
            nNext = ++nFnd;             // und dahinter setzen
        }
        else
        {
            nRet = -2;
            if(    (STRING_NOTFOUND != nSavPtr )
                && ('"' == aData.GetChar( nSavPtr - 1 )) )
            {
                nSavPtr--;
//              cLastChar = aData.GetChar( nSavPtr );
            }
//          aData.SetChar( nSavPtr, 0 );
        }
    }
    return nRet;
}

// FindNextPara sucht naechsten Backslash-Parameter oder naechste Zeichenkette
// bis zum Blank oder naechsten "\" oder zum schliessenden Anfuehrungszeichen
// oder zum String-Ende von pStr.
//
// Ausgabe ppNext (falls ppNext != 0) Suchbeginn fuer naechsten Parameter bzw. 0
//
// Returnwert: 0 falls String-Ende erreicht,
//             ansonsten Anfang des Paramters bzw. der Zeichenkette
//
xub_StrLen _ReadFieldParams::FindNextStringPiece(const xub_StrLen nStart)
{
    xub_StrLen  n = ( STRING_NOTFOUND == nStart ) ? nFnd : nStart;  // Anfang
    xub_StrLen n2;          // Ende

    nNext = STRING_NOTFOUND;        // Default fuer nicht gefunden

    while( (nLen > n) && (aData.GetChar( n ) == ' ') )
        ++n;

    if( nLen == n )
        return STRING_NOTFOUND;     // String End reached!

    if(     (aData.GetChar( n ) == '"')     // Anfuehrungszeichen vor Para?
        ||  (aData.GetChar( n ) == 132) )
    {
        n++;                        // Anfuehrungszeichen ueberlesen
        n2 = n;                     // ab hier nach Ende suchen
        while(     (nLen > n2)
                && (aData.GetChar( n2 ) != '"')
                && (aData.GetChar( n2 ) != 147) )
            n2++;                   // Ende d. Paras suchen
    }
    else                        // keine Anfuehrungszeichen
    {
        n2 = n;                     // ab hier nach Ende suchen
        while( (nLen > n2) && (aData.GetChar( n2 ) != ' ') ) // Ende d. Paras suchen
        {
            if( aData.GetChar( n2 ) == '\\' )
            {
                if( aData.GetChar( n2+1 ) == '\\' )
                    n2 += 2;        // Doppel-Backslash -> OK
                else
                {
                    if( n2 > n )
                        n2--;
                    break;          // einfach-Backslash -> Ende
                }
            }
            else
                n2++;               // kein Backslash -> OK
        }
    }
    if( nLen > n2 )
    {
        if(aData.GetChar( n2 ) != ' ') n2++;
        nNext = n2;
    }
    return n;
}



// read parameters "1-3" or 1-3 with both values between 1 and nMax
BOOL _ReadFieldParams::GetTokenSttFromTo(USHORT* pFrom, USHORT* pTo, USHORT nMax)
{
    USHORT nStart = 0;
    USHORT nEnd   = 0;
    xub_StrLen n = GoToTokenParam();
    if( STRING_NOTFOUND != n )
    {

        String sParams( GetResult() );

        xub_StrLen nIndex = 0;
        String sStart( sParams.GetToken(0, '-', nIndex) );
        if( STRING_NOTFOUND != nIndex )
        {
            nStart = sStart.ToInt32();
            nEnd   = sParams.Copy( nIndex ).ToInt32();
        }
    }
    if( pFrom ) *pFrom = nStart;
    if( pTo )   *pTo   = nEnd;

    return nStart && nEnd && (nMax >= nStart) && (nMax >= nEnd);
}




/*  */


//----------------------------------------
//    Initialisieren der Feld-FilterFlags
//----------------------------------------

void SwWW8ImplReader::Read_FieldIniFlags()
{
    USHORT i;
    nFieldFlags = ReadFilterFlags( "WWF" );
    if ( SwFltGetFlag( nFieldFlags, SwFltControlStack::HYPO ) ){
        SwFltSetFlag( nFieldFlags, SwFltControlStack::BOOK_TO_VAR_REF );
        SwFltSetFlag( nFieldFlags, SwFltControlStack::TAGS_DO_ID );
        SwFltSetFlag( nFieldFlags, SwFltControlStack::TAGS_IN_TEXT );
        SwFltSetFlag( nFieldFlags, SwFltControlStack::ALLOW_FLD_CR );
        for( i = 0; i < 3; i++ ){
            nFieldTagAlways[i] = 0;         // Hypo-Default: bekannte Felder
        }                                   // nicht taggen
        nFieldTagBad[0] = 0xffffffff;       // unbekannte Felder taggen
        nFieldTagBad[1] = 0xffffffff;       //
        nFieldTagBad[2] = 0xffffffef;       // "EinfuegenText" nicht taggen
    }else{
        nFieldTagAlways[0] = ReadFilterFlags( "WWFA0" );
        nFieldTagAlways[1] = ReadFilterFlags( "WWFA1" );
        nFieldTagAlways[2] = ReadFilterFlags( "WWFA2" );
        nFieldTagBad[0] = ReadFilterFlags( "WWFB0" );
        nFieldTagBad[1] = ReadFilterFlags( "WWFB1" );
        nFieldTagBad[2] = ReadFilterFlags( "WWFB2" );
    }
}

//----------------------------------------
//              Bookmarks
//----------------------------------------

long SwWW8ImplReader::Read_Book( WW8PLCFManResult* pRes, BOOL bStartAttr )
{
    if( !bStartAttr )
    {
        ASSERT( bStartAttr, "Read_Book::Nanu ?" );
        pEndStck->SetAttr( *pPaM->GetPoint(), RES_FLTR_BOOKMARK );
        return 0;
    }
    WW8PLCFx_Book* pB = pPlcxMan->GetBook();    // muesste auch ueber pRes.nCo2OrIdx gehen
    if( !pB ){
        ASSERT( pB, "WW8PLCFx_Book - Pointer nicht da" );
        return 0;
    }

    if( pB->GetIsEnd() ){
#if 0
        rDoc.Insert( *pPaM, 'E', CHARSET_ANSI );
#endif
        pEndStck->SetAttr( *pPaM->GetPoint(), RES_FLTR_BOOKMARK,
                           TRUE, pB->GetHandle() );
        return 0;
    }

    eBookStatus eB = pB->GetStatus();
    if( ( eB & BOOK_IGNORE ) != 0 )
        return 0;                               // Bookmark zu ignorieren
#if 0
        rDoc.Insert( *pPaM, 'A', CHARSET_ANSI );
#endif

    const String* pName = pB->GetName();
    if(    !pName
        || pName->EqualsIgnoreCaseAscii( "_Toc" ) ) // "_Toc*" ist ueberfluessig
        return 0;

//JP 16.11.98: ToUpper darf auf keinen Fall gemacht werden, weil der Bookmark-
//              name ein Hyperlink-Ziel sein kann!

    // Fuer UEbersetzung Bookmark -> Variable setzen
    long nLen = pB->GetLen();
    if( nLen > MAX_FIELDLEN )
        nLen = MAX_FIELDLEN;

    String sTxt;
    long nOldPos = pStrm->Tell();
    nLen = pSBase->WW8ReadString( *pStrm, sTxt, pB->GetStartPos(), nLen,
                                    eStructCharSet );

    pStrm->Seek( nOldPos );
    String aVal;
    QuoteString( aVal, sTxt );          // Nur druckbare Zeichen !
                                        // incl. Zeichensatz - UEbersetzung

    pEndStck->NewAttr( *pPaM->GetPoint(), SwFltBookmark( *pName, aVal,
                        pB->GetHandle(), ( eB & BOOK_ONLY_REF ) != 0 ) );
    return 0;
}

//----------------------------------------------------------------------
//    allgemeine Hilfsroutinen zum Auseinanderdroeseln der Parameter
//----------------------------------------------------------------------

// ConvertFFileName uebersetzt FeldParameter-Namen u. ae. in den
// System-Zeichensatz.
// Gleichzeitig werden doppelte Backslashes in einzelne uebersetzt.
void SwWW8ImplReader::ConvertFFileName( String& rName, const String& rOrg )
{
    rName = rOrg;
    rName.SearchAndReplaceAllAscii( "\\\\", String( '\\' ));

    // ggfs. anhaengende Anfuehrungszeichen entfernen
    if( rName.Len() &&  '"' == rName.GetChar( rName.Len()-1 ))
        rName.Erase( rName.Len()-1, 1);
}

// ConvertUFNneme uebersetzt FeldParameter-Namen u. ae. in den
// System-Zeichensatz und Upcased sie ( z.B. fuer Ref-Felder )
void SwWW8ImplReader::ConvertUFName( String& rName )
{
    GetAppCharClass().toUpper( rName );
}

void lcl_ConvertSequenceName( SwWW8ImplReader& rReader, String& rSequenceName )
{
    rReader.ConvertUFName( rSequenceName );
    if(    '0' <= rSequenceName.GetChar( 0 )
        && '9' >= rSequenceName.GetChar( 0 ) )
        rSequenceName.Insert('_', 0);
}
/*
// FindNextPara sucht Naechsten Parameter und setzt
// eine 0 hinter sein Ende ( im Original-String )!
// Bei Anfuehrungszeichen
// ( normal oder typographisch ) wird der ganze String genommen.
// Escape-Chars ( Backslash ) werden nicht beachtet.
// Rueckgabe: wenn ppNext != 0 dann Suchbeginn fuer naechsten Parameter
//            Return 0 fuer nicht gefunden oder Anfang des Paramters
static char* FindNextPara( char* pStr, char** ppNext = 0 )
{
    if( ppNext )
        *ppNext = 0;                // Default fuer nicht gefunden
    char* p = pStr;                 // Anfang
    char* p2;                       // Ende

    while( *p == ' ' )              // Spaces vor Para ueberlesen
        p++;
    if( !*p )
        return 0;
    if( *p == '"' || *(BYTE*)p == 132 ){    // Anfuehrungszeichen vor Para
        p++;                        // Anfuehrungszeichen ueberlesen
        p2 = p;                     // ab hier nach Ende suchen
        while( *p2 != '"' && *(BYTE*)p2 != 147 && *p2 != 0 )
            p2++;                   // Ende d. Paras suchen
    }else{                          // keine Anfuehrungszeichen
        p2 = p;                     // ab hier nach Ende suchen
        while( *p2 != ' ' && *p2 != 0 ){ // Ende d. Paras suchen
            if( *p2 == '\\' ){
                if( *(p2 + 1) == '\\' )
                    p2 += 2;        // Doppel-Backslash -> OK
                else
                    break;          // einfach-Backslash -> Ende
            }else{
                p2++;               // kein Backslash -> OK
            }
        }
    }
    *p2 = 0;                        // p ist jetzt String auf Para
    if( ppNext )
        *ppNext = p2 + 1;
    return p;
}

// FindNextPara2 funktioniert wie FindNextPara, jedoch wird beim
// Weglassen von Anfuehrungszeichen bis zum Backslash gesucht
// und nicht nur bis zum Space. Wird fuer Macro-AnzeigeTexte benutzt.
static char* FindNextPara2( char* pStr, char** ppNext = 0 )
{
    if( ppNext )
        *ppNext = 0;                // Default fuer nicht gefunden
                                    // #64447#
    char* p = pStr;                 // Anfang
    char* p2;                       // Ende

    while( *p == ' ' )              // Spaces vor Para ueberlesen
        p++;
    if( !*p )
        return 0;
    if( *p == '"' || *(BYTE*)p == 132 ){    // Anfuehrungszeichen vor Para
        p++;                        // Anfuehrungszeichen ueberlesen
        p2 = p;                     // ab hier nach Ende suchen
        while( *p2 != '"' && *(BYTE*)p2 != 147 && *p2 != 0 )
            p2++;                   // Ende d. Paras suchen
    }else{                          // keine Anfuehrungszeichen
        p2 = p;                     // ab hier nach Ende suchen
        while( *p2 != 0 && *p2 != '\\' )
            p2++;                   // Ende d. Paras suchen
    }
    *p2 = 0;                        // p ist jetzt String auf Para
    if( ppNext )
        *ppNext = p2 + 1;
    return p;
}

// Find1stPara sucht 1. Parameter und setzt
// eine 0 hinter sein Ende ( im Original-String )!
// Dabei wird das 2. Wort des Strings gesucht. Bei Anfuehrungszeichen
// ( normal oder typographisch ) wird der ganze String genommen.
// Escape-Chars ( Backslash ) werden nicht beachtet.
// Rueckgabe: wenn ppNext != 0 dann Suchbeginn fuer naechsten Parameter
//            Return 0 fuer nicht gefunden oder Anfang des Paramters
static char* Find1stPara( char* pStr, char** ppNext = 0 )
{
    // Anfang
    char* p = pStr;

    while( *p == ' ' )              // evtl. Spaces vor Feldtyp ueberlesen
        p++;
    while( *p != ' ' && *p != 0     // FeldTyp ueberlesen
           && *p != '"' && *(BYTE*)p != 132 )

        p++;

    // Ende
    char* p2 = pStr;

    while( *p == ' ' )              // Spaces vor Para ueberlesen
        p++;
    if( !*p )
        return 0;
    if( *p == '"' || *(BYTE*)p == 132 ){    // Anfuehrungszeichen vor Para
        p++;                        // Anfuehrungszeichen ueberlesen
        p2 = p;                     // ab hier nach Ende suchen
        while( *p2 != '"' && *(BYTE*)p2 != 147 && *p2 != 0 )
            p2++;                   // Ende d. Paras suchen
    }else{                          // keine Anfuehrungszeichen
        p2 = p;                     // ab hier nach Ende suchen
        while( *p2 != ' ' && *p2 != 0 )
            p2++;                   // Ende d. Paras suchen
    }
    *p2 = 0;                        // p ist jetzt String auf Para
    if( ppNext )
        *ppNext = p2 + 1;
    return p;
}
*/

// FindParaStart() finds 1st Parameter that follows '\' and cToken
// and returns start of this parameter or STRING_NOT_FOUND.
xub_StrLen FindParaStart( const String& rStr, sal_Unicode cToken, sal_Unicode cToken2 )
{
    BOOL bStr = FALSE;          // innerhalb String ignorieren

    for( xub_StrLen nBuf=0; nBuf+1 < rStr.Len(); nBuf++ )
    {
        if( rStr.GetChar( nBuf ) == '"' )
            bStr = !bStr;

        if(    !bStr
            && rStr.GetChar( nBuf ) == '\\'
            && (    rStr.GetChar( nBuf + 1 ) == cToken
                 || rStr.GetChar( nBuf + 1 ) == cToken2 ) )
        {
            nBuf += 2;
            // skip spaces between cToken and it's parameters
            while(    nBuf < rStr.Len()
                   && rStr.GetChar( nBuf ) == ' ' )
                nBuf++;
            return nBuf < rStr.Len() ? nBuf : STRING_NOTFOUND; // return start of parameters
        }
    }
    return STRING_NOTFOUND;
}

// FindPara() findet den ersten Parameter mit '\' und cToken. Es wird
// ein neuer String allokiert ( der vom Aufrufer deallokiert werden muss )
// und alles, was zum Parameter gehoert, wird in ihm zurueckgeliefert.
String FindPara( const String& rStr, sal_Unicode cToken, sal_Unicode cToken2 )
{
    xub_StrLen n2;                                          // Ende
    xub_StrLen n = FindParaStart( rStr, cToken, cToken2 );  // Anfang
    if( STRING_NOTFOUND == n )
        return aEmptyStr;

    if(    rStr.GetChar( n ) == '"'
        || rStr.GetChar( n ) == 132 )
    {                               // Anfuehrungszeichen vor Para
        n++;                        // Anfuehrungszeichen ueberlesen
        n2 = n;                     // ab hier nach Ende suchen
        while(     n2 < rStr.Len()
                && rStr.GetChar( n2 ) != 147
                && rStr.GetChar( n2 ) != '"' )
            n2++;                   // Ende d. Paras suchen
    }
    else
    {                           // keine Anfuehrungszeichen
        n2 = n;                     // ab hier nach Ende suchen
        while(     n2 < rStr.Len()
                && rStr.GetChar( n2 ) != ' ' )
            n2++;                   // Ende d. Paras suchen
    }
    return rStr.Copy( n, n2-n );
}


static SvxExtNumType GetNumTypeFromName( const String& rStr, BOOL bAllowPageDesc = FALSE )
{
    SvxExtNumType eTyp = bAllowPageDesc ? SVX_NUM_PAGEDESC : SVX_NUM_ARABIC;
    if( rStr.EqualsIgnoreCaseAscii( "Arabi", 0, 5 ) )  // Arabisch, Arabic
        eTyp = SVX_NUM_ARABIC;
    else if( rStr.EqualsIgnoreCaseAscii( "misch", 2, 5 ) )  // r"omisch
        eTyp = SVX_NUM_ROMAN_LOWER;
    else if( rStr.EqualsIgnoreCaseAscii( "MISCH", 2, 5 ) )  // R"OMISCH
        eTyp = SVX_NUM_ROMAN_UPPER;
    else if( rStr.EqualsIgnoreCaseAscii( "alphabeti", 0, 9 ) )// alphabetisch, alphabetic
        eTyp =  ( rStr.GetChar( 0 ) == 'A' )
                ? SVX_NUM_CHARS_UPPER_LETTER_N
                : SVX_NUM_CHARS_LOWER_LETTER_N;
    else if( rStr.EqualsIgnoreCaseAscii( "roman", 0, 5 ) )  // us
        eTyp =  ( rStr.GetChar( 0 ) == 'R' )
                ? SVX_NUM_ROMAN_UPPER
                : SVX_NUM_ROMAN_LOWER;
    return eTyp;
}


static SvxExtNumType GetNumberPara( String& rStr, BOOL bAllowPageDesc = FALSE )
{
    String s( FindPara( rStr, '*', '*' ) );     // Ziffernart
    SvxExtNumType aType = GetNumTypeFromName( s, bAllowPageDesc );
    return aType;
}


ULONG MSDateTimeFormatToSwFormat( String& rParams, SwDoc& rDoc, USHORT nLang )
{
    // get Doc Numberformatter
    SvNumberFormatter* pFormatter = rDoc.GetNumberFormatter();

    // tell the Formatter about the new entry
    UINT16 nCheckPos = 0;
    INT16  nType = NUMBERFORMAT_DEFINED;
    ULONG  nKey = 0;

//  if( !
    pFormatter->PutandConvertEntry(  rParams, nCheckPos, nType, nKey,
            nLang, LANGUAGE_SYSTEM )
;//)
//      nKey = 0;

    return nKey;
}

static short GetTimeDatePara( SwDoc& rDoc, String& rStr, ULONG& rFormat )
{
    String aParams( FindPara( rStr, '@', '@' ) );// Date/Time
    if( 0 == aParams.Len() )
    {                               // No Date / Time
        rFormat =  NF_DATE_SYS_NNNNDMMMMYYYY;
        return NUMBERFORMAT_DATE;
    }

    const SvxLanguageItem& rLang = (SvxLanguageItem&)(rDoc.GetAttrPool().
                    GetDefaultItem( RES_CHRATR_LANGUAGE ));

    ULONG nNumFmtIdx = MSDateTimeFormatToSwFormat( aParams, rDoc,
                                                    rLang.GetValue() );

    short nNumFmtType = NUMBERFORMAT_UNDEFINED;
    if( nNumFmtIdx )
    {
        SvNumberFormatter* pFormatter = rDoc.GetNumberFormatter();
        nNumFmtType = pFormatter->GetType( nNumFmtIdx );
    }
    rFormat = nNumFmtIdx;

    return nNumFmtType;

}



//-----------------------------------------
//              Felder
//-----------------------------------------
// Am Ende des Einlesens entsprechende Felder updaten ( z.Zt. die Referenzen )
void SwWW8ImplReader::UpdateFields()
{
//  rDoc.GetSysFldType( RES_GETREFFLD )->UpdateFlds();  // Referenzen
//  rDoc.UpdateFlds();                                  // SetExp-Fields
//  rDoc.UpdateFlds();              // alles ???
//  rDoc.UpdateExpFlds();                               // SetExp-Fields
    rDoc.SetUpdateExpFldStat();                 // JP: neu fuer alles wichtige
    rDoc.SetInitDBFields( TRUE );               // Datenbank-Felder auch
}

typedef eF_ResT (SwWW8ImplReader:: *FNReadField)( WW8FieldDesc*, String& );
static FNReadField aWW8FieldTab[93] = {
0,
0,
0,
&SwWW8ImplReader::Read_F_Ref,               // 3
0,
0,
&SwWW8ImplReader::Read_F_Set,               // 6
0,
&SwWW8ImplReader::Read_F_Tox,               // 8
0,
0,
0,
&SwWW8ImplReader::Read_F_Seq,               // 12
&SwWW8ImplReader::Read_F_Tox,               // 13
&SwWW8ImplReader::Read_F_DocInfo,           // 14
&SwWW8ImplReader::Read_F_DocInfo,           // 15
&SwWW8ImplReader::Read_F_DocInfo,           // 16
&SwWW8ImplReader::Read_F_Author,            // 17
&SwWW8ImplReader::Read_F_DocInfo,           // 18
&SwWW8ImplReader::Read_F_DocInfo,           // 19
&SwWW8ImplReader::Read_F_DocInfo,           // 20
&SwWW8ImplReader::Read_F_DocInfo,           // 21
&SwWW8ImplReader::Read_F_DocInfo,           // 22
&SwWW8ImplReader::Read_F_DocInfo,           // 23
&SwWW8ImplReader::Read_F_DocInfo,           // 24
&SwWW8ImplReader::Read_F_DocInfo,           // 25
&SwWW8ImplReader::Read_F_Anz,               // 26
&SwWW8ImplReader::Read_F_Anz,               // 27
&SwWW8ImplReader::Read_F_Anz,               // 28
&SwWW8ImplReader::Read_F_FileName,          // 29
&SwWW8ImplReader::Read_F_TemplName,         // 30
&SwWW8ImplReader::Read_F_DateTime,          // 31
&SwWW8ImplReader::Read_F_DateTime,          // 32
&SwWW8ImplReader::Read_F_CurPage,           // 33
0,
0,
0,
&SwWW8ImplReader::Read_F_PgRef,             // 37
&SwWW8ImplReader::Read_F_InputVar,          // 38
&SwWW8ImplReader::Read_F_Input,             // 39
0,
&SwWW8ImplReader::Read_F_DBNext,            // 41
0,
0,
&SwWW8ImplReader::Read_F_DBNum,             // 44
0,
0,
0,
0,
0,
0,
&SwWW8ImplReader::Read_F_Macro,             // 51
&SwWW8ImplReader::Read_F_ANumber,           // 52
&SwWW8ImplReader::Read_F_ANumber,           // 53
&SwWW8ImplReader::Read_F_ANumber,           // 54
0,


0,      // 56: VERKNUePFUNG     // fehlt noch !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


&SwWW8ImplReader::Read_F_Symbol,            // 57
&SwWW8ImplReader::Read_F_Embedd,            // 58
&SwWW8ImplReader::Read_F_DBField,           // 59
0,
0,
0,
0,
0,
0,
0,
&SwWW8ImplReader::Read_F_IncludePicture,    // 67
&SwWW8ImplReader::Read_F_IncludeText,       // 68
0,
&SwWW8ImplReader::Read_F_FormTextBox,       // 70
&SwWW8ImplReader::Read_F_FormCheckBox,      // 71
&SwWW8ImplReader::Read_F_NoteReference,     // 72
0, /*&SwWW8ImplReader::Read_F_Tox*/
0,
0,
0,
0,
0,
0,
0,
0,
0,
&SwWW8ImplReader::Read_F_FormListBox,       // 83
0,                                          // 84
&SwWW8ImplReader::Read_F_DocInfo,           // 85
0,                                          // 86
&SwWW8ImplReader::Read_F_OCX,               // 87
&SwWW8ImplReader::Read_F_Hyperlink,         // 88
0,                                          // 89
0,                                          // 90
0,                                          // 91
0                                           // 92 - Dummy leer Methode
 };                                         // 92   == alle ueber 91



// Read_Field liest ein Feld ein oder, wenn es nicht gelesen werden kann,
// wird 0 zurueckgegeben, so dass das Feld vom Aufrufer textuell gelesen wird.
// Returnwert: Gesamtlaenge des Feldes ( zum UEberlesen )
long SwWW8ImplReader::Read_Field( WW8PLCFManResult* pRes, BOOL )
{
    ASSERT( ( sizeof( aWW8FieldTab ) / sizeof( *aWW8FieldTab ) == 93 ),
            "FeldFunc-Tabelle stimmt nicht" );
    if( nIniFlags & WW8FL_NO_FLD )
        return 0;

    WW8FieldDesc aF;

    WW8PLCFx_FLD* pF = pPlcxMan->GetFld();
    ASSERT( pF, "WW8PLCFx_FLD - Pointer nicht da" );
    if( !pF ) return 0;

    BOOL bOk = pF->GetPara( pRes->nCp2OrIdx, aF );

    USHORT n = ( aF.nId <= 91 ) ? aF.nId : 92; // alle > 91 werden 92
    USHORT nI = n / 32;                     // # des UINT32
    ULONG nMask = 1 << ( n % 32 );          // Maske fuer Bits

    if( nFieldTagAlways[nI] & nMask )       // Flag: Tag it
        return Read_F_Tag( &aF );           // Resultat nicht als Text

    if( !bOk || !aF.nId )                   // Feld kaputt
        return aF.nLen;                     // -> ignorieren

    if( aF.nId > 91
//      || ( aF.nOpt & 0x40 )               // 0x40-Result Nest -> OK
                             )              // WW: Nested Field
        if( nFieldTagBad[nI] & nMask )      // Flag: Tag it when bad
            return Read_F_Tag( &aF );       // Resultat nicht als Text
        else
            return aF.nLen;

    if( aWW8FieldTab[aF.nId] == 0           // keine Routine vorhanden
        || aF.bCodeNest )
    {
        if( nFieldTagBad[nI] & nMask )      // Flag: Tag it when bad
            return Read_F_Tag( &aF );       // Resultat nicht als Text
                                            // Lese nur Resultat
        if( aF.bResNest )
            return aF.nLen;                 // Result nested -> nicht brauchbar

        return aF.nLen - aF.nLRes - 1;  // so viele ueberlesen, das Resultfeld
                                        // wird wie Haupttext eingelesen

    }
    else
    {                                   // Lies Feld
        long nOldPos = pStrm->Tell();
        String aStr;
        aF.nLCode = pSBase->WW8ReadString( *pStrm, aStr, pPlcxMan->GetCpOfs()+
                                            aF.nSCode, aF.nLCode, eTextCharSet );

        eF_ResT eRes = (this->*aWW8FieldTab[aF.nId])( &aF, aStr );
        pStrm->Seek( nOldPos );

        switch ( eRes )
        {
        case F_OK:
                    return aF.nLen;                     // alles OK

        case F_TEXT:
                    return aF.nLen - aF.nLRes - 2;      // so viele ueberlesen,
                            // das Resultfeld wird wie Haupttext eingelesen
                            //JP 15.07.99: attributes can start at char 0x14
                            // so skip one char more back == "-2"

        case F_TAGTXT:
                    if(  ( nFieldTagBad[nI] & nMask ) ) // Flag: Tag bad
                        return Read_F_Tag( &aF );       // Taggen
                    return aF.nLen - aF.nLRes - 2;  // oder Text-Resultat

        case F_TAGIGN:
                    if(  ( nFieldTagBad[nI] & nMask ) ) // Flag: Tag bad
                        return Read_F_Tag( &aF );       // Taggen
                    return aF.nLen;                 // oder ignorieren

        case F_READ_FSPA:
                return aF.nLen - aF.nLRes - 2; // auf Char 1 positionieren

        default:    return aF.nLen;                     // ignorieren
        }
    }
/*
    if( !bOk || !aF.nId  || aF.nId > 84
        || ( aF.nOpt & 0x40 ) )             // WW sagt: Nested Field
        return aF.nLen;


    if( ( ( aF.nOpt & 0x08 ) )              // User Edited
        || aF.nId > 84                      // unbekannte Id
        || aWW8FieldTab[aF.nId] == 0            // keine Routine vorhanden
        || aF.bCodeNest ){


                                            // Lese nur Resultat
        if( aF.bResNest )
            return aF.nLen;                 // Result nested -> nicht brauchbar
        else
            return aF.nLen - aF.nLRes - 1;  // so viele ueberlesen, das Resultfeld
                                            // wird wie Haupttext eingelesen

    }else{                                  // Lese Feld
        long nOldPos = pStrm->Tell();
        pStrm->Seek( WW8Cp2Fc( pPlcxMan->GetCpOfs() + aF.nSCode,
                            pWwFib->fcMin ) );
        char* p = new char[ aF.nLCode + 10 ];
        pStrm->Read( p, aF.nLCode );
        for( long i=aF.nLCode; i < aF.nLCode + 10; i++ )
            p[i] = 0;                   // Nullen dahinter
        (this->*aWW8FieldTab[aF.nId])( &aF, p );
        delete[] p;
        pStrm->Seek( nOldPos );
    }
    return aF.nLen;
*/
}

//-----------------------------------------
//        Felder Taggen
//-----------------------------------------

// QuoteChar ist ohne Laengenschutz

void SwWW8ImplReader::QuoteChar( String& rStr, const sal_Unicode c, BOOL bAllowCr )
{
    if ( c < 0x0020 || c == 0x00fe || c == 0x00ff )  // < 32, >0xfe
    {
        switch( c )
        {
        case 0x0b:
        case 0x0c:
        case 0x0d: if(  bAllowCr )
                   {
                     rStr += '\n';
                     break;
                   }
                    // no break
        default:{
                    // als Hex-Zahl mit \x  davor
                    String sTmp( String::CreateFromInt32( c, 16 ) );
                    if( 1 == sTmp.Len() )
                        sTmp.Insert( '0', 0 );
                    rStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "\\x" ) );
                    rStr += sTmp;
                }
        }
    }
    else
        rStr += c;                  // normaler Text
}

// QuoteString() wandelt CRs abhaengig von nFieldIniFlags in '\n' oder "\0x0d"
void SwWW8ImplReader::QuoteString( String& rStr, const String& rOrg )
{
    BOOL bAllowCr = SwFltGetFlag( nFieldFlags, SwFltControlStack::ALLOW_FLD_CR );
    xub_StrLen nMax = rOrg.Len();
    xub_StrLen i = 0;
    while( nMax > i && ( rStr.Len() < MAX_FIELDLEN - 4 ) )
    {
        QuoteChar( rStr, rOrg.GetChar( i ), bAllowCr );
        i++;
    }
}

// MakeTagString() gibt als Returnwert die Position des ersten
// CR / Zeilenende / Seitenumbruch in pText und wandelt auch nur bis dort
// Wenn keins dieser Sonderzeichen enthalten ist, wird 0 zurueckgeliefert.
void SwWW8ImplReader::MakeTagString( String& rStr, const String& rOrg )
{
    BOOL bAllowCr = SwFltGetFlag( nFieldFlags, SwFltControlStack::TAGS_IN_TEXT )
                    || SwFltGetFlag( nFieldFlags, SwFltControlStack::ALLOW_FLD_CR );


    xub_StrLen nMax = rOrg.Len();
    xub_StrLen i = 0;
    while( nMax > i && ( rStr.Len() < MAX_FIELDLEN - 4 ) )
    {
        sal_Unicode c = rOrg.GetChar( i );
        switch( c )
        {
            case 132:                       // Typographische Anfuehrungszeichen
            case 148:                       // gegen normale tauschen
            case 147: rStr += '"'; break;
            case 19:  rStr += '{'; break;   // 19..21 zu {|}
            case 20:  rStr += '|'; break;
            case 21:  rStr += '}'; break;
            case '\\':                      // \{|} per \ Taggen
            case '{':
            case '|':
            case '}': rStr += '\\'; rStr += c; break;
            default:  SwWW8ImplReader::QuoteChar( rStr, c, bAllowCr ); break;
        }
        i++;
    }
}

void SwWW8ImplReader::InsertTagField( const USHORT nId, const String& rTagText )
{
    String aName( WW8_ASCII2STR( "WwFieldTag" ) );
    if( SwFltGetFlag( nFieldFlags, SwFltControlStack::TAGS_DO_ID ) ) // Nummer?
        aName += String::CreateFromInt32( nId );                    // ausgeben ?

    if( SwFltGetFlag(nFieldFlags, SwFltControlStack::TAGS_IN_TEXT))
    {
        aName += rTagText;                                          // als Txt taggen
        rDoc.Insert( *pPaM, aName, FALSE );
    }
    else
    {                                                   // normal tagggen

        SwFieldType* pFT = rDoc.InsertFldType(
                                SwSetExpFieldType( &rDoc, aName, GSE_STRING ) );
        SwSetExpField aFld( (SwSetExpFieldType*)pFT, rTagText );                            // SUB_INVISIBLE
        USHORT nSubType = ( SwFltGetFlag( nFieldFlags, SwFltControlStack::TAGS_VISIBLE ) ) ? 0 : SUB_INVISIBLE;
        aFld.SetSubType(nSubType);

        rDoc.Insert( *pPaM, SwFmtFld( aFld ) );
    }
}

long SwWW8ImplReader::Read_F_Tag( WW8FieldDesc* pF )
{
    long nOldPos = pStrm->Tell();

    WW8_CP nStart = pF->nSCode - 1;         // mit 0x19 am Anfang
    long nL = pF->nLen;                     // Gesamtlaenge mit Resultat u. Nest
    if( nL > MAX_FIELDLEN )
        nL = MAX_FIELDLEN;                  // MaxLaenge, durch Quoten
                                            // max. 4* so gross
    String sFTxt;
    nL = pSBase->WW8ReadString( *pStrm, sFTxt,
                                pPlcxMan->GetCpOfs() + nStart, nL, eStructCharSet);


    String aTagText;
    MakeTagString( aTagText, sFTxt );
    InsertTagField( pF->nId, aTagText );

    pStrm->Seek( nOldPos );
    return pF->nLen;
}


//-----------------------------------------
//        normale Felder
//-----------------------------------------

// Read_F_Nul() dient dazu, Felder, die ein belegtes ResultatFeld haben, dieses
// aber trotzdem keinen Text darstellt, sondern z.B. Variablen-Werte, komplett
// zu ignorieren.
// Noetig z.B. fuer Feld 6 "Set" == "Bestimmen".
eF_ResT SwWW8ImplReader::Read_F_Nul( WW8FieldDesc*, String& rStr )
{
    return F_OK;
}

eF_ResT SwWW8ImplReader::Read_F_Input( WW8FieldDesc* pF, String& rStr )
{
    String aDef;
    String aQ;
    long nRet;
    _ReadFieldParams aReadParam( rStr );
    while( -1 != ( nRet = aReadParam.SkipToNextToken() ))
    {
        switch( nRet )
        {
        case -2:
            if( !aQ.Len() )
                aQ = aReadParam.GetResult();
            break;
        case 'd':
        case 'D':
            {
                xub_StrLen n = aReadParam.GoToTokenParam();
                if( STRING_NOTFOUND != n )
                    aDef = aReadParam.GetResult();
            }
            break;
        }
    }
    if( !aDef.Len() )
        aDef = GetFieldResult( pF );

    SwInputField aFld( (SwInputFieldType*)rDoc.GetSysFldType( RES_INPUTFLD ),
                        aDef, aQ, INP_TXT, 0 ); // sichtbar ( geht z.Zt. nicht anders )
    rDoc.Insert( *pPaM, SwFmtFld( aFld ) );

    return F_OK;
}

// GetFieldResult alloziert einen String und liest das Feld-Resultat ein
String SwWW8ImplReader::GetFieldResult( WW8FieldDesc* pF )
{
    long nOldPos = pStrm->Tell();

    WW8_CP nStart = pF->nSRes;              // Start Resultat
    long nL = pF->nLRes;                    // Laenge Resultat
    if( !nL )
        return aEmptyStr;                           // kein Resultat

    if( nL > MAX_FIELDLEN )
        nL = MAX_FIELDLEN;                  // MaxLaenge, durch Quoten
                                            // max. 4* so gross

    String sRes;
    nL = pSBase->WW8ReadString( *pStrm, sRes, pPlcxMan->GetCpOfs() + nStart,
                                nL, eStructCharSet );

    pStrm->Seek( nOldPos );
    return sRes;
}

// "FRAGE"
eF_ResT SwWW8ImplReader::Read_F_InputVar( WW8FieldDesc* pF, String& rStr )
{
    String aVar;
    String aQ;
    String aDef;
    long nRet;
    _ReadFieldParams aReadParam( rStr );
    while( -1 != ( nRet = aReadParam.SkipToNextToken() ))
    {
        switch( nRet )
        {
        case -2:
            if( !aVar.Len() )
                aVar = aReadParam.GetResult();
            else if( !aQ.Len() )
                aQ = aReadParam.GetResult();
            break;
        case 'd':
        case 'D':
            {
                xub_StrLen n = aReadParam.GoToTokenParam();
                if( STRING_NOTFOUND != n )
                    aDef = aReadParam.GetResult();
            }
            break;
        }
    }
    if( !aVar.Len() )
        return F_TAGIGN;  // macht ohne Textmarke keinen Sinn
    if( !aDef.Len() )
        aDef = GetFieldResult( pF );



    SwFieldType* pFT = rDoc.InsertFldType( SwSetExpFieldType( &rDoc, aVar, GSE_STRING ) );
    SwSetExpField aFld( (SwSetExpFieldType*)pFT, aVar );
    aFld.SetSubType(SUB_INVISIBLE);
    aFld.SetInputFlag( TRUE );
    aFld.SetPromptText( aQ );
    aFld.SetPar2( aDef );
    pPlcxMan->GetBook()->SetStatus( pF->nSCode, pF->nSCode + pF->nLen,
                aVar, BOOK_ONLY_REF );
    rDoc.Insert( *pPaM, SwFmtFld( aFld ) );


    return F_OK;
}

// "AUTONR"
eF_ResT SwWW8ImplReader::Read_F_ANumber( WW8FieldDesc*, String& rStr )
{
    if( !pNumFldType ){     // 1. Mal
        SwSetExpFieldType aT( &rDoc, WW8_ASCII2STR("AutoNr"), GSE_SEQ );
        pNumFldType = rDoc.InsertFldType( aT );
    }
    SwSetExpField aFld( (SwSetExpFieldType*)pNumFldType, aEmptyStr,
                        GetNumberPara( rStr ) );
    aFld.SetValue( ++nFldNum );
    rDoc.Insert( *pPaM, SwFmtFld( aFld ) );
    return F_OK;
}

// "SEQ"
eF_ResT SwWW8ImplReader::Read_F_Seq( WW8FieldDesc*, String& rStr )
{
    String aSequenceName;
    String aBook;
    BOOL bHidden    = FALSE;
    BOOL bFormat    = FALSE;
    BOOL bShowLast  = FALSE;
    BOOL bCountOn   = TRUE;
    String sStart, sLevel;
    SvxExtNumType eNumFormat = SVX_NUM_ARABIC;
    long nRet;
    _ReadFieldParams aReadParam( rStr );
    while( -1 != ( nRet = aReadParam.SkipToNextToken() ))
    {
        switch( nRet )
        {
        case -2:
            if( !aSequenceName.Len() )
                aSequenceName = aReadParam.GetResult();
            else if( !aBook.Len() )
                aBook = aReadParam.GetResult();
            break;

        case 'h':
            if( !bFormat )
                bHidden = TRUE;             // Hidden-Flag aktivieren
            break;

        case '*':
            bFormat = TRUE;                 // Format-Flag aktivieren
            bHidden = FALSE;                // Hidden-Flag deaktivieren
            nRet = aReadParam.SkipToNextToken();
            if( -2 == nRet )
                eNumFormat = GetNumTypeFromName( aReadParam.GetResult() );
            break;

        case 'r':
            bShowLast = FALSE;              // Zaehler neu setzen
            bCountOn  = FALSE;
            nRet = aReadParam.SkipToNextToken();
            if( -2 == nRet )
                sStart = aReadParam.GetResult();
            break;

        case 'c':
            bShowLast = TRUE;               // zuletzt verwendete Nummer anzeigen
            bCountOn  = FALSE;
            break;

        case 'n':
            bCountOn  = TRUE;               // Nummer um eins erhoehen (default)
            bShowLast = FALSE;
            break;

        case 's':                       // Outline Level
            if( -2 == aReadParam.SkipToNextToken() )
                sLevel = aReadParam.GetResult();
            break;
        }
    }
    if(    !aSequenceName.Len()
        || !aBook.Len() )
        return F_TAGIGN;

    SwSetExpFieldType* pFT = (SwSetExpFieldType*)rDoc.InsertFldType(
                        SwSetExpFieldType( &rDoc, aSequenceName, GSE_SEQ ) );
    SwSetExpField aFld( pFT, aEmptyStr, eNumFormat );

    if( sStart.Len() )
        aFld.SetFormula( ( aSequenceName += '=' ) += sStart );

    if( sLevel.Len() )
    {
        USHORT nLvl = (USHORT)sLevel.ToInt32();
        if( nLvl )
        {
            if( MAXLEVEL <= --nLvl )
                nLvl = MAXLEVEL - 1;
            pFT->SetOutlineLvl( nLvl );
        }
    }

    rDoc.Insert( *pPaM, SwFmtFld( aFld ) );
    return F_OK;
}


eF_ResT SwWW8ImplReader::Read_F_DocInfo( WW8FieldDesc* pF, String& rStr )
{
    USHORT nSub;
    USHORT nReg = DI_SUB_AUTHOR;    // RegInfoFormat, DefaultFormat fuer DocInfoFelder
    BOOL   bDateTime = FALSE;

    if( 85 == pF->nId )
    {
        /*
        There are up to 26 fields that may be meant by 'DocumentProperty'.
        Which of them is to be inserted here ?
        This Problem can only be solved by implementing a name matching
        method that compares the given Parameter String with the four
        possible name sets (english, german, french, spanish)
        */
        String aStr( rStr );
        xub_StrLen nPos1 = aStr.Search( '"' );
        if( (STRING_NOTFOUND != nPos1) && (nPos1+1 < aStr.Len()) )
        {
            xub_StrLen nPos2 = aStr.SearchAndReplace( '"', '\0', nPos1+1 );
            if( STRING_NOTFOUND != nPos2 )
            {
                aStr.Erase(0, nPos1+1);
                static sal_Char __READONLY_DATA* aName10 = "\x0F"; // SW field code
                static sal_Char  __READONLY_DATA* aName11 // German
                    = "TITEL";
                static sal_Char  __READONLY_DATA* aName12 // French
                    = "TITRE";
                static sal_Char  __READONLY_DATA* aName13 // English
                    = "TITLE";
                static sal_Char  __READONLY_DATA* aName14 // Spanish
                    = "TITRO";
                static sal_Char  __READONLY_DATA* aName20 = "\x15"; // SW filed code
                static sal_Char  __READONLY_DATA* aName21 // German
                    = "ERSTELLDATUM";
                static sal_Char  __READONLY_DATA* aName22 // French
                    = "CRÉÉ";
                static sal_Char  __READONLY_DATA* aName23 // English
                    = "CREATED";
                static sal_Char  __READONLY_DATA* aName24 // Spanish
                    = "CREADO";
                static sal_Char  __READONLY_DATA* aName30 = "\x16"; // SW filed code
                static sal_Char  __READONLY_DATA* aName31 // German
                    = "ZULETZTGESPEICHERTZEIT";
                static sal_Char  __READONLY_DATA* aName32 // French
                    = "DERNIERENREGISTREMENT";
                static sal_Char  __READONLY_DATA* aName33 // English
                    = "SAVED";
                static sal_Char  __READONLY_DATA* aName34 // Spanish
                    = "MODIFICADO";
                static sal_Char  __READONLY_DATA* aName40 = "\x17"; // SW filed code
                static sal_Char  __READONLY_DATA* aName41 // German
                    = "ZULETZTGEDRUCKT";
                static sal_Char  __READONLY_DATA* aName42 // French
                    = "DERNIÈREIMPRESSION";
                static sal_Char  __READONLY_DATA* aName43 // English
                    = "LASTPRINTED";
                static sal_Char  __READONLY_DATA* aName44 // Spanish
                    = "HUPS PUPS";
                static sal_Char  __READONLY_DATA* aName50 = "\x18"; // SW filed code
                static sal_Char  __READONLY_DATA* aName51 // German
                    = "ÜBERARBEITUNGSNUMMER";
                static sal_Char  __READONLY_DATA* aName52 // French
                    = "NUMÉRODEREVISION";
                static sal_Char  __READONLY_DATA* aName53 // English
                    = "REVISIONNUMBER";
                static sal_Char  __READONLY_DATA* aName54 // Spanish
                    = "SNUBBEL BUBBEL";
                static const USHORT nFldCnt  = 5;




                // additional fields are to be coded soon!   :-)




                static const USHORT nLangCnt = 4;
                static const sal_Char * aNameSet_26[nFldCnt][nLangCnt+1] = {
                    {aName10, aName11, aName12, aName13, aName14},
                    {aName20, aName21, aName22, aName23, aName24},
                    {aName30, aName31, aName32, aName33, aName34},
                    {aName40, aName41, aName42, aName43, aName44},
                    {aName50, aName51, aName52, aName53, aName54}
                };
                BOOL   bFldFound= FALSE;
                USHORT nFIdx;
                for(USHORT nLIdx=1; !bFldFound && (nLangCnt > nLIdx); ++nLIdx)
                {
                    for(nFIdx = 0;  !bFldFound && (nFldCnt  > nFIdx); ++nFIdx)
                    {
                        if( aStr.EqualsIgnoreCaseAscii( aNameSet_26[nFIdx][nLIdx] ) )
                        {
                            bFldFound = TRUE;
                            pF->nId   = aNameSet_26[nFIdx][0][0];
                        }
                    }
                }
                if( !bFldFound )
                    return F_TAGTXT; // Error: show field as string
            }
        }
    }

    switch( pF->nId )
    {
        case 14: nSub = DI_KEYS;        /* kann alle INFO-Vars!! */      break;
        case 15: nSub = DI_TITEL;                                        break;
        case 16: nSub = DI_THEMA;                                        break;
        case 18: nSub = DI_KEYS;                                         break;
        case 19: nSub = DI_COMMENT;                                      break;
        case 20: nSub = DI_CHANGE; nReg = DI_SUB_AUTHOR;                 break;
        case 21: nSub = DI_CREATE; nReg = DI_SUB_DATE; bDateTime = TRUE; break;
        case 23: nSub = DI_PRINT;  nReg = DI_SUB_DATE; bDateTime = TRUE; break;
        case 24: nSub = DI_DOCNO;                                        break;
        case 22: nSub = DI_CHANGE; nReg = DI_SUB_DATE; bDateTime = TRUE; break;
        case 25: nSub = DI_CHANGE; nReg = DI_SUB_TIME; bDateTime = TRUE; break;
    }

    ULONG nFormat = 0;

    if( bDateTime )
    {
        short nDT = GetTimeDatePara( rDoc, rStr, nFormat );
        switch( nDT )
        {
        case NUMBERFORMAT_DATE:     nReg = DI_SUB_DATE; break;
        case NUMBERFORMAT_TIME:     nReg = DI_SUB_TIME; break;
        case NUMBERFORMAT_DATETIME: nReg = DI_SUB_DATE; break;
        default:
            {
                nReg = DI_SUB_DATE;
            }
        }
    }

    SwDocInfoField aFld( (SwDocInfoFieldType*)
                    rDoc.GetSysFldType( RES_DOCINFOFLD ), nSub|nReg, nFormat );
    rDoc.Insert( *pPaM, SwFmtFld( aFld ) );
    return F_OK;
}

eF_ResT SwWW8ImplReader::Read_F_Author( WW8FieldDesc*, String& )
{
        // SH: Das SwAuthorField bezeichnet nicht den urspruenglichen
        // Autor, sondern den aktuellen Benutzer, also besser ueber DocInfo
        // (#56149)
    SwDocInfoField aFld( (SwDocInfoFieldType*)
                     rDoc.GetSysFldType( RES_DOCINFOFLD ),
                     DI_CREATE|DI_SUB_AUTHOR );
    rDoc.Insert( *pPaM, SwFmtFld( aFld ) );
    return F_OK;
}

eF_ResT SwWW8ImplReader::Read_F_TemplName( WW8FieldDesc*, String& )
{
    SwTemplNameField aFld( (SwTemplNameFieldType*)
                     rDoc.GetSysFldType( RES_TEMPLNAMEFLD ), FF_NAME );
    rDoc.Insert( *pPaM, SwFmtFld( aFld ) );
    return F_OK;
}

// Sowohl das Datum- wie auch das Uhrzeit-Feld kann fuer Datum, fuer Uhrzeit
// oder fuer beides benutzt werden.
eF_ResT SwWW8ImplReader::Read_F_DateTime( WW8FieldDesc*pF, String& rStr )
{                                               // Datum/Uhrzeit - Feld
    ULONG nFormat = 0;

    short nDT = GetTimeDatePara( rDoc, rStr, nFormat );

    if( NUMBERFORMAT_UNDEFINED == nDT )             // no D/T-Formatstring
    {
        if( 32 == pF->nId )
        {
            nDT     = NUMBERFORMAT_TIME;
            nFormat = rDoc.GetNumberFormatter()->GetFormatIndex(
                        NF_TIME_START, LANGUAGE_SYSTEM );
        }
        else
        {
            nDT     = NUMBERFORMAT_DATE;
            nFormat = rDoc.GetNumberFormatter()->GetFormatIndex(
                        NF_DATE_START, LANGUAGE_SYSTEM );
        }
    }

    if( nDT & NUMBERFORMAT_DATE )
    {
        SwDateTimeField aFld( (SwDateTimeFieldType*)
                        rDoc.GetSysFldType( RES_DATETIMEFLD ), DATEFLD, nFormat );
        rDoc.Insert( *pPaM, SwFmtFld( aFld ) );
    }
    else if( nDT == NUMBERFORMAT_TIME )
    {
        SwDateTimeField aFld( (SwDateTimeFieldType*)
                        rDoc.GetSysFldType( RES_DATETIMEFLD ), TIMEFLD, nFormat );
        rDoc.Insert( *pPaM, SwFmtFld( aFld ) );
    }

    return F_OK;
}

eF_ResT SwWW8ImplReader::Read_F_FileName( WW8FieldDesc*, String& )
{
    SwFileNameField aFld( (SwFileNameFieldType*)
                          rDoc.GetSysFldType( RES_FILENAMEFLD ) );
    rDoc.Insert( *pPaM, SwFmtFld( aFld ) );
    return F_OK;
}

eF_ResT SwWW8ImplReader::Read_F_Anz( WW8FieldDesc* pF, String& rStr )
{                                               // SeitenZahl - Feld
    USHORT nSub = DS_PAGE;
    switch ( pF->nId ){
    case 27: nSub = DS_WORD; break;             // Wordzahl
    case 28: nSub = DS_CHAR; break;             // Zeichenzahl
    }
    SwDocStatField aFld( (SwDocStatFieldType*)
                         rDoc.GetSysFldType( RES_DOCSTATFLD ), nSub,
                         GetNumberPara( rStr ) );
    rDoc.Insert( *pPaM, SwFmtFld( aFld ) );
    return F_OK;
}

eF_ResT SwWW8ImplReader::Read_F_CurPage( WW8FieldDesc*, String& rStr )
{
    // zusaetzlich mit Kapitelnummer?
    if( bPgChpLevel )
    {
        SwChapterField aFld( (SwChapterFieldType*)
                    rDoc.GetSysFldType( RES_CHAPTERFLD ), CF_NUMBER );
        aFld.SetLevel( nPgChpLevel );
        rDoc.Insert( *pPaM, SwFmtFld( aFld ) );

        static sal_Char __READONLY_DATA aDelim[] = "-.:\x97\x96";
        BYTE nDelim = nPgChpDelim;
        if( nDelim > 4 )
            nDelim = 0;

        sal_Unicode c = ByteString::ConvertToUnicode( aDelim[ nDelim ],
                                        RTL_TEXTENCODING_MS_1252 );
        if( '-' == c )
            rDoc.Insert( *pPaM, CHAR_HARDHYPHEN );
        else
            rDoc.Insert( *pPaM, SwFmtHardBlank( c ));
    }
                                               // Seitennummer
    SwPageNumberField aFld( (SwPageNumberFieldType*)
                    rDoc.GetSysFldType( RES_PAGENUMBERFLD ), PG_RANDOM,
                    GetNumberPara( rStr, TRUE ) );
    rDoc.Insert( *pPaM, SwFmtFld( aFld ) );
    return F_OK;
}

eF_ResT SwWW8ImplReader::Read_F_Symbol( WW8FieldDesc*, String& rStr )
{                                               // Symbol-Zeichensatz
/*
    char* p;
    char* pQ = Find1stPara( pStr, &p );         // 1. Para ist Ascii-Wert
    USHORT nC = String( pQ );
    if( !nC )                                   // ungueltige Syntax
        return F_TAGIGN;                        // -> kein 0-Zeichen in Text
    char* pCSet = FindPara( p, 'f', 'F' );          // \f -> Zeichensatz
    char* pSiz = FindPara( p, 's', 'S' );           // \s -> FontSize
    if( pCSet ){                                // Charset angegeben ?
        String aName( pCSet );
        if( eStructCharSet != eSysCharSet )             // OS2, WIN mit Mac-Doc,...
            aName.Convert( eStructCharSet, eSysCharSet );
        SvxFontItem aFont(  FAMILY_DONTKNOW, aName, // "WingDings",
                            aEmptyStr,
                            PITCH_DONTKNOW, CHARSET_SYMBOL);
        NewAttr( aFont );              // neuer Font
    }
    if( pSiz ){                                 // Size angegeben ?
        ULONG nSiz = String( pSiz );            // in pt
        SvxFontHeightItem aSz( nSiz * 20 );     // pT -> twip
        NewAttr( aSz );
    }
*/
    String aQ;
    String aName;
    String aSiz;
    long nRet;
    _ReadFieldParams aReadParam( rStr );
    while( -1 != ( nRet = aReadParam.SkipToNextToken() ))
    {
        switch( nRet )
        {
        case -2:
            if( !aQ.Len() )
                aQ = aReadParam.GetResult();
            break;
        case 'f':
        case 'F':
            {
                xub_StrLen n = aReadParam.GoToTokenParam();
                if( STRING_NOTFOUND != n )
                    aName = aReadParam.GetResult();
            }
            break;
        case 's':
        case 'S':
            {
                xub_StrLen n = aReadParam.GoToTokenParam();
                if( STRING_NOTFOUND != n )
                    aSiz = aReadParam.GetResult();
            }
            break;
        }
    }
    if( !aQ.Len() )
        return F_TAGIGN;                        // -> kein 0-Zeichen in Text

    if( aName.Len() )                           // Font Name angegeben ?
    {
        SvxFontItem aFont(  FAMILY_DONTKNOW, aName, // "WingDings",
                            aEmptyStr,
                            PITCH_DONTKNOW, RTL_TEXTENCODING_SYMBOL );
        NewAttr( aFont );                       // neuer Font
    }

    if( aSiz.Len() )                            // Size angegeben ?
    {
        SvxFontHeightItem aSz( aSiz.ToInt32() * 20 ); // pT -> twip
        NewAttr( aSz );
    }

    rDoc.Insert( *pPaM, aQ.GetChar( 0 ) );

    if( aSiz.Len() )
        pCtrlStck->SetAttr( *pPaM->GetPoint(), RES_CHRATR_FONTSIZE );
    if( aName.Len() )
        pCtrlStck->SetAttr( *pPaM->GetPoint(), RES_CHRATR_FONT );

    return F_OK;
}


// "EINBETTEN"
eF_ResT SwWW8ImplReader::Read_F_Embedd( WW8FieldDesc*, String& rStr )
{
    String sHost;

    long nRet;
    _ReadFieldParams aReadParam( rStr );
    while( -1 != ( nRet = aReadParam.SkipToNextToken() ))
    {
        switch( nRet )
        {
        case -2:
            sHost = aReadParam.GetResult();
            break;

        case 's':
            // use ObjectSize
            break;
        }
    }

    if( bObj && nPicLocFc )
        nObjLocFc = nPicLocFc;
    bEmbeddObj = TRUE;
    return F_TEXT;
}


// "BESTIMMEN"
eF_ResT SwWW8ImplReader::Read_F_Set( WW8FieldDesc* pF, String& rStr )
{
    String aName;
    String aVal;
    long nRet;
    _ReadFieldParams aReadParam( rStr );
    while( -1 != ( nRet = aReadParam.SkipToNextToken() ))
    {
        switch( nRet )
        {
        case -2:
            if( !aName.Len() )
                aName = aReadParam.GetResult();
            else if( !aVal.Len() )
                aVal = aReadParam.GetResult();
            break;
        }
    }
    SwFieldType* pFT = rDoc.InsertFldType(
                            SwSetExpFieldType( &rDoc, aName, GSE_STRING ) );
    SwSetExpField aFld( (SwSetExpFieldType*)pFT, aVal );
    aFld.SetSubType(SUB_INVISIBLE);
    pPlcxMan->GetBook()->SetStatus( pF->nSCode, pF->nSCode + pF->nLen,
         aName, BOOK_IGNORE );
    rDoc.Insert( *pPaM, SwFmtFld( aFld ) );
    return F_OK;
}

// "REF"
eF_ResT SwWW8ImplReader::Read_F_Ref( WW8FieldDesc*, String& rStr )
{                                                       // Reference - Field
    String aBkmName;
    BOOL bChapterNr = FALSE;
    BOOL bObenUnten = FALSE;

    long nRet;
    _ReadFieldParams aReadParam( rStr );
    while( -1 != ( nRet = aReadParam.SkipToNextToken() ))
    {
        switch( nRet )
        {
        case -2:
            if( !aBkmName.Len() ) // get name of bookmark
            {
                aBkmName = aReadParam.GetResult();
            }
            break;

        case 'r':
            bChapterNr = TRUE; // activate flag 'Chapter Number'
            break;

        case 'p':
            bObenUnten = TRUE;
            break;
        case 'h':
            break;
        default:
            // unimplemented switch: just do 'nix nought nothing'  :-)
            break;
        }
    }

    if ( SwFltGetFlag( nFieldFlags, SwFltControlStack::HYPO ) )
    {
        SwGetExpField aFld( (SwGetExpFieldType*)
                        rDoc.GetSysFldType( RES_GETEXPFLD ),
                        aBkmName, GSE_STRING, VVF_SYS );
        rDoc.Insert( *pPaM, SwFmtFld( aFld ) );
        pEndStck->SetBookRef( aBkmName, FALSE );
    }
    else
    {
        SwGetRefField aFld( (SwGetRefFieldType*)
                    rDoc.GetSysFldType( RES_GETREFFLD ),
                    aBkmName,
                    REF_BOOKMARK,
                    0,
                    REF_CONTENT );
        rDoc.Insert( *pPaM, SwFmtFld( aFld ) );
        if( bObenUnten )
        {
            SwGetRefField aFld2( (SwGetRefFieldType*)
                        rDoc.GetSysFldType( RES_GETREFFLD ),
                        aBkmName,
                        REF_BOOKMARK,
                        0,
                        REF_UPDOWN );
            rDoc.Insert( *pPaM, SwFmtFld( aFld2 ) );
        }
    }
    return F_OK;
}

eF_ResT SwWW8ImplReader::Read_F_NoteReference( WW8FieldDesc*, String& rStr )
{                                                   // Note Reference - Field
    String aBkmName;
    BOOL bChapterNr = FALSE;
    BOOL bObenUnten = FALSE;

    long nRet;
    _ReadFieldParams aReadParam( rStr );
    while( -1 != ( nRet = aReadParam.SkipToNextToken() ))
    {
        switch( nRet )
        {
        case -2:
            if( !aBkmName.Len() ) // get name of foot/endnote
            {
                aBkmName = aReadParam.GetResult();
            }
            break;

        case 'r':
            bChapterNr = TRUE; // activate flag 'Chapter Number'
            break;

        case 'p':
            bObenUnten = TRUE;
            break;
        case 'h':
            break;
        default:
            // unimplemented switch: just do 'nix nought nothing'  :-)
            break;
        }
    }

    if ( SwFltGetFlag( nFieldFlags, SwFltControlStack::HYPO ) )
    {
        SwGetExpField aFld( (SwGetExpFieldType*)
                        rDoc.GetSysFldType( RES_GETEXPFLD ),
                        aBkmName, GSE_STRING, VVF_SYS );
        rDoc.Insert( *pPaM, SwFmtFld( aFld ) );
        pEndStck->SetBookRef( aBkmName, FALSE );
    }
    else
    {   // set Sequence No of corresponding Foot-/Endnote to Zero
        // (will be corrected in
        SwGetRefField aFld( (SwGetRefFieldType*)
                    rDoc.GetSysFldType( RES_GETREFFLD ),
                    aBkmName,
                    REF_FOOTNOTE,
                    0,
                    REF_ONLYNUMBER
                    );
        pRefFldStck->NewAttr(*pPaM->GetPoint(), SwFmtFld( aFld ));
        if( bObenUnten )
        {
//          rDoc.Insert( *pPaM, SwFmtHardBlank(' ') );
            SwGetRefField aFld2( (SwGetRefFieldType*)
                        rDoc.GetSysFldType( RES_GETREFFLD ),
                        aBkmName,
                        REF_FOOTNOTE,
                        0,
                        REF_UPDOWN
                        );
            pRefFldStck->NewAttr(*pPaM->GetPoint(), SwFmtFld( aFld2 ));
        }
    }
    return F_OK;
}

// "SEITENREF"
eF_ResT SwWW8ImplReader::Read_F_PgRef( WW8FieldDesc*, String& rStr )
{
    String aName;
    long nRet;
    _ReadFieldParams aReadParam( rStr );
    while( -1 != ( nRet = aReadParam.SkipToNextToken() ))
    {
        switch( nRet )
        {
        case -2:
            if( !aName.Len() )
                aName = aReadParam.GetResult();
            break;
        }
    }
    if ( SwFltGetFlag( nFieldFlags, SwFltControlStack::HYPO ) )
    {
        SwGetRefField aFld( (SwGetRefFieldType*)
                        rDoc.GetSysFldType( RES_GETREFFLD ), aName, 0, 0,
                        REF_PAGE );
        rDoc.Insert( *pPaM, SwFmtFld( aFld ) );
        pEndStck->SetBookRef( aName, TRUE );
    }
    else
    {
        SwGetRefField aFld( (SwGetRefFieldType*)
                    rDoc.GetSysFldType( RES_GETREFFLD ),
                    aName,
                    REF_BOOKMARK,
                    0,
                    REF_PAGE );
        rDoc.Insert( *pPaM, SwFmtFld( aFld ) );
    }
    return F_OK;
}

// "MACROSCHALTFL"ACHE"
eF_ResT SwWW8ImplReader::Read_F_Macro( WW8FieldDesc*, String& rStr )
{
    String aName;
    String aVText;
    long nRet;
    BOOL bNewVText = TRUE;
    BOOL bBracket  = FALSE;
    _ReadFieldParams aReadParam( rStr );
    while( -1 != ( nRet = aReadParam.SkipToNextToken() ))
    {
        switch( nRet )
        {
        case -2:
            if( !aName.Len() )
                aName = aReadParam.GetResult();
            else if( !aVText.Len() || bBracket )
            {
                if( bBracket )
                    aVText += ' ';
                aVText += aReadParam.GetResult();
                if( bNewVText )
                {
                    bBracket  = aVText.EqualsIgnoreCaseAscii('[', 1, 0);
                    bNewVText = FALSE;
                }
                else if( aVText.GetChar( aVText.Len()-1 ) == ']' )
                    bBracket  = FALSE;
            }
            break;
        }
    }
    if( !aName.Len() )
        return F_TAGIGN;  // makes no sense without Makro-Name

    aName.InsertAscii( "StarOffice.Standard.Modul1.", 0 );

    SwMacroField aFld( (SwMacroFieldType*)
                    rDoc.GetSysFldType( RES_MACROFLD ), aName, aVText );
    rDoc.Insert( *pPaM, SwFmtFld( aFld ) );
    return F_OK;
}

// "EINF"UGENGRAFIK"
eF_ResT SwWW8ImplReader::Read_F_IncludePicture( WW8FieldDesc*, String& rStr )
{
    String aGrfName;
    BOOL bEmbedded = TRUE;

    long nRet;
    _ReadFieldParams aReadParam( rStr );
    while( -1 != ( nRet = aReadParam.SkipToNextToken() ))
    {
        switch( nRet )
        {
        case -2:
            if( !aGrfName.Len() )
            {
                ConvertFFileName( aGrfName, aReadParam.GetResult() );
                aGrfName = INetURLObject::RelToAbs( aGrfName );
            }
            break;

        case 'd':
            bEmbedded = FALSE;          // Embedded-Flag deaktivieren
            break;

        case 'c':// den Converter-Namen ueberlesen
            aReadParam.FindNextStringPiece();
            break;
        }
    }

    BOOL bExist = FALSE;
    INetURLObject aGrURL(URIHelper::SmartRelToAbs(aGrfName));
/*  try
    {
        ::ucb::Content aTestContent(
            aGrURL.GetMainURL(),
            uno::Reference< XCommandEnvironment >());
        bExist = aTestContent.isDocument();
    }
    catch(...){}
*/
    if( bExist || !bEmbedded )
    {
        /*
            Besonderheit:

            Wir setzen jetzt den Link ins Doc und merken uns den SwFlyFrmFmt.
            Da wir ja unten auf jjeden Fall mit Return-Wert F_READ_FSPA enden,
            wird der Skip-Wert so bemessen, dass das folgende Char-1 eingelesen
            wird.
            Wenn wir dann in SwWW8ImplReader::ImportGraf() reinlaufen, wird
            erkannt, dass wir soeben einen Grafik-Link inserted haben und
            das passende SwAttrSet wird ins Frame-Format eingesetzt.
        */
        SfxItemSet aFlySet( rDoc.GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1 );
        aFlySet.Put( SwFmtAnchor( FLY_IN_CNTNT ) );
        aFlySet.Put( SwFmtVertOrient( 0, VERT_TOP, FRAME ));
        pFlyFmtOfJustInsertedGraphic = rDoc.Insert( *pPaM,
                                                    aGrfName,
                                                    aEmptyStr,
                                                    0,          // Graphic*
                                                    &aFlySet,
                                                    0);         // SwFrmFmt*
        String aName;
        if(MakeUniqueGraphName(aName, aGrURL.GetBase()))
            pFlyFmtOfJustInsertedGraphic->SetName( aName );
    }
    return F_READ_FSPA;
}

// "EINFUEGENTEXT"
eF_ResT SwWW8ImplReader::Read_F_IncludeText( WW8FieldDesc*, String& rStr )
{
    String aPara;
    String aBook;
    long nRet;
    _ReadFieldParams aReadParam( rStr );
    while( -1 != ( nRet = aReadParam.SkipToNextToken() ))
    {
        switch( nRet )
        {
        case -2:
            if( !aPara.Len() )
                aPara = aReadParam.GetResult();
            else if( !aBook.Len() )
                aBook = aReadParam.GetResult();
            break;
        }
    }
    ConvertFFileName( aPara, aPara );
    aPara = INetURLObject::RelToAbs( aPara );

    if( aBook.Len() && aBook.GetChar( 0 ) != '\\' )
    {
        // Bereich aus Quelle ( kein Switch ) ?
        ConvertUFName( aBook );
        aPara += cTokenSeperator;
        aPara += cTokenSeperator;
        aPara += aBook;
    }
    String aStr(WW8_ASCII2STR( "WW" ));
    SwSection* pSection = new SwSection( FILE_LINK_SECTION,
                                    rDoc.GetUniqueSectionName( &aStr ) );
    pSection->SetLinkFileName( aPara );
    pSection->SetProtect( TRUE );
    NewAttr( SwFltSection( pSection ) );
    pEndStck->SetAttr( *pPaM->GetPoint(), RES_FLTR_SECTION );

//  rDoc.AppendTxtNode( *pPaM->GetPoint() );
    return F_OK;
}

// "SERIENDRUCKFELD"
eF_ResT SwWW8ImplReader::Read_F_DBField( WW8FieldDesc*, String& rStr )
{
    String aName;
    long nRet;
    _ReadFieldParams aReadParam( rStr );
    while( -1 != ( nRet = aReadParam.SkipToNextToken() ))
    {
        switch( nRet )
        {
        case -2:
            if( !aName.Len() )
                aName = aReadParam.GetResult();
            break;
        }
    }
    SwDBFieldType aD( &rDoc, aName, aEmptyStr );    // Datenbank: Nichts
    SwFieldType* pFT = rDoc.InsertFldType( aD );
    SwDBField aFld( (SwDBFieldType*)pFT );
    rDoc.Insert( *pPaM, SwFmtFld( aFld ) );
    return F_OK;
}

// "N"ACHSTER"
eF_ResT SwWW8ImplReader::Read_F_DBNext( WW8FieldDesc*, String& )
{
    SwDBNextSetFieldType aN;
    SwFieldType* pFT = rDoc.InsertFldType( aN );
    SwDBNextSetField aFld( (SwDBNextSetFieldType*)pFT, aEmptyStr, aEmptyStr,
                            aEmptyStr );        // Datenbank: Nichts
    rDoc.Insert( *pPaM, SwFmtFld( aFld ) );
    return F_OK;
}

// "DATENSATZ"
eF_ResT SwWW8ImplReader::Read_F_DBNum( WW8FieldDesc*, String& )
{
    SwDBSetNumberFieldType aN;
    SwFieldType* pFT = rDoc.InsertFldType( aN );
    SwDBSetNumberField aFld( (SwDBSetNumberFieldType*)pFT,
                           aEmptyStr );         // Datenbank: Nichts
    rDoc.Insert( *pPaM, SwFmtFld( aFld ) );
    return F_OK;
}

//-----------------------------------------
//        Verzeichnis-Felder
//-----------------------------------------

void lcl_toxMatchACSwitch(  SwWW8ImplReader& rReader,
                            SwDoc& rDoc,
                            SwTOXBase& rBase,
                            _ReadFieldParams& rParam,
                            SwCaptionDisplay eCaptionType)
{
    xub_StrLen n = rParam.GoToTokenParam();
    if( STRING_NOTFOUND != n )
    {
        SwTOXType* pType = (SwTOXType*)rDoc.GetTOXType( TOX_ILLUSTRATIONS, 0);
        pType->Add( &rBase );
        rBase.SetCaptionDisplay( eCaptionType );
        // Read Sequence Name and store in TOXBase
        String sSeqName( rParam.GetResult() );
        lcl_ConvertSequenceName( rReader, sSeqName );
        rBase.SetSequenceName( sSeqName );
    }
}


void lcl_toxMatchTSwitch(SwWW8ImplReader& rReader,
                         SwTOXBase& rBase,
                         _ReadFieldParams& rParam)
{
    xub_StrLen n = rParam.GoToTokenParam();
    if( STRING_NOTFOUND != n )
    {
        String sParams( rParam.GetResult() );
        if( sParams.Len() )
        {
            xub_StrLen nIndex = 0;

            String sTemplate( sParams.GetToken(0, ';', nIndex) );
            if( STRING_NOTFOUND == nIndex )
            {
                const SwFmt* pStyle
                        = rReader.GetStyleWithOrgWWName( sTemplate );
                if( pStyle )
                {
                    sTemplate = pStyle->GetName();
                }
                // Store Style for Level 0 into TOXBase
                rBase.SetStyleNames( sTemplate, 0 );
            }
            else while( STRING_NOTFOUND != nIndex )
            {
                xub_StrLen nLevel = sParams.GetToken(0, ';', nIndex).ToInt32();

                if( (0 < nLevel) && (MAXLEVEL >= nLevel) )
                {
                    nLevel--;
                    // Store Style and Level into TOXBase
                    const SwFmt* pStyle
                            = rReader.GetStyleWithOrgWWName( sTemplate );
                    if( pStyle )
                    {
                        sTemplate = pStyle->GetName();
                    }
                    String sStyles( rBase.GetStyleNames( nLevel ) );
                    if( sStyles.Len() )
                        sStyles += TOX_STYLE_DELIMITER;
                    sStyles += sTemplate;
                    rBase.SetStyleNames( sStyles, nLevel );
                }
                // read next style name...
                sTemplate = sParams.GetToken(0, ';', nIndex);
            }
        }
    }
}


eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, String& rStr )
{
    if( nIniFlags & WW8FL_NO_TOX )
        return F_OK;            // abgeschaltet -> ignorieren
    if( ( pF->nLRes < 3 ) )
        return F_TAGIGN;        // Nur Stuss -> ignorieren

    TOXTypes eTox;                              // Baue ToxBase zusammen
    switch( pF->nId )
    {
        case  8: eTox = TOX_INDEX; break;
        case 13: eTox = TOX_CONTENT; break;
        default: eTox = TOX_USER; break;
    }
    USHORT nCreateOf = (eTox == TOX_CONTENT) ? TOX_OUTLINELEVEL
                                             : TOX_MARK;
    USHORT nIndexCols = 0;
    const SwTOXType* pType = rDoc.GetTOXType( eTox, 0 );
    SwForm aForm( eTox );
    SwTOXBase* pBase = new SwTOXBase( pType, aForm, nCreateOf, aEmptyStr );
                                // Name des Verzeichnisses
    switch( eTox ){
    case TOX_INDEX:
        {
            USHORT eOptions = TOI_SAME_ENTRY | TOI_CASE_SENSITIVE;


            // TOX_OUTLINELEVEL setzen wir genau dann, wenn
            // die Parameter \o in 1 bis 9 liegen
            // oder der Parameter \f existiert
            // oder GARKEINE Switches Parameter angegeben sind.
            USHORT eCreateFrom = 0;
            USHORT nMaxLevel = 0;
            long nRet;
            _ReadFieldParams aReadParam( rStr );
            while( -1 != ( nRet = aReadParam.SkipToNextToken() ))
            {
                switch( nRet )
                {
                case 'c':
                    {
                        xub_StrLen n = aReadParam.GoToTokenParam();
                        if( STRING_NOTFOUND != n )
                        {
                            String sParams( aReadParam.GetResult() );
                            if( sParams.Len() ) // if NO String just ignore the \c
                                nIndexCols = sParams.ToInt32();
                        }
                    }
                    break;
                case 'e':
                    {
                        xub_StrLen n = aReadParam.GoToTokenParam();
                        if( STRING_NOTFOUND != n )  // if NO String just ignore the \e
                        {
                            String sDelimiter( aReadParam.GetResult() );
                            SwForm aForm( pBase->GetTOXForm() );

                            // Attention: if TOX_CONTENT brave
                            //            GetFormMax() returns MAXLEVEL + 1  !!
                            USHORT nEnd = aForm.GetFormMax()-1;

                            for(USHORT nLevel = 1;
                                   nLevel <= nEnd;
                                   ++nLevel)
                            {
                                // Levels count from 1
                                // Level 0 is reserved for CAPTION

                                // Delimiter statt Tabstop vor der Seitenzahl einsetzen,
                                // falls es eine Seitenzahl gibt:
                                FormTokenType ePrevType = TOKEN_END;
                                FormTokenType eType;
                                SwFormTokenEnumerator aEnumer =
                                    aForm.CreateTokenEnumerator( nLevel );
                                do
                                {
                                    eType = aEnumer.GetNextTokenType();
                                    switch( eType )
                                    {
                                        case TOKEN_PAGE_NUMS:
                                        {
                                            if( TOKEN_TAB_STOP == ePrevType )
                                            {
                                                // remove Tab
                                                aEnumer.GetPrevTokenType();
                                                aEnumer.RemoveCurToken();
                                                // insert new Token
                                                if( 0x09 == sDelimiter.GetChar( 0 ) )
                                                {
                                                    SwFormToken aToken( TOKEN_TAB_STOP );
                                                    aToken.eTabAlign = SVX_TAB_ADJUST_END;
                                                    aEnumer.InsertToken( aToken );
                                                }
                                                else
                                                {
                                                    SwFormToken aToken( TOKEN_TEXT );
                                                    aToken.sText = sDelimiter;
                                                    aEnumer.InsertToken( aToken );
                                                }
                                                aForm.SetPattern( nLevel,
                                                        aEnumer.GetPattern() );
                                            }
                                            eType = TOKEN_END;
                                            break;
                                        }
                                    }
                                    ePrevType = eType;
                                }
                                while( TOKEN_END != eType );
                            }
                            pBase->SetTOXForm( aForm );
                        }
                    }
                    break;
                case 'h':
                    {
                        eOptions |= TOI_ALPHA_DELIMITTER;
                    }
                    break;
                case 'r':
                    {
                        SwForm aForm( pBase->GetTOXForm() );
                        aForm.SetCommaSeparated( TRUE );
                        pBase->SetTOXForm( aForm );
                    }
                    break;
                /*
                // the following switches are not (yet) supported
                // by good old StarWriter:
                case 'b':
                case 'd':
                case 'f':
                case 'g':
                case 'I':
                case 'p':
                case 's':
                    break;
                */
                }
            }
            /*
            const TOXTypes eType = pBase->GetTOXType()->GetType();
            switch( eType )
            {
                case TOX_CONTENT:
                    if( eCreateFrom )
                        pBase->SetCreate( eCreateFrom );
                    break;
                case TOX_ILLUSTRATIONS:
                    if( !eCreateFrom )
                        eCreateFrom = TOX_SEQUENCE;
                    pBase->SetCreate( eCreateFrom );
                    break;
            }
            */
            pBase->SetOptions( eOptions );
        }
        break;





    case TOX_CONTENT:
        {
            // TOX_OUTLINELEVEL setzen wir genau dann, wenn
            // die Parameter \o in 1 bis 9 liegen
            // oder der Parameter \f existiert
            // oder GARKEINE Switches Parameter angegeben sind.
            USHORT eCreateFrom = 0;
            USHORT nMaxLevel = 0;
            long nRet;
            _ReadFieldParams aReadParam( rStr );
            while( -1 != ( nRet = aReadParam.SkipToNextToken() ))
            {
                switch( nRet )
                {
                case 'a':
                case 'c':
                    lcl_toxMatchACSwitch(*this, rDoc, *pBase, aReadParam,
                                           ('c' == nRet)
                                         ? CAPTION_COMPLETE
                                         : CAPTION_TEXT );
                    break;
                case 'o':
                    {
                        USHORT nVal;
                        if( !aReadParam.GetTokenSttFromTo(0, &nVal, MAXLEVEL) )
                        {
                            nVal = aForm.GetFormMax()-1;
                        }
                        if( nMaxLevel < nVal )
                            nMaxLevel = nVal;
                        eCreateFrom |= TOX_OUTLINELEVEL;
                    }
                    break;
                case 'f':
                    eCreateFrom |= TOX_MARK;
                    break;
                case 'l':
                    {
                        USHORT nVal;
                        if( aReadParam.GetTokenSttFromTo(0, &nVal, MAXLEVEL) )
                        {
                            if( nMaxLevel < nVal )
                                nMaxLevel = nVal;
                            eCreateFrom |= TOX_MARK;
                        }
                    }
                    break;
                case 't': // paragraphs using special styles shall
                          // provide the TOX's content
                    lcl_toxMatchTSwitch(*this, *pBase, aReadParam);
                    eCreateFrom |= TOX_TEMPLATE;
                    break;
                case 'p':
                    {
                        xub_StrLen n = aReadParam.GoToTokenParam();
                        if( STRING_NOTFOUND != n )  // if NO String just ignore the \p
                        {
                            String sDelimiter( aReadParam.GetResult() );
                            SwForm aForm( pBase->GetTOXForm() );

                            // Attention: if TOX_CONTENT brave
                            //            GetFormMax() returns MAXLEVEL + 1  !!
                            USHORT nEnd = aForm.GetFormMax()-1;

                            for(USHORT nLevel = 1;
                                   nLevel <= nEnd;
                                   ++nLevel)
                            {
                                // Levels count from 1
                                // Level 0 is reserved for CAPTION

                                // Delimiter statt Tabstop vor der Seitenzahl einsetzen,
                                // falls es eine Seitenzahl gibt:
                                FormTokenType ePrevType = TOKEN_END;
                                FormTokenType eType;
                                SwFormTokenEnumerator aEnumer =
                                    aForm.CreateTokenEnumerator( nLevel );
                                do
                                {
                                    eType = aEnumer.GetNextTokenType();
                                    switch( eType )
                                    {
                                        case TOKEN_PAGE_NUMS:
                                        {
                                            if( TOKEN_TAB_STOP == ePrevType )
                                            {
                                                // remove Tab
                                                aEnumer.GetPrevTokenType();
                                                aEnumer.RemoveCurToken();
                                                // insert new Token
                                                SwFormToken aToken( TOKEN_TEXT );
                                                aToken.sText = sDelimiter;

                                                aEnumer.InsertToken( aToken );
                                                aForm.SetPattern( nLevel,
                                                        aEnumer.GetPattern() );
                                            }
                                            eType = TOKEN_END;
                                            break;
                                        }
                                    }
                                    ePrevType = eType;
                                }
                                while( TOKEN_END != eType );
                            }
                            pBase->SetTOXForm( aForm );
                        }
                    }
                    break;
                case 'n': // don't print page numbers
                    {
                        // read START and END param
                        USHORT nStart, nEnd;
                        if( !aReadParam.GetTokenSttFromTo(  &nStart,
                                                            &nEnd,
                                                            MAXLEVEL ) )
                        {
                            nStart = 1;
                            nEnd = aForm.GetFormMax()-1;
                        }
                        // remove page numbers from this levels
                        SwForm aForm( pBase->GetTOXForm() );
                        if( aForm.GetFormMax() <= nEnd)
                            nEnd = aForm.GetFormMax()-1;
                        for(USHORT nLevel = nStart;
                               nLevel <= nEnd;
                               ++nLevel)
                        {
                            // Levels count from 1
                            // Level 0 is reserved for CAPTION

                            // Seitenzahl und ggfs. davorstehenden Tabstop entfernen:
                            FormTokenType eType;
                            SwFormTokenEnumerator aEnumer =
                                aForm.CreateTokenEnumerator( nLevel );
                            do
                            {
                                eType = aEnumer.GetNextTokenType();
                                switch( eType )
                                {
                                    case TOKEN_PAGE_NUMS:
                                    {
                                        aEnumer.RemoveCurToken();
                                        if( TOKEN_TAB_STOP
                                            == aEnumer.GetPrevTokenType() )
                                        {
                                            aEnumer.RemoveCurToken();
                                            aForm.SetPattern( nLevel,
                                                    aEnumer.GetPattern() );
                                        }
                                        eType = TOKEN_END;
                                        break;
                                    }
                                }
                            }
                            while( TOKEN_END != eType );
                        }
                        pBase->SetTOXForm( aForm );
                    }
                    break;

                /*
                // the following switches are not (yet) supported
                // by good old StarWriter:
                case 'b':
                case 's':
                case 'd':
                    break;
                */
                }
            }
            if( !nMaxLevel )
                nMaxLevel = MAXLEVEL;
            pBase->SetLevel( nMaxLevel );

            const TOXTypes eType = pBase->GetTOXType()->GetType();
            switch( eType )
            {
                case TOX_CONTENT:
                    if( eCreateFrom )
                        pBase->SetCreate( eCreateFrom );
                    break;
                case TOX_ILLUSTRATIONS:
                    if( !eCreateFrom )
                        eCreateFrom = TOX_SEQUENCE;
                    pBase->SetCreate( eCreateFrom );
                    break;
            }
        }
        break;
    case TOX_USER:
        break;
    } // ToxBase fertig

    // Update fuer TOX anstossen
    rDoc.SetUpdateTOX( TRUE );

    const SwPosition* pPos = pPaM->GetPoint();

    SwFltTOX aFltTOX( pBase, nIndexCols );

    // test if there is already a break item on this node
    SwCntntNode* pNd = pPos->nNode.GetNode().GetCntntNode();
    if( pNd )
    {
        const SfxItemSet* pSet = pNd->GetpSwAttrSet();
        if( pSet )
        {
            if( SFX_ITEM_SET == pSet->GetItemState( RES_BREAK, FALSE ) )
                aFltTOX.SetHadBreakItem( TRUE );
            if( SFX_ITEM_SET == pSet->GetItemState( RES_PAGEDESC, FALSE ) )
                aFltTOX.SetHadPageDescItem( TRUE );
        }
    }

    // Setze Anfang in Stack
    pEndStck->NewAttr( *pPos, aFltTOX );
    if( 1 < nIndexCols )
        bDontCreateSep = TRUE;

    // Setze Ende in Stack
    pEndStck->SetAttr( *pPos, RES_FLTR_TOX );

    return F_OK;
}

eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* pF, String& rStr )
{
    eF_ResT eRet = F_OK;
    String sURL, sTarget, sMark;
    BOOL bDataImport=FALSE;

    // JP 02.12.98: es gibt Hyperlink-Felder, die am Ende eine '\x01' stehen
    //              haben. Die wollen wir aber nicht beachten
    /*
    if( pStr[ pF->nLCode - 1 ] < ' ' )
        pStr[ pF->nLCode - 1 ] = 0;
    */



/*
    //caolan
    if( rStr.GetChar( pF->nLCode - 1 ) < ' ' )
    {
#if DEBUG
        if( 0x01 == rStr.GetChar( pF->nLCode-1 ) )
            bDataImport=ImportURL( sURL, sMark, pF->nSCode + pF->nLCode-1 );
#endif
        rStr.SetChar( pF->nLCode - 1, 0 );
    }
*/

    rStr.EraseTrailingChars( 1 );



    if (!bDataImport)
    {
        long nRet;
        _ReadFieldParams aReadParam( rStr );
        while( -1 != ( nRet = aReadParam.SkipToNextToken() ))
            switch( nRet )
            {
            case -2:
                if( !sURL.Len() )
                {
                    ConvertFFileName( sURL, aReadParam.GetResult() );
                    sURL = INetURLObject::RelToAbs( sURL );
                }
                break;

            case 'n':
                sTarget = WW8_ASCII2STR( "_blank" );
                break;

            case 'l':
                nRet = aReadParam.SkipToNextToken();
                if( -2 == nRet )
                {
                    sMark = aReadParam.GetResult();
                    if( sMark.Len() && '"' == sMark.GetChar( sMark.Len()-1 ))
                        sMark.Erase( sMark.Len() - 1 );

                }
                break;

            case 'h':
            case 'm':
            case 's':
            case 't':
                ASSERT( !this, "Auswertung fehlt noch - Daten unbekannt" );
                break;
            }
    }

    String sDef( GetFieldResult( pF ) );                // das Resultat uebernehmen
    if( ( sURL.Len() || sMark.Len() ) && sDef.Len() )
    {
        if( sMark.Len() )
            ( sURL += INET_MARK_TOKEN ) += sMark;
        SwFmtINetFmt aURL( sURL, sTarget );
//      aURL.SetVisitedFmt( "??" );
//      aURL.SetINetFmt( "??" );
        pEndStck->NewAttr( *pPaM->GetPoint(), aURL );

        // das Ende als "relative" Pos auf den Stack setzen
        pPaM->SetMark();
        pPaM->GetMark()->nContent += sDef.Len();
        pEndStck->SetAttr( *pPaM->GetMark(), RES_TXTATR_INETFMT, FALSE );
        pPaM->DeleteMark();
        eRet = F_TEXT;
    }
    return eRet;
}


void SwWW8ImplReader::ImportTox( int nFldId, String aStr )
{
    BOOL bIdx = ( nFldId != 9 );
    TOXTypes eTox = ( !bIdx ) ? TOX_CONTENT : TOX_INDEX;    // Default

    USHORT nLevel = 1;

    xub_StrLen n;
    String sKey1;
    long nRet;
    _ReadFieldParams aReadParam( aStr );
    while( -1 != ( nRet = aReadParam.SkipToNextToken() ))
        switch( nRet )
        {
        case -2:
            if( !sKey1.Len() )
            {
                sKey1 = aReadParam.GetResult().GetToken(0, ':');
                if( !sKey1.Len() )
                    sKey1 = aReadParam.GetResult(); // PrimaryKey ohne ":", 2nd dahinter
            }
            break;

        case 'f':
            n = aReadParam.GoToTokenParam();
            if( STRING_NOTFOUND != n )
            {
                String sParams( aReadParam.GetResult() );
                if( 'C' != sParams.GetChar(0) && 'c' != sParams.GetChar(0) )
                    eTox = TOX_USER;
            }
            break;

        case 'l':
            n = aReadParam.GoToTokenParam();
            if( STRING_NOTFOUND != n )
            {
                String sParams( aReadParam.GetResult() );
                if(    sParams.Len() // if NO String just ignore the \l
                    && sParams.GetChar( 0 ) > '0'
                    && sParams.GetChar( 0 ) <= '9' )
                {
                    nLevel = (USHORT)sParams.ToInt32();
                }
            }
            break;
        }


/*
    WW8FldParaGuess aG( pStr, ( bIdx ) ? 0 : "fl" );
    const char* pFld = (const char*)aG.GetStdPara();
    if( !aG.Ok() || !pFld )
        return;

    char* pKey1 = (char*)strchr( pFld, ':' );
    if( pKey1 )
    {
        *pKey1++ = '\0';
    }

    USHORT nLevel = 1;

    if( !bIdx ){                            // Inhalts- oder Abbildungsverzeichnis
        const unsigned char* pFlg = aG.GetSwitch( 0 );// Switch 'f'
        if( pFlg && toupper(*pFlg) != 'C' )
            eTox = TOX_USER;                // z.B. F = Abbildungsverzeichnis
        pFlg = aG.GetSwitch( 1 );           // Switch 'l'
        if( pFlg && *pFlg > '0' && *pFlg <= '9' )
            nLevel = *pFlg - '0';
    }
*/
    ASSERT( rDoc.GetTOXTypeCount( eTox ), "Doc.GetTOXTypeCount() == 0  :-(" );

    const SwTOXType* pT = rDoc.GetTOXType( eTox, 0 );
    SwTOXMark aM( pT );
    if( eTox != TOX_INDEX )
        aM.SetLevel( nLevel );

    if( sKey1.Len() )
    {
        aM.SetAlternativeText( sKey1 );     // WW/SW: unterschiedliche Reihenfolge
                                            // Text mit Key1 tauschen
        aM.SetPrimaryKey( aStr );

    }
    else
        aM.SetAlternativeText( aStr );

    if( !aM.IsAlternativeText() )
    {
        pPaM->SetMark();
        pPaM->GetMark()->nContent += aStr.Len();
    }
    rDoc.Insert( *pPaM, aM );
    if( !aM.IsAlternativeText() )
        pPaM->DeleteMark();
}

void SwWW8ImplReader::Read_FldVanish( USHORT, BYTE*, short nLen )
{
    // Vorsicht: Bei Feldnamen mit Umlauten geht das MEMICMP nicht!
    const static sal_Char *aFldNames[] = {  "\x06""INHALT", "\x02""XE", // dt.
                                            "\x02""TC"  };              // us
    const static BYTE  aFldId[] = { 9, 4, 9 };

    if( nIniFlags & WW8FL_NO_FLD )
        return;

    if( nLen < 0 )
    {
        bIgnoreText = FALSE;
        return;
    }

    // our methode was called from
    // ''Skip attributes of field contents'' loop within ReadTextAttr()
    if( bIgnoreText )
        return;

    bIgnoreText = TRUE;
    long nOldPos = pStrm->Tell();
    USHORT nFieldLen;

    WW8_CP nStartCp = pSBase->WW8Fc2Cp( nOldPos );
    String sFieldName;
    nFieldLen = pSBase->WW8ReadString( *pStrm, sFieldName, nStartCp,
                                         500, eStructCharSet );
    pStrm->Seek( nOldPos );

    xub_StrLen nC = 0;
    if( 0x13 != sFieldName.GetChar( nC )) // Field Start Mark
    {
        if( 0x15 == sFieldName.GetChar( nC ))       // Field End Mark found
            bIgnoreText = FALSE;
//      delete( pFieldName );
        return;                 // kein Feld zu finden
    }

    nC++;
    while( ' '  == sFieldName.GetChar( nC ))
        nC++;

    for( int i = 0; i < 2; i++ )
    {
        const sal_Char* pName = aFldNames[i];
        USHORT nNameLen = *pName++;
        if( sFieldName.EqualsIgnoreCaseAscii( pName, 0, nNameLen ) )
        {
            ImportTox( aFldId[i], sFieldName.Copy( nNameLen ) );
            break;                  // keine Mehrfachnennungen moeglich
        }
    }
    bIgnoreText = TRUE;
    pStrm->Seek( nOldPos );
}

// Read_Invisible ist fuer das "Unsichtbar"-Zeichenattribut. Mangels
// entsprechender Funktion im SW evtl. als Tag.
//
// ACHTUNG: Methode gelegentlich umstellen: unsichtbaren Text als
//                  *Feld* integrieren...
//
void SwWW8ImplReader::Read_Invisible( USHORT, BYTE* pData, short nLen )
{
    USHORT n = WWF_INVISIBLE;               // Bit-Nummer fuer Invisible
    USHORT nI = n / 32;                     // # des UINT32
    ULONG nMask = 1 << ( n % 32 );  // Maske fuer Bits

    if(    ( nFieldTagBad[    nI ] & nMask )
        || ( nFieldTagAlways[ nI ] & nMask ) )
    {
        String aTag( WW8_ASCII2STR( "{INVISIBLE " ) );

        if( nLen < 0 )
            aTag.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "END}" ) );
        else
            aTag.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "START}" ) );

        InsertTagField( n, aTag );
    }
}


/*************************************************************************

      Source Code Control System - Header

      $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/sw/source/filter/ww8/ww8par5.cxx,v 1.3 2000-10-25 14:19:04 khz Exp $


      Source Code Control System - Update

      $Log: not supported by cvs2svn $
      Revision 1.2  2000/10/06 13:11:18  jp
      should changes: don't use IniManager

      Revision 1.1.1.1  2000/09/18 17:14:58  hr
      initial import

      Revision 1.71  2000/09/18 16:05:01  willem.vandorp
      OpenOffice header added.

      Revision 1.70  2000/08/31 06:29:28  jp
      use CharClass instead of international

      Revision 1.69  2000/08/04 10:56:54  jp
      Soft-/HardHyphens & HardBlanks changed from attribute to unicode character

      Revision 1.68  2000/07/24 16:39:08  khz
      #75701# set Break or PageDesc item BEHIND TOX if not found before the #0x0C

      Revision 1.67  2000/06/26 12:59:11  os
      INetURLObject::SmartRelToAbs removed

      Revision 1.66  2000/06/15 15:57:31  khz
      Prevent FindParaStart() from calling rStr.GetChar() behind end of string

      Revision 1.65  2000/06/13 08:25:46  os
      using UCB

      Revision 1.64  2000/06/06 15:00:34  khz
      Changes for Unicode

      Revision 1.63  2000/05/18 10:59:02  jp
      Changes for Unicode

      Revision 1.62  2000/05/17 16:40:46  khz
      Changes for unicode (2)

      Revision 1.60  2000/05/16 12:03:45  jp
      Changes for unicode

      Revision 1.59  2000/05/16 11:06:28  khz
      Unicode code-conversion

      Revision 1.58  2000/05/08 09:25:49  khz
      Task #74474# Find TRUE end of field code in WW8FldParaGuess class

      Revision 1.57  2000/05/05 16:07:41  khz
      Task #74474# don't create Sections while skipping result of multi-column index-field

      Revision 1.56  2000/03/27 11:44:40  cmc
      #74329# Added OCX Field Reader

      Revision 1.55  2000/03/22 09:55:35  khz
      Task #74378# release memory that was allocated by FindPara()

      Revision 1.54  2000/02/18 09:38:12  cmc
      #69372# Improved Hyperlink Importing for WW97

      Revision 1.53  2000/02/11 14:40:28  hr
      #70473# changes for unicode ( patched by automated patchtool )

      Revision 1.52  2000/01/17 11:22:15  khz
      Task #62941# import DateTime as single field (before 2 field separated by space)

      Revision 1.51  2000/01/11 10:17:43  khz
      Task #62941# import different formats for date- and time-fields

      Revision 1.50  2000/01/04 16:48:36  khz
      Task #70863# Indexes: parameter >> \e '0x09' << shows page-num at right col-margin

      Revision 1.49  1999/12/23 17:01:22  khz
      Task #70788# *De*activate bIgnoreText in Read_FldVanish() when 0x15 reached

      Revision 1.48  1999/12/21 09:25:48  khz
      Task #71111# Prevent from reading CONTENT when skiping field attributes

      Revision 1.47  1999/12/06 09:35:05  khz
      Task #70486# Now \t param on INDEX field may have one single NAME (without LEVEL)

      Revision 1.46  1999/12/02 16:39:28  khz
      Task #69857# Removed TOI_FF from default TOX_INDEX flags

      Revision 1.45  1999/11/26 12:51:17  khz
      Task #69898# TOC parameter \o will include *all* levels when no levels specified

      Revision 1.44  1999/11/26 12:27:21  khz
      Task #69892# TOC parameter \n will modify *all* levels when no levels specified

      Revision 1.43  1999/11/02 15:59:45  khz
      import new TOX_CONTENT and TOX_INDEX features (2)

      Revision 1.42  1999/10/29 12:07:39  khz
      import new TOX_CONTENT and TOX_INDEX features

      Revision 1.41  1999/10/13 21:09:26  khz
      Import Table Of Contents (0)

      Revision 1.40  1999/08/30 19:53:08  JP
      Bug #68219#: no static members - be reentrant


      Rev 1.39   30 Aug 1999 21:53:08   JP
   Bug #68219#: no static members - be reentrant

      Rev 1.38   09 Aug 1999 14:16:12   JP
   read W95 format from stream

      Rev 1.37   30 Jul 1999 17:53:36   KHZ
   Task #62955# name matching for docinfo fields (1)

      Rev 1.36   27 Jul 1999 11:23:44   KHZ
   Task #62941# find number format for date/time fields

      Rev 1.35   15 Jul 1999 19:03:48   JP
   Read_Field: if read only result then skip one char more back

      Rev 1.34   07 Jul 1999 08:08:20   OS
   extended indexes: Index names in ShellRes

      Rev 1.33   21 Jun 1999 12:16:12   KHZ
   Reference field (page, bookmark, footnote) part#2

      Rev 1.32   18 Jun 1999 15:53:52   KHZ
   Reference field (page, bookmark, footnote) part#1

      Rev 1.31   03 Jun 1999 16:59:56   KHZ
   Task #66418# UEberfluessiges ''xStrm->Seek( nOldPos );'' entfernt

      Rev 1.30   02 Jun 1999 09:32:24   KHZ
   Task #66227# a) kein Unicode bei Ver67 ;-)  b) Grafik in grupp. Textbox

      Rev 1.29   27 Apr 1999 14:39:10   KHZ
   Task #65353# ueberfluessiges AppendTxtNode in Read_F_IncludeText entfernt


      Rev 1.28   26 Apr 1999 19:22:54   JP
   Bug #65298#: Grf/Ole bei Zeichenbindung immer Oben zu Grundline anordnen

      Rev 1.27   18 Feb 1999 12:44:38   KHZ
   Task #61675# Falsche Offsetberechnung bei ImportTox() in Read_FldVanish()

      Rev 1.26   23 Dec 1998 16:15:00   KHZ
   Task #60444# Inhaltverzeichnis jetzt auch bei fehlenden Switches

      Rev 1.25   15 Dec 1998 10:50:44   KHZ
   Tasks #59580# und #58766# (Nachzieher aus SRV506)

      Rev 1.24   07 Dec 1998 11:27:28   KHZ
   Task #58766# Unicode in benutzerdef. Verzeichnissen

      Rev 1.23   02 Dec 1998 20:06:34   JP
   Bug #60045#: Marks von Hyperlinks einlesen

      Rev 1.22   02 Dec 1998 11:41:06   KHZ
   Task #59834# ein vergessenes >>delete[]( pDef )><<

      Rev 1.21   24 Nov 1998 21:11:22   JP
   Task #59822#: OLE-Objecte einlesen

      Rev 1.20   19 Nov 1998 10:37:02   TRI
   OS2 Anpassungen

      Rev 1.19   18 Nov 1998 16:29:46   HR
   doppeltes const raus

      Rev 1.18   18 Nov 1998 10:33:28   KHZ
   Task #59078# Compilerfehler unter Unix

      Rev 1.17   17 Nov 1998 20:25:12   JP
   #58263# NumType durch SvxExtNumType ersetzt

      Rev 1.16   17 Nov 1998 20:05:56   JP
   Task #59476#: Seitenumrandung / Seitennummern / Seitennummernformat lesen

      Rev 1.15   17 Nov 1998 10:48:54   OS
   #58263# NumType durch SvxExtNumType ersetzt

      Rev 1.14   16 Nov 1998 18:59:18   KHZ
   Task #59078# Feldimport SEQ (fertig)

      Rev 1.13   16 Nov 1998 18:34:22   KHZ
   Task #59078# Feldimport SEQ (Teil 1)

      Rev 1.12   16 Nov 1998 13:19:52   JP
   Task #59476#: Hyperlinks lesen, ImportGrf vereinfacht, Bookmarks kein ToUpper

      Rev 1.11   05 Nov 1998 13:07:36   KHZ
   Task #58993# Befehl INCLUDEPICTURE liefert jetzt korrekten String

      Rev 1.10   30 Oct 1998 16:13:48   KHZ
   Task #57836# Beliebige Parameterreihenfolge bei Feld INCLUDEPICTURE moeglich

      Rev 1.9   30 Oct 1998 16:10:54   KHZ

      Rev 1.8   29 Oct 1998 15:12:24   KHZ
   Task #58620# GPF bei Feld EINFUEGENGRAFIK in Doc mit UNICODE

      Rev 1.7   15 Sep 1998 19:35:46   JP
   Bug #56310#: Teilfix - kein GPF mehr

      Rev 1.6   13 Sep 1998 15:50:22   HJS
   #56149# authorfield

      Rev 1.5   03 Sep 1998 22:16:14   KHZ
   Task #55189# Textboxen

      Rev 1.4   11 Aug 1998 14:39:46   KHZ
   Task #52607# neue Numerierungstypen (siehe auch WWPAR.CXX und Bug 54796)

      Rev 1.3   05 Aug 1998 09:32:08   KHZ
   Task #52607# Kodepflege

      Rev 1.2   30 Jun 1998 21:33:24   KHZ
   Header/Footer/Footnotes weitgehend ok

      Rev 1.1   23 Jun 1998 11:15:28   KHZ
   memicmp ersetzt durch MEMICMP

      Rev 1.0   16 Jun 1998 11:08:28   KHZ
   Initial revision.

*************************************************************************/