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
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org 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 version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
#include <vector>
#include <list>
#include <utility>
#include <algorithm>
#include <functional>
#include <iostream>
#if OSL_DEBUG_LEVEL > 1
#include <cstdio>
#endif
#include <hintids.hxx>
#include <comphelper/string.hxx>
#include <tools/urlobj.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/cmapitem.hxx>
#include <editeng/langitem.hxx>
#include <editeng/svxfont.hxx>
#include <editeng/lrspitem.hxx>
#include <editeng/brshitem.hxx>
#include <editeng/fontitem.hxx>
#include <editeng/keepitem.hxx>
#include <editeng/fhgtitem.hxx>
#include <editeng/ulspitem.hxx>
#include <editeng/brkitem.hxx>
#include <editeng/frmdiritem.hxx>
#include <editeng/tstpitem.hxx>
#include "svl/urihelper.hxx"
#include <svl/whiter.hxx>
#include <fmtpdsc.hxx>
#include <fmtfsize.hxx>
#include <fmtornt.hxx>
#include <fmtlsplt.hxx>
#include <fmtflcnt.hxx>
#include <fmtanchr.hxx>
#include <fmtcntnt.hxx>
#include <frmatr.hxx>
#include <paratr.hxx>
#include <txatbase.hxx>
#include <fmtinfmt.hxx>
#include <fmtrfmrk.hxx>
#include <fchrfmt.hxx>
#include <fmtautofmt.hxx>
#include <charfmt.hxx>
#include <tox.hxx>
#include <ndtxt.hxx>
#include <pam.hxx>
#include <doc.hxx>
#include <docary.hxx>
#include <swtable.hxx>
#include <swtblfmt.hxx>
#include <section.hxx>
#include <pagedesc.hxx>
#include <swrect.hxx>
#include <reffld.hxx>
#include <redline.hxx>
#include <wrtswtbl.hxx>
#include <htmltbl.hxx>
#include <txttxmrk.hxx>
#include <fmtline.hxx>
#include <fmtruby.hxx>
#include <breakit.hxx>
#include <txtatr.hxx>
#include <fmtsrnd.hxx>
#include <fmtrowsplt.hxx>
#include <com/sun/star/i18n/ScriptType.hdl>
#include <com/sun/star/i18n/WordType.hpp>
#include <writerfilter/doctok/sprmids.hxx>
#include "writerhelper.hxx"
#include "writerwordglue.hxx"
#include <numrule.hxx>
#include "wrtww8.hxx"
#include "ww8par.hxx"
#include <IMark.hxx>
#include "ww8attributeoutput.hxx"
#include <ndgrf.hxx>
#include <ndole.hxx>
#include <cstdio>
using namespace ::com::sun::star;
using namespace ::com::sun::star::i18n;
using namespace sw::util;
using namespace sw::types;
using namespace sw::mark;
using namespace nsFieldFlags;
static String lcl_getFieldCode( const IFieldmark* pFieldmark ) {
OSL_ENSURE(pFieldmark!=NULL, "where is my fieldmark???");
if ( !pFieldmark) {
return String();
} else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) ) {
return String::CreateFromAscii(" FORMTEXT ");
} else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) ) {
return String::CreateFromAscii(" FORMDROPDOWN ");
} else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) ) {
return String::CreateFromAscii(" FORMCHECKBOX ");
} else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_TOC ) ) ) {
return String::CreateFromAscii(" TOC ");
} else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_HYPERLINK ) ) ) {
return String::CreateFromAscii(" HYPERLINK ");
} else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_PAGEREF ) ) ) {
return String::CreateFromAscii(" PAGEREF ");
} else {
return pFieldmark->GetFieldname();
}
}
ww::eField lcl_getFieldId( const IFieldmark* pFieldmark ) {
OSL_ENSURE(pFieldmark!=NULL, "where is my fieldmark???");
if ( !pFieldmark ) {
return ww::eUNKNOWN;
} else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) ) {
return ww::eFORMTEXT;
} else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) ) {
return ww::eFORMDROPDOWN;
} else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ) ) {
return ww::eFORMCHECKBOX;
} else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_TOC ) ) ) {
return ww::eTOC;
} else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_HYPERLINK ) ) ) {
return ww::eHYPERLINK;
} else if ( pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_PAGEREF ) ) ) {
return ww::ePAGEREF;
} else {
return ww::eUNKNOWN;
}
}
MSWordAttrIter::MSWordAttrIter( MSWordExportBase& rExport )
: pOld( rExport.pChpIter ), m_rExport( rExport )
{
m_rExport.pChpIter = this;
}
MSWordAttrIter::~MSWordAttrIter()
{
m_rExport.pChpIter = pOld;
}
class sortswflys :
public std::binary_function<const sw::Frame&, const sw::Frame&, bool>
{
public:
bool operator()(const sw::Frame &rOne, const sw::Frame &rTwo) const
{
return rOne.GetPosition() < rTwo.GetPosition();
}
};
void SwWW8AttrIter::IterToCurrent()
{
OSL_ENSURE(maCharRuns.begin() != maCharRuns.end(), "Impossible");
mnScript = maCharRunIter->mnScript;
meChrSet = maCharRunIter->meCharSet;
mbCharIsRTL = maCharRunIter->mbRTL;
}
SwWW8AttrIter::SwWW8AttrIter(MSWordExportBase& rWr, const SwTxtNode& rTxtNd) :
MSWordAttrIter(rWr),
rNd(rTxtNd),
maCharRuns(GetPseudoCharRuns(rTxtNd, 0, !rWr.SupportsUnicode())),
pCurRedline(0),
nAktSwPos(0),
nCurRedlinePos(USHRT_MAX),
mrSwFmtDrop(rTxtNd.GetSwAttrSet().GetDrop())
{
SwPosition aPos(rTxtNd);
if (FRMDIR_HORI_RIGHT_TOP == rWr.pDoc->GetTextDirection(aPos))
mbParaIsRTL = true;
else
mbParaIsRTL = false;
maCharRunIter = maCharRuns.begin();
IterToCurrent();
/*
#i2916#
Get list of any graphics which may be anchored from this paragraph.
*/
maFlyFrms = GetFramesInNode(rWr.maFrames, rNd);
std::sort(maFlyFrms.begin(), maFlyFrms.end(), sortswflys());
/*
#i18480#
If we are inside a frame then anything anchored inside this frame can
only be supported by word anchored inline ("as character"), so force
this in the supportable case.
*/
if (rWr.SupportsUnicode() && rWr.bInWriteEscher)
{
std::for_each(maFlyFrms.begin(), maFlyFrms.end(),
std::mem_fun_ref(&sw::Frame::ForceTreatAsInline));
}
maFlyIter = maFlyFrms.begin();
if ( m_rExport.pDoc->GetRedlineTbl().Count() )
{
SwPosition aPosition( rNd, SwIndex( (SwTxtNode*)&rNd ) );
pCurRedline = m_rExport.pDoc->GetRedline( aPosition, &nCurRedlinePos );
}
nAktSwPos = SearchNext(1);
}
xub_StrLen lcl_getMinPos( xub_StrLen pos1, xub_StrLen pos2 )
{
xub_StrLen min = STRING_NOTFOUND;
if ( pos1 == STRING_NOTFOUND && pos2 != STRING_NOTFOUND )
min = pos2;
else if ( pos2 == STRING_NOTFOUND && pos1 != STRING_NOTFOUND )
min = pos1;
else if ( pos2 != STRING_NOTFOUND && pos2 != STRING_NOTFOUND )
{
if ( pos1 < pos2 )
min = pos1;
else
min = pos2;
}
return min;
}
xub_StrLen SwWW8AttrIter::SearchNext( xub_StrLen nStartPos )
{
xub_StrLen nPos;
xub_StrLen nMinPos = STRING_MAXLEN;
xub_StrLen i=0;
const String aTxt = rNd.GetTxt();
xub_StrLen fieldEndPos = aTxt.Search(CH_TXT_ATR_FIELDEND, nStartPos);
xub_StrLen fieldStartPos = aTxt.Search(CH_TXT_ATR_FIELDSTART, nStartPos);
xub_StrLen formElementPos = aTxt.Search(CH_TXT_ATR_FORMELEMENT, nStartPos);
xub_StrLen pos = lcl_getMinPos( fieldEndPos, fieldStartPos );
pos = lcl_getMinPos( pos, formElementPos );
if (pos!=STRING_NOTFOUND)
nMinPos=pos;
// first the redline, then the attributes
if( pCurRedline )
{
const SwPosition* pEnd = pCurRedline->End();
if (pEnd->nNode == rNd && ((i = pEnd->nContent.GetIndex()) >= nStartPos) && i < nMinPos )
nMinPos = i;
}
if ( nCurRedlinePos < m_rExport.pDoc->GetRedlineTbl().Count() )
{
// nCurRedlinePos point to the next redline
nPos = nCurRedlinePos;
if( pCurRedline )
++nPos;
for ( ; nPos < m_rExport.pDoc->GetRedlineTbl().Count(); ++nPos )
{
const SwRedline* pRedl = m_rExport.pDoc->GetRedlineTbl()[ nPos ];
const SwPosition* pStt = pRedl->Start();
const SwPosition* pEnd = pStt == pRedl->GetPoint()
? pRedl->GetMark()
: pRedl->GetPoint();
if( pStt->nNode == rNd )
{
if( ( i = pStt->nContent.GetIndex() ) >= nStartPos &&
i < nMinPos )
nMinPos = i;
}
else
break;
if( pEnd->nNode == rNd &&
( i = pEnd->nContent.GetIndex() ) < nMinPos &&
i >= nStartPos )
nMinPos = i;
}
}
if (mrSwFmtDrop.GetWholeWord() && nStartPos <= rNd.GetDropLen(0))
nMinPos = rNd.GetDropLen(0);
else if(nStartPos <= mrSwFmtDrop.GetChars())
nMinPos = mrSwFmtDrop.GetChars();
if(const SwpHints* pTxtAttrs = rNd.GetpSwpHints())
{
// kann noch optimiert werden, wenn ausgenutzt wird, dass die TxtAttrs
// nach der Anfangsposition geordnet sind. Dann muessten
// allerdings noch 2 Indices gemerkt werden
for( i = 0; i < pTxtAttrs->Count(); i++ )
{
const SwTxtAttr* pHt = (*pTxtAttrs)[i];
nPos = *pHt->GetStart(); // gibt erstes Attr-Zeichen
if( nPos >= nStartPos && nPos <= nMinPos )
nMinPos = nPos;
if( pHt->GetEnd() ) // Attr mit Ende
{
nPos = *pHt->GetEnd(); // gibt letztes Attr-Zeichen + 1
if( nPos >= nStartPos && nPos <= nMinPos )
nMinPos = nPos;
}
if (pHt->HasDummyChar())
{
// pos + 1 because of CH_TXTATR in Text
nPos = *pHt->GetStart() + 1;
if( nPos >= nStartPos && nPos <= nMinPos )
nMinPos = nPos;
}
}
}
if (maCharRunIter != maCharRuns.end())
{
if (maCharRunIter->mnEndPos < nMinPos)
nMinPos = maCharRunIter->mnEndPos;
IterToCurrent();
}
/*
#i2916#
Check to see if there are any graphics anchored to characters in this
paragraph's text. Set nMinPos to 1 past the placement for anchored to
character because anchors in Word appear after the character they are
anchored to.
*/
if (maFlyIter != maFlyFrms.end())
{
const SwPosition &rAnchor = maFlyIter->GetPosition();
nPos = rAnchor.nContent.GetIndex();
if (nPos >= nStartPos && nPos <= nMinPos)
nMinPos = nPos;
if (maFlyIter->GetFrmFmt().GetAnchor().GetAnchorId() == FLY_AT_CHAR)
{
++nPos;
if (nPos >= nStartPos && nPos <= nMinPos)
nMinPos = nPos;
}
}
//nMinPos found and not going to change at this point
if (maCharRunIter != maCharRuns.end())
{
if (maCharRunIter->mnEndPos == nMinPos)
++maCharRunIter;
}
return nMinPos;
}
bool lcl_isFontsizeItem( const SfxPoolItem& rItem )
{
return ( rItem.Which( ) == RES_CHRATR_FONTSIZE ||
rItem.Which( ) == RES_CHRATR_CJK_FONTSIZE ||
rItem.Which( ) == RES_CHRATR_CTL_FONTSIZE );
}
void SwWW8AttrIter::OutAttr( xub_StrLen nSwPos, bool bRuby )
{
m_rExport.AttrOutput().RTLAndCJKState( IsCharRTL(), GetScript() );
/*
Depending on whether text is in CTL/CJK or Western, get the id of that
script, the idea is that the font that is actually in use to render this
range of text ends up in pFont
*/
sal_uInt16 nFontId = GetWhichOfScript( RES_CHRATR_FONT, GetScript() );
const SvxFontItem &rParentFont = ItemGet<SvxFontItem>(
(const SwTxtFmtColl&)rNd.GetAnyFmtColl(), nFontId);
const SvxFontItem *pFont = &rParentFont;
SfxItemSet aExportSet(*rNd.GetSwAttrSet().GetPool(),
RES_CHRATR_BEGIN, RES_TXTATR_END - 1);
//The hard formatting properties that affect the entire paragraph
if (rNd.HasSwAttrSet())
{
sal_Bool bDeep = sal_False;
// only copy hard attributes - bDeep = false
aExportSet.Set(rNd.GetSwAttrSet(), bDeep);
// get the current font item. Use rNd.GetSwAttrSet instead of aExportSet:
const SvxFontItem &rNdFont = ItemGet<SvxFontItem>(rNd.GetSwAttrSet(), nFontId);
pFont = &rNdFont;
aExportSet.ClearItem(nFontId);
}
//The additional hard formatting properties that affect this range in the
//paragraph
sw::PoolItems aRangeItems;
if (const SwpHints* pTxtAttrs = rNd.GetpSwpHints())
{
for (xub_StrLen i = 0; i < pTxtAttrs->Count(); ++i)
{
const SwTxtAttr* pHt = (*pTxtAttrs)[i];
const xub_StrLen* pEnd = pHt->GetEnd();
if (pEnd ? ( nSwPos >= *pHt->GetStart() && nSwPos < *pEnd)
: nSwPos == *pHt->GetStart() )
{
sal_uInt16 nWhich = pHt->GetAttr().Which();
if (nWhich == RES_TXTATR_AUTOFMT)
{
const SwFmtAutoFmt& rAutoFmt = static_cast<const SwFmtAutoFmt&>(pHt->GetAttr());
const boost::shared_ptr<SfxItemSet> pSet = rAutoFmt.GetStyleHandle();
SfxWhichIter aIter( *pSet );
const SfxPoolItem* pItem;
sal_uInt16 nWhichId = aIter.FirstWhich();
while( nWhichId )
{
if( SFX_ITEM_SET == pSet->GetItemState( nWhichId, sal_False, &pItem ))
{
if (nWhichId == nFontId)
pFont = &(item_cast<SvxFontItem>(*pItem));
else
aRangeItems[nWhichId] = pItem;
}
nWhichId = aIter.NextWhich();
}
}
else
aRangeItems[nWhich] = (&(pHt->GetAttr()));
}
else if (nSwPos < *pHt->GetStart())
break;
}
}
/*
For #i24291# we need to explictly remove any properties from the
aExportSet which a SwCharFmt would override, we can't rely on word doing
this for us like writer does
*/
const SwFmtCharFmt *pCharFmtItem =
HasItem< SwFmtCharFmt >( aRangeItems, RES_TXTATR_CHARFMT );
if ( pCharFmtItem )
ClearOverridesFromSet( *pCharFmtItem, aExportSet );
sw::PoolItems aExportItems;
GetPoolItems( aExportSet, aExportItems, false );
sw::cPoolItemIter aEnd = aRangeItems.end();
for ( sw::cPoolItemIter aI = aRangeItems.begin(); aI != aEnd; ++aI )
{
if ( !bRuby || !lcl_isFontsizeItem( *aI->second ) )
aExportItems[aI->first] = aI->second;
}
if ( !aExportItems.empty() )
{
const SwModify* pOldMod = m_rExport.pOutFmtNode;
m_rExport.pOutFmtNode = &rNd;
m_rExport.m_aCurrentCharPropStarts.push( nSwPos );
m_rExport.ExportPoolItemsToCHP( aExportItems, GetScript() );
// HasTextItem nur in dem obigen Bereich erlaubt
m_rExport.m_aCurrentCharPropStarts.pop();
m_rExport.pOutFmtNode = pOldMod;
}
OSL_ENSURE( pFont, "must be *some* font associated with this txtnode" );
if ( pFont )
{
SvxFontItem aFont( *pFont );
/*
If we are a nonunicode aware format then we set the charset we want to
use for export of this range. If necessary this will generate a pseudo
font to use for this range.
So now we are guaranteed to have a font with the correct charset set
for WW6/95 which will match the script we have exported this range in,
this makes older nonunicode aware versions of word display the correct
characters.
*/
if ( !m_rExport.SupportsUnicode() )
aFont.SetCharSet( GetCharSet() );
if ( rParentFont != aFont )
m_rExport.AttrOutput().OutputItem( aFont );
}
}
void SwWW8AttrIter::OutFlys(xub_StrLen nSwPos)
{
/*
#i2916#
May have an anchored graphic to be placed, loop through sorted array
and output all at this position
*/
while ( maFlyIter != maFlyFrms.end() )
{
const SwPosition &rAnchor = maFlyIter->GetPosition();
xub_StrLen nPos = rAnchor.nContent.GetIndex();
if ( nPos != nSwPos )
break;
else
{
m_rExport.AttrOutput().OutputFlyFrame( *maFlyIter );
++maFlyIter;
}
}
}
bool SwWW8AttrIter::IsTxtAttr( xub_StrLen nSwPos )
{
// search for attrs with CH_TXTATR
if (const SwpHints* pTxtAttrs = rNd.GetpSwpHints())
{
for (sal_uInt16 i = 0; i < pTxtAttrs->Count(); ++i)
{
const SwTxtAttr* pHt = (*pTxtAttrs)[i];
if ( pHt->HasDummyChar() && (*pHt->GetStart() == nSwPos) )
return true;
}
}
return false;
}
bool SwWW8AttrIter::IsDropCap( int nSwPos )
{
// see if the current position falls on a DropCap
int nDropChars = mrSwFmtDrop.GetChars();
bool bWholeWord = mrSwFmtDrop.GetWholeWord();
if (bWholeWord)
{
short nWordLen = rNd.GetDropLen(0);
if(nSwPos == nWordLen && nSwPos != 0)
return true;
}
else
{
if (nSwPos == nDropChars && nSwPos != 0)
return true;
}
return false;
}
bool SwWW8AttrIter::RequiresImplicitBookmark()
{
SwImplBookmarksIter bkmkIterEnd = m_rExport.maImplicitBookmarks.end();
for ( SwImplBookmarksIter aIter = m_rExport.maImplicitBookmarks.begin(); aIter != bkmkIterEnd; ++aIter )
{
sal_uLong sample = aIter->second;
if ( sample == rNd.GetIndex() )
return true;
}
return false;
}
// HasItem ist fuer die Zusammenfassung des Doppel-Attributes Underline
// und WordLineMode als TextItems. OutAttr() ruft die Ausgabefunktion,
// die dann ueber HasItem() nach anderen Items an der
// Attribut-Anfangposition fragen kann.
// Es koennen nur Attribute mit Ende abgefragt werden.
// Es wird mit bDeep gesucht
const SfxPoolItem* SwWW8AttrIter::HasTextItem( sal_uInt16 nWhich ) const
{
const SfxPoolItem* pRet = 0;
const SwpHints* pTxtAttrs = rNd.GetpSwpHints();
if (pTxtAttrs && m_rExport.m_aCurrentCharPropStarts.size())
{
xub_StrLen nTmpSwPos = m_rExport.m_aCurrentCharPropStarts.top();
for (sal_uInt16 i = 0; i < pTxtAttrs->Count(); ++i)
{
const SwTxtAttr* pHt = (*pTxtAttrs)[i];
const SfxPoolItem* pItem = &pHt->GetAttr();
const xub_StrLen* pAtrEnd = 0;
if( 0 != ( pAtrEnd = pHt->GetEnd() ) && // nur Attr mit Ende
nWhich == pItem->Which() && //
nTmpSwPos >= *pHt->GetStart() && nTmpSwPos < *pAtrEnd )
{
pRet = pItem; // gefunden
break;
}
else if (nTmpSwPos < *pHt->GetStart())
break; // dann kommt da nichts mehr
}
}
return pRet;
}
void WW8Export::GetCurrentItems(ww::bytes &rItems) const
{
rItems.insert(rItems.end(), pO->begin(), pO->end());
}
const SfxPoolItem& SwWW8AttrIter::GetItem(sal_uInt16 nWhich) const
{
const SfxPoolItem* pRet = HasTextItem(nWhich);
return pRet ? *pRet : rNd.SwCntntNode::GetAttr(nWhich);
}
void WW8AttributeOutput::StartRuby( const SwTxtNode& rNode, xub_StrLen /*nPos*/, const SwFmtRuby& rRuby )
{
String aStr( FieldString( ww::eEQ ) );
aStr.APPEND_CONST_ASC( "\\* jc" );
sal_Int32 nJC = 0;
sal_Char cDirective = 0;
switch ( rRuby.GetAdjustment() )
{
case 0:
nJC = 3;
cDirective = 'l';
break;
case 1:
//defaults to 0
break;
case 2:
nJC = 4;
cDirective = 'r';
break;
case 3:
nJC = 1;
cDirective = 'd';
break;
case 4:
nJC = 2;
cDirective = 'd';
break;
default:
OSL_ENSURE( !this,"Unhandled Ruby justication code" );
break;
}
aStr += String::CreateFromInt32( nJC );
/*
MS needs to know the name and size of the font used in the ruby item,
but we coud have written it in a mixture of asian and western
scripts, and each of these can be a different font and size than the
other, so we make a guess based upon the first character of the text,
defaulting to asian.
*/
sal_uInt16 nRubyScript;
if( pBreakIt->GetBreakIter().is() )
nRubyScript = pBreakIt->GetBreakIter()->getScriptType( rRuby.GetText(), 0);
else
nRubyScript = i18n::ScriptType::ASIAN;
const SwTxtRuby* pRubyTxt = rRuby.GetTxtRuby();
const SwCharFmt* pFmt = pRubyTxt ? pRubyTxt->GetCharFmt() : 0;
String sFamilyName;
long nHeight;
if ( pFmt )
{
const SvxFontItem &rFont = ItemGet< SvxFontItem >( *pFmt,
GetWhichOfScript(RES_CHRATR_FONT,nRubyScript) );
sFamilyName = rFont.GetFamilyName();
const SvxFontHeightItem &rHeight = ItemGet< SvxFontHeightItem >( *pFmt,
GetWhichOfScript( RES_CHRATR_FONTSIZE, nRubyScript ) );
nHeight = rHeight.GetHeight();
}
else
{
/*Get defaults if no formatting on ruby text*/
const SfxItemPool *pPool = rNode.GetSwAttrSet().GetPool();
pPool = pPool ? pPool : &m_rWW8Export.pDoc->GetAttrPool();
const SvxFontItem &rFont = DefaultItemGet< SvxFontItem >( *pPool,
GetWhichOfScript( RES_CHRATR_FONT,nRubyScript ) );
sFamilyName = rFont.GetFamilyName();
const SvxFontHeightItem &rHeight = DefaultItemGet< SvxFontHeightItem >
( *pPool, GetWhichOfScript( RES_CHRATR_FONTSIZE, nRubyScript ) );
nHeight = rHeight.GetHeight();
}
nHeight = (nHeight + 5)/10;
aStr.APPEND_CONST_ASC( " \\* \"Font:" );
aStr.Append( sFamilyName );
aStr.APPEND_CONST_ASC( "\" \\* hps" );
aStr += String::CreateFromInt32( nHeight );
aStr.APPEND_CONST_ASC( " \\o" );
if ( cDirective )
{
aStr.APPEND_CONST_ASC( "\\a" );
aStr.Append( cDirective );
}
aStr.APPEND_CONST_ASC( "(\\s\\up " );
if ( pBreakIt->GetBreakIter().is() )
nRubyScript = pBreakIt->GetBreakIter()->getScriptType( rNode.GetTxt(),
*( pRubyTxt->GetStart() ) );
else
nRubyScript = i18n::ScriptType::ASIAN;
const SwAttrSet& rSet = rNode.GetSwAttrSet();
const SvxFontHeightItem &rHeightItem =
( const SvxFontHeightItem& )rSet.Get(
GetWhichOfScript( RES_CHRATR_FONTSIZE, nRubyScript ) );
nHeight = (rHeightItem.GetHeight() + 10)/20-1;
aStr += String::CreateFromInt32(nHeight);
aStr += '(';
aStr += rRuby.GetText();
aStr.APPEND_CONST_ASC( ")" );
// The parameter separator depends on the FIB.lid
if ( m_rWW8Export.pFib->getNumDecimalSep() == '.' )
aStr.APPEND_CONST_ASC( "," );
else
aStr.APPEND_CONST_ASC( ";" );
m_rWW8Export.OutputField( 0, ww::eEQ, aStr,
WRITEFIELD_START | WRITEFIELD_CMD_START );
}
void WW8AttributeOutput::EndRuby()
{
m_rWW8Export.WriteChar( ')' );
m_rWW8Export.OutputField( 0, ww::eEQ, aEmptyStr, WRITEFIELD_END | WRITEFIELD_CLOSE );
}
/*#i15387# Better ideas welcome*/
String &TruncateBookmark( String &rRet )
{
if ( rRet.Len() > 40 )
rRet.Erase( 40 );
OSL_ENSURE( rRet.Len() <= 40, "Word cannot have bookmarks longer than 40 chars" );
return rRet;
}
bool AttributeOutputBase::AnalyzeURL( const String& rUrl, const String& /*rTarget*/, String* pLinkURL, String* pMark )
{
bool bBookMarkOnly = false;
INetURLObject aURL( rUrl );
String sMark;
String sURL;
if ( rUrl.Len() > 1 && rUrl.GetChar(0) == INET_MARK_TOKEN )
{
sMark = BookmarkToWriter( rUrl.Copy(1) );
xub_StrLen nPos = sMark.SearchBackward( cMarkSeperator );
String sRefType(comphelper::string::remove(sMark.Copy(nPos+1), ' '));
// #i21465# Only interested in outline references
if ( sRefType.EqualsAscii( pMarkToOutline ) )
{
String sLink = sMark.Copy(0, nPos);
SwImplBookmarksIter bkmkIterEnd = GetExport().maImplicitBookmarks.end();
for ( SwImplBookmarksIter aIter = GetExport().maImplicitBookmarks.begin(); aIter != bkmkIterEnd; ++aIter )
{
String bkmkName = aIter->first;
if ( bkmkName == sLink )
{
sMark = String( RTL_CONSTASCII_USTRINGPARAM( "_toc" ) );
sMark += String::CreateFromInt32( aIter->second );
}
}
}
}
else
{
sURL = aURL.GetURLNoMark( INetURLObject::DECODE_UNAMBIGUOUS );
sMark = aURL.GetMark( INetURLObject::DECODE_UNAMBIGUOUS );
}
if ( sMark.Len() && !sURL.Len() )
bBookMarkOnly = true;
*pMark = sMark;
*pLinkURL = sURL;
return bBookMarkOnly;
}
bool WW8AttributeOutput::AnalyzeURL( const String& rUrl, const String& rTarget, String* pLinkURL, String* pMark )
{
bool bBookMarkOnly = AttributeOutputBase::AnalyzeURL( rUrl, rTarget, pLinkURL, pMark );
String sURL = *pLinkURL;
String sMark = *pMark;
if ( sURL.Len() )
sURL = URIHelper::simpleNormalizedMakeRelative( m_rWW8Export.GetWriter().GetBaseURL(), sURL );
if ( bBookMarkOnly )
sURL = FieldString( ww::eHYPERLINK );
else
{
String sFld( FieldString( ww::eHYPERLINK ) );
sFld.APPEND_CONST_ASC( "\"" );
sURL.Insert( sFld, 0 );
sURL += '\"';
}
if ( sMark.Len() )
( ( sURL.APPEND_CONST_ASC( " \\l \"" ) ) += sMark ) += '\"';
if ( rTarget.Len() )
( sURL.APPEND_CONST_ASC( " \\n " ) ) += rTarget;
*pLinkURL = sURL;
*pMark = sMark;
return bBookMarkOnly;
}
bool WW8AttributeOutput::StartURL( const String &rUrl, const String &rTarget )
{
// hyperlinks only in WW8
if ( !m_rWW8Export.bWrtWW8 )
return false;
INetURLObject aURL( rUrl );
String sURL;
String sMark;
bool bBookMarkOnly = AnalyzeURL( rUrl, rTarget, &sURL, &sMark );
m_rWW8Export.OutputField( 0, ww::eHYPERLINK, sURL, WRITEFIELD_START | WRITEFIELD_CMD_START );
// write the refence to the "picture" structure
sal_uLong nDataStt = m_rWW8Export.pDataStrm->Tell();
m_rWW8Export.pChpPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell() );
// WinWord 2000 doesn't write this - so its a temp solution by W97 ?
m_rWW8Export.WriteChar( 0x01 );
static sal_uInt8 aArr1[] = {
0x03, 0x6a, 0,0,0,0, // sprmCPicLocation
0x06, 0x08, 0x01, // sprmCFData
0x55, 0x08, 0x01, // sprmCFSpec
0x02, 0x08, 0x01 // sprmCFFldVanish
};
sal_uInt8* pDataAdr = aArr1 + 2;
Set_UInt32( pDataAdr, nDataStt );
m_rWW8Export.pChpPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), sizeof( aArr1 ), aArr1 );
m_rWW8Export.OutputField( 0, ww::eHYPERLINK, sURL, WRITEFIELD_CMD_END );
// now write the picture structur
sURL = aURL.GetURLNoMark();
// Compare the URL written by AnalyzeURL with the original one to see if
// the output URL is absolute or relative.
String sRelativeURL;
if ( rUrl.Len() )
sRelativeURL = URIHelper::simpleNormalizedMakeRelative( m_rWW8Export.GetWriter().GetBaseURL(), rUrl );
bool bAbsolute = sRelativeURL.Equals( rUrl );
static sal_uInt8 aURLData1[] = {
0,0,0,0, // len of struct
0x44,0, // the start of "next" data
0,0,0,0,0,0,0,0,0,0, // PIC-Structure!
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // |
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // |
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // |
0,0,0,0, // /
};
static sal_uInt8 MAGIC_A[] = {
// start of "next" data
0xD0,0xC9,0xEA,0x79,0xF9,0xBA,0xCE,0x11,
0x8C,0x82,0x00,0xAA,0x00,0x4B,0xA9,0x0B
};
m_rWW8Export.pDataStrm->Write( aURLData1, sizeof( aURLData1 ) );
/* Write HFD Structure */
sal_uInt8 nAnchor = 0x00;
if ( sMark.Len() )
nAnchor = 0x08;
m_rWW8Export.pDataStrm->Write( &nAnchor, 1 ); // HFDBits
m_rWW8Export.pDataStrm->Write( MAGIC_A, sizeof(MAGIC_A) ); //clsid
/* Write Hyperlink Object see [MS-OSHARED] spec*/
SwWW8Writer::WriteLong( *m_rWW8Export.pDataStrm, 0x00000002);
sal_uInt32 nFlag = bBookMarkOnly ? 0 : 0x01;
if ( bAbsolute )
nFlag |= 0x02;
if ( sMark.Len() )
nFlag |= 0x08;
SwWW8Writer::WriteLong( *m_rWW8Export.pDataStrm, nFlag );
INetProtocol eProto = aURL.GetProtocol();
if ( eProto == INET_PROT_FILE || eProto == INET_PROT_SMB )
{
// version 1 (for a document)
static sal_uInt8 MAGIC_C[] = {
0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46,
0x00, 0x00
};
static sal_uInt8 MAGIC_D[] = {
0xFF, 0xFF, 0xAD, 0xDE, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
// save the links to files as relative
sURL = URIHelper::simpleNormalizedMakeRelative( m_rWW8Export.GetWriter().GetBaseURL(), sURL );
if ( eProto == INET_PROT_FILE && sURL.EqualsAscii( "/", 0, 1 ) )
sURL = aURL.PathToFileName();
// special case for the absolute windows names
// (convert '/c:/foo/bar.doc' into 'c:\foo\bar.doc')
sal_Unicode aDrive = ( sURL.Len() > 1 )? sURL.GetChar( 1 ): 0;
if ( sURL.EqualsAscii( "/", 0, 1 ) &&
( ( aDrive >= 'A' && aDrive <= 'Z' ) || ( aDrive >= 'a' && aDrive <= 'z' ) ) &&
sURL.EqualsAscii( ":", 2, 1 ) )
{
sURL.Erase( 0, 1 );
sURL.SearchAndReplaceAll( '/', '\\' );
}
// n#261623 convert smb notation to '\\'
const char pSmb[] = "smb://";
if ( eProto == INET_PROT_SMB &&
sURL.EqualsAscii( pSmb, 0, sizeof( pSmb ) - 1 ) )
{
sURL.Erase( 0, sizeof( pSmb ) - 3 );
sURL.SearchAndReplaceAll( '/', '\\' );
}
m_rWW8Export.pDataStrm->Write( MAGIC_C, sizeof(MAGIC_C) );
SwWW8Writer::WriteLong( *m_rWW8Export.pDataStrm, sURL.Len()+1 );
SwWW8Writer::WriteString8( *m_rWW8Export.pDataStrm, sURL, true,
RTL_TEXTENCODING_MS_1252 );
m_rWW8Export.pDataStrm->Write( MAGIC_D, sizeof( MAGIC_D ) );
SwWW8Writer::WriteLong( *m_rWW8Export.pDataStrm, 2*sURL.Len() + 6 );
SwWW8Writer::WriteLong( *m_rWW8Export.pDataStrm, 2*sURL.Len() );
SwWW8Writer::WriteShort( *m_rWW8Export.pDataStrm, 3 );
SwWW8Writer::WriteString16( *m_rWW8Export.pDataStrm, sURL, false );
}
else if ( eProto != INET_PROT_NOT_VALID )
{
// version 2 (simple url)
// an write some data to the data stream, but dont ask
// what the data mean, except for the URL.
// The First piece is the WW8_PIC structure.
//
static sal_uInt8 MAGIC_B[] = {
0xE0,0xC9,0xEA,0x79,0xF9,0xBA,0xCE,0x11,
0x8C,0x82,0x00,0xAA,0x00,0x4B,0xA9,0x0B
};
m_rWW8Export.pDataStrm->Write( MAGIC_B, sizeof(MAGIC_B) );
SwWW8Writer::WriteLong( *m_rWW8Export.pDataStrm, 2 * ( sURL.Len() + 1 ) );
SwWW8Writer::WriteString16( *m_rWW8Export.pDataStrm, sURL, true );
}
if ( sMark.Len() )
{
SwWW8Writer::WriteLong( *m_rWW8Export.pDataStrm, sMark.Len()+1 );
SwWW8Writer::WriteString16( *m_rWW8Export.pDataStrm, sMark, true );
}
SwWW8Writer::WriteLong( *m_rWW8Export.pDataStrm, nDataStt,
m_rWW8Export.pDataStrm->Tell() - nDataStt );
return true;
}
bool WW8AttributeOutput::EndURL()
{
// hyperlinks only in WW8
if ( !m_rWW8Export.bWrtWW8 )
return false;
m_rWW8Export.OutputField( 0, ww::eHYPERLINK, aEmptyStr, WRITEFIELD_CLOSE );
return true;
}
String BookmarkToWord(const String &rBookmark)
{
String sRet(INetURLObject::encode(rBookmark,
INetURLObject::PART_REL_SEGMENT_EXTRA, '%',
INetURLObject::ENCODE_ALL, RTL_TEXTENCODING_ASCII_US));
return TruncateBookmark(sRet);
}
String BookmarkToWriter(const String &rBookmark)
{
return INetURLObject::decode(rBookmark, '%',
INetURLObject::DECODE_UNAMBIGUOUS, RTL_TEXTENCODING_ASCII_US);
}
void SwWW8AttrIter::OutSwFmtRefMark(const SwFmtRefMark& rAttr, bool)
{
if ( m_rExport.HasRefToObject( REF_SETREFATTR, &rAttr.GetRefName(), 0 ) )
m_rExport.AppendBookmark( m_rExport.GetBookmarkName( REF_SETREFATTR,
&rAttr.GetRefName(), 0 ));
}
void WW8AttributeOutput::FieldVanish( const String& rTxt, ww::eField /*eType*/ )
{
ww::bytes aItems;
m_rWW8Export.GetCurrentItems( aItems );
// sprmCFFldVanish
if ( m_rWW8Export.bWrtWW8 )
SwWW8Writer::InsUInt16( aItems, NS_sprm::LN_CFFldVanish );
else
aItems.push_back( 67 );
aItems.push_back( 1 );
sal_uInt16 nStt_sprmCFSpec = aItems.size();
// sprmCFSpec -- fSpec-Attribut true
if ( m_rWW8Export.bWrtWW8 )
SwWW8Writer::InsUInt16( aItems, 0x855 );
else
aItems.push_back( 117 );
aItems.push_back( 1 );
m_rWW8Export.WriteChar( '\x13' );
m_rWW8Export.pChpPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), aItems.size(),
aItems.data() );
m_rWW8Export.OutSwString( rTxt, 0, rTxt.Len(), m_rWW8Export.IsUnicode(),
RTL_TEXTENCODING_MS_1252 );
m_rWW8Export.pChpPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), nStt_sprmCFSpec,
aItems.data() );
m_rWW8Export.WriteChar( '\x15' );
m_rWW8Export.pChpPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), aItems.size(),
aItems.data() );
}
void AttributeOutputBase::TOXMark( const SwTxtNode& rNode, const SwTOXMark& rAttr )
{
// its a field; so get the Text form the Node and build the field
String sTxt;
ww::eField eType = ww::eNONE;
const SwTxtTOXMark& rTxtTOXMark = *rAttr.GetTxtTOXMark();
const xub_StrLen* pTxtEnd = rTxtTOXMark.GetEnd();
if ( pTxtEnd ) // has range?
{
sTxt = rNode.GetExpandTxt( *rTxtTOXMark.GetStart(),
*pTxtEnd - *rTxtTOXMark.GetStart() );
}
else
sTxt = rAttr.GetAlternativeText();
switch ( rAttr.GetTOXType()->GetType() )
{
case TOX_INDEX:
eType = ww::eXE;
if ( rAttr.GetPrimaryKey().Len() )
{
if ( rAttr.GetSecondaryKey().Len() )
{
sTxt.Insert( ':', 0 );
sTxt.Insert( rAttr.GetSecondaryKey(), 0 );
}
sTxt.Insert( ':', 0 );
sTxt.Insert( rAttr.GetPrimaryKey(), 0 );
}
sTxt.InsertAscii( " XE \"", 0 );
sTxt.InsertAscii( "\" " );
break;
case TOX_USER:
( sTxt.APPEND_CONST_ASC( "\" \\f \"" ) )
+= (sal_Char)( 'A' + GetExport( ).GetId( *rAttr.GetTOXType() ) );
// fall through - no break;
case TOX_CONTENT:
{
eType = ww::eTC;
sTxt.InsertAscii( " TC \"", 0 );
sal_uInt16 nLvl = rAttr.GetLevel();
if (nLvl > WW8ListManager::nMaxLevel)
nLvl = WW8ListManager::nMaxLevel;
((sTxt.APPEND_CONST_ASC( "\" \\l " ))
+= String::CreateFromInt32( nLvl )) += ' ';
}
break;
default:
OSL_ENSURE( !this, "Unhandled option for toc export" );
break;
}
if ( sTxt.Len() )
FieldVanish( sTxt, eType );
}
int SwWW8AttrIter::OutAttrWithRange(xub_StrLen nPos)
{
int nRet = 0;
if ( const SwpHints* pTxtAttrs = rNd.GetpSwpHints() )
{
m_rExport.m_aCurrentCharPropStarts.push( nPos );
const xub_StrLen* pEnd;
for ( sal_uInt16 i = 0; i < pTxtAttrs->Count(); ++i )
{
const SwTxtAttr* pHt = (*pTxtAttrs)[i];
const SfxPoolItem* pItem = &pHt->GetAttr();
switch ( pItem->Which() )
{
case RES_TXTATR_INETFMT:
if ( nPos == *pHt->GetStart() )
{
const SwFmtINetFmt *rINet = static_cast< const SwFmtINetFmt* >( pItem );
if ( m_rExport.AttrOutput().StartURL( rINet->GetValue(), rINet->GetTargetFrame() ) )
++nRet;
}
if ( 0 != ( pEnd = pHt->GetEnd() ) && nPos == *pEnd )
{
if ( m_rExport.AttrOutput().EndURL() )
--nRet;
}
break;
case RES_TXTATR_REFMARK:
if ( nPos == *pHt->GetStart() )
{
OutSwFmtRefMark( *static_cast< const SwFmtRefMark* >( pItem ), true );
++nRet;
}
if ( 0 != ( pEnd = pHt->GetEnd() ) && nPos == *pEnd )
{
OutSwFmtRefMark( *static_cast< const SwFmtRefMark* >( pItem ), false );
--nRet;
}
break;
case RES_TXTATR_TOXMARK:
if ( nPos == *pHt->GetStart() )
m_rExport.AttrOutput().TOXMark( rNd, *static_cast< const SwTOXMark* >( pItem ) );
break;
case RES_TXTATR_CJK_RUBY:
if ( nPos == *pHt->GetStart() )
{
m_rExport.AttrOutput().StartRuby( rNd, nPos, *static_cast< const SwFmtRuby* >( pItem ) );
++nRet;
}
if ( 0 != ( pEnd = pHt->GetEnd() ) && nPos == *pEnd )
{
m_rExport.AttrOutput().EndRuby();
--nRet;
}
break;
}
}
m_rExport.m_aCurrentCharPropStarts.pop(); // HasTextItem nur in dem obigen Bereich erlaubt
}
return nRet;
}
bool SwWW8AttrIter::IsRedlineAtEnd( xub_StrLen nEnd ) const
{
bool bRet = false;
// search next Redline
for( sal_uInt16 nPos = nCurRedlinePos;
nPos < m_rExport.pDoc->GetRedlineTbl().Count(); ++nPos )
{
const SwPosition* pEnd = m_rExport.pDoc->GetRedlineTbl()[ nPos ]->End();
if( pEnd->nNode == rNd )
{
if( pEnd->nContent.GetIndex() == nEnd )
{
bRet = true;
break;
}
}
else
break;
}
return bRet;
}
const SwRedlineData* SwWW8AttrIter::GetRedline( xub_StrLen nPos )
{
if( pCurRedline )
{
const SwPosition* pEnd = pCurRedline->End();
if( pEnd->nNode == rNd &&
pEnd->nContent.GetIndex() <= nPos )
{
pCurRedline = 0;
++nCurRedlinePos;
}
else
{
// write data of current redline
return &( pCurRedline->GetRedlineData() );
}
}
if( !pCurRedline )
{
// search next Redline
for( ; nCurRedlinePos < m_rExport.pDoc->GetRedlineTbl().Count();
++nCurRedlinePos )
{
const SwRedline* pRedl = m_rExport.pDoc->GetRedlineTbl()[ nCurRedlinePos ];
const SwPosition* pStt = pRedl->Start();
const SwPosition* pEnd = pStt == pRedl->GetPoint()
? pRedl->GetMark()
: pRedl->GetPoint();
if( pStt->nNode == rNd )
{
if( pStt->nContent.GetIndex() >= nPos )
{
if( pStt->nContent.GetIndex() == nPos )
{
// write data of this redline
pCurRedline = pRedl;
return &( pCurRedline->GetRedlineData() );
}
break;
}
}
else
break;
if( pEnd->nNode == rNd &&
pEnd->nContent.GetIndex() < nPos )
{
pCurRedline = pRedl;
break;
}
}
}
return NULL;
}
short MSWordExportBase::GetCurrentPageDirection() const
{
const SwFrmFmt &rFmt = pAktPageDesc
? pAktPageDesc->GetMaster()
: const_cast<const SwDoc *>( pDoc )->GetPageDesc( 0 ).GetMaster();
return rFmt.GetFrmDir().GetValue();
}
short MSWordExportBase::GetDefaultFrameDirection( ) const
{
short nDir = FRMDIR_ENVIRONMENT;
if ( bOutPageDescs )
nDir = GetCurrentPageDirection( );
else if ( pOutFmtNode )
{
if ( bOutFlyFrmAttrs ) //frame
{
nDir = TrueFrameDirection( *( const SwFrmFmt * ) pOutFmtNode );
}
else if ( pOutFmtNode->ISA( SwCntntNode ) ) //pagagraph
{
const SwCntntNode *pNd = ( const SwCntntNode * ) pOutFmtNode;
SwPosition aPos( *pNd );
nDir = pDoc->GetTextDirection( aPos );
}
else if ( pOutFmtNode->ISA( SwTxtFmtColl ) )
nDir = FRMDIR_HORI_LEFT_TOP; //what else can we do :-(
}
if ( nDir == FRMDIR_ENVIRONMENT )
nDir = FRMDIR_HORI_LEFT_TOP; //Set something
return nDir;
}
short MSWordExportBase::TrueFrameDirection( const SwFrmFmt &rFlyFmt ) const
{
const SwFrmFmt *pFlyFmt = &rFlyFmt;
const SvxFrameDirectionItem* pItem = 0;
while ( pFlyFmt )
{
pItem = &pFlyFmt->GetFrmDir();
if ( FRMDIR_ENVIRONMENT == pItem->GetValue() )
{
pItem = 0;
const SwFmtAnchor* pAnchor = &pFlyFmt->GetAnchor();
if ((FLY_AT_PAGE != pAnchor->GetAnchorId()) &&
pAnchor->GetCntntAnchor() )
{
pFlyFmt = pAnchor->GetCntntAnchor()->nNode.GetNode().GetFlyFmt();
}
else
pFlyFmt = 0;
}
else
pFlyFmt = 0;
}
short nRet;
if ( pItem )
nRet = pItem->GetValue();
else
nRet = GetCurrentPageDirection();
OSL_ENSURE( nRet != FRMDIR_ENVIRONMENT, "leaving with environment direction" );
return nRet;
}
const SvxBrushItem* WW8Export::GetCurrentPageBgBrush() const
{
const SwFrmFmt &rFmt = pAktPageDesc
? pAktPageDesc->GetMaster()
: const_cast<const SwDoc *>(pDoc)->GetPageDesc(0).GetMaster();
const SfxPoolItem* pItem = 0;
//If not set, or "no fill", get real bg
SfxItemState eState = rFmt.GetItemState(RES_BACKGROUND, true, &pItem);
const SvxBrushItem* pRet = (const SvxBrushItem*)pItem;
if (SFX_ITEM_SET != eState || (!pRet->GetGraphic() &&
pRet->GetColor() == COL_TRANSPARENT))
{
pRet = &(DefaultItemGet<SvxBrushItem>(*pDoc,RES_BACKGROUND));
}
return pRet;
}
SvxBrushItem WW8Export::TrueFrameBgBrush(const SwFrmFmt &rFlyFmt) const
{
const SwFrmFmt *pFlyFmt = &rFlyFmt;
const SvxBrushItem* pRet = 0;
while (pFlyFmt)
{
//If not set, or "no fill", get real bg
const SfxPoolItem* pItem = 0;
SfxItemState eState =
pFlyFmt->GetItemState(RES_BACKGROUND, true, &pItem);
pRet = (const SvxBrushItem*)pItem;
if (SFX_ITEM_SET != eState || (!pRet->GetGraphic() &&
pRet->GetColor() == COL_TRANSPARENT))
{
pRet = 0;
const SwFmtAnchor* pAnchor = &pFlyFmt->GetAnchor();
if ((FLY_AT_PAGE != pAnchor->GetAnchorId()) &&
pAnchor->GetCntntAnchor())
{
pFlyFmt =
pAnchor->GetCntntAnchor()->nNode.GetNode().GetFlyFmt();
}
else
pFlyFmt = 0;
}
else
pFlyFmt = 0;
}
if (!pRet)
pRet = GetCurrentPageBgBrush();
const Color aTmpColor( COL_WHITE );
SvxBrushItem aRet( aTmpColor, RES_BACKGROUND );
if (pRet && (pRet->GetGraphic() ||( pRet->GetColor() != COL_TRANSPARENT)))
aRet = *pRet;
return aRet;
}
/*
Convert characters that need to be converted, the basic replacements and the
ridicously complicated title case attribute mapping to hardcoded upper case
because word doesn't have the feature
*/
String SwWW8AttrIter::GetSnippet(const String &rStr, xub_StrLen nAktPos,
xub_StrLen nLen) const
{
String aSnippet(rStr, nAktPos, nLen);
if (!nLen)
return aSnippet;
// 0x0a ( Hard Line Break ) -> 0x0b
// 0xad ( soft hyphen ) -> 0x1f
// 0x2011 ( hard hyphen ) -> 0x1e
aSnippet.SearchAndReplaceAll(0x0A, 0x0B);
aSnippet.SearchAndReplaceAll(CHAR_HARDHYPHEN, 0x1e);
aSnippet.SearchAndReplaceAll(CHAR_SOFTHYPHEN, 0x1f);
m_rExport.m_aCurrentCharPropStarts.push( nAktPos );
const SfxPoolItem &rItem = GetItem(RES_CHRATR_CASEMAP);
if (SVX_CASEMAP_TITEL == ((const SvxCaseMapItem&)rItem).GetValue())
{
sal_uInt16 nScriptType = i18n::ScriptType::LATIN;
if (pBreakIt->GetBreakIter().is())
nScriptType = pBreakIt->GetBreakIter()->getScriptType(aSnippet, 0);
LanguageType nLanguage;
switch (nScriptType)
{
case i18n::ScriptType::ASIAN:
nLanguage = ((const SvxLanguageItem&)GetItem(RES_CHRATR_CJK_LANGUAGE)).GetLanguage();
break;
case i18n::ScriptType::COMPLEX:
nLanguage = ((const SvxLanguageItem&)GetItem(RES_CHRATR_CTL_LANGUAGE)).GetLanguage();
break;
case i18n::ScriptType::LATIN:
default:
nLanguage = ((const SvxLanguageItem&)GetItem(RES_CHRATR_LANGUAGE)).GetLanguage();
break;
}
SvxFont aFontHelper;
aFontHelper.SetCaseMap(SVX_CASEMAP_TITEL);
aFontHelper.SetLanguage(nLanguage);
aSnippet = aFontHelper.CalcCaseMap(aSnippet);
//If we weren't at the begin of a word undo the case change.
//not done before doing the casemap because the sequence might start
//with whitespace
if (pBreakIt->GetBreakIter().is() && !pBreakIt->GetBreakIter()->isBeginWord(
rStr, nAktPos, pBreakIt->GetLocale(nLanguage),
i18n::WordType::ANYWORD_IGNOREWHITESPACES ) )
{
aSnippet.SetChar(0, rStr.GetChar(nAktPos));
}
}
m_rExport.m_aCurrentCharPropStarts.pop();
return aSnippet;
}
/** Delivers the right paragraph style
Because of the different style handling for delete operations,
the track changes have to be analysed. A deletion, starting in paragraph A
with style A, ending in paragraph B with style B, needs a hack.
*/
static SwTxtFmtColl& lcl_getFormatCollection( MSWordExportBase& rExport, const SwTxtNode* pTxtNode )
{
sal_uInt16 nPos = 0;
sal_uInt16 nMax = rExport.pDoc->GetRedlineTbl().Count();
while( nPos < nMax )
{
const SwRedline* pRedl = rExport.pDoc->GetRedlineTbl()[ nPos++ ];
const SwPosition* pStt = pRedl->Start();
const SwPosition* pEnd = pStt == pRedl->GetPoint()
? pRedl->GetMark()
: pRedl->GetPoint();
// Looking for deletions, which ends in current pTxtNode
if( nsRedlineType_t::REDLINE_DELETE == pRedl->GetRedlineData().GetType() &&
pEnd->nNode == *pTxtNode && pStt->nNode != *pTxtNode &&
pStt->nNode.GetNode().IsTxtNode() )
{
pTxtNode = pStt->nNode.GetNode().GetTxtNode();
nMax = nPos;
nPos = 0;
}
}
return static_cast<SwTxtFmtColl&>( pTxtNode->GetAnyFmtColl() );
}
void WW8AttributeOutput::FormatDrop( const SwTxtNode& rNode, const SwFmtDrop &rSwFmtDrop, sal_uInt16 nStyle,
ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo, ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner )
{
short nDropLines = rSwFmtDrop.GetLines();
short nDistance = rSwFmtDrop.GetDistance();
int rFontHeight, rDropHeight, rDropDescent;
SVBT16 nSty;
ShortToSVBT16( nStyle, nSty );
m_rWW8Export.pO->insert( m_rWW8Export.pO->end(), (sal_uInt8*)&nSty, (sal_uInt8*)&nSty+2 ); // Style #
if ( m_rWW8Export.bWrtWW8 )
{
m_rWW8Export.InsUInt16( NS_sprm::LN_PPc ); // Alignment (sprmPPc)
m_rWW8Export.pO->push_back( 0x20 );
m_rWW8Export.InsUInt16( NS_sprm::LN_PWr ); // Wrapping (sprmPWr)
m_rWW8Export.pO->push_back( 0x02 );
m_rWW8Export.InsUInt16( NS_sprm::LN_PDcs ); // Dropcap (sprmPDcs)
int nDCS = ( nDropLines << 3 ) | 0x01;
m_rWW8Export.InsUInt16( static_cast< sal_uInt16 >( nDCS ) );
m_rWW8Export.InsUInt16( NS_sprm::LN_PDxaFromText ); // Distance from text (sprmPDxaFromText)
m_rWW8Export.InsUInt16( nDistance );
if ( rNode.GetDropSize( rFontHeight, rDropHeight, rDropDescent ) )
{
m_rWW8Export.InsUInt16( NS_sprm::LN_PDyaLine ); // Line spacing
m_rWW8Export.InsUInt16( static_cast< sal_uInt16 >( -rDropHeight ) );
m_rWW8Export.InsUInt16( 0 );
}
}
else
{
m_rWW8Export.pO->push_back( 29 ); // Alignment (sprmPPc)
m_rWW8Export.pO->push_back( 0x20 );
m_rWW8Export.pO->push_back( 37 ); // Wrapping (sprmPWr)
m_rWW8Export.pO->push_back( 0x02 );
m_rWW8Export.pO->push_back( 46 ); // Dropcap (sprmPDcs)
int nDCS = ( nDropLines << 3 ) | 0x01;
m_rWW8Export.InsUInt16( static_cast< sal_uInt16 >( nDCS ) );
m_rWW8Export.pO->push_back( 49 ); // Distance from text (sprmPDxaFromText)
m_rWW8Export.InsUInt16( nDistance );
if (rNode.GetDropSize(rFontHeight, rDropHeight, rDropDescent))
{
m_rWW8Export.pO->push_back( 20 ); // Line spacing
m_rWW8Export.InsUInt16( static_cast< sal_uInt16 >( -rDropHeight ) );
m_rWW8Export.InsUInt16( 0 );
}
}
m_rWW8Export.WriteCR( pTextNodeInfoInner );
if ( pTextNodeInfo.get() != NULL )
{
#ifdef DBG_UTIL
::std::clog << pTextNodeInfo->toString() << ::std::endl;
#endif
TableInfoCell( pTextNodeInfoInner );
}
m_rWW8Export.pPapPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), m_rWW8Export.pO->size(), m_rWW8Export.pO->data() );
m_rWW8Export.pO->clear();
if ( rNode.GetDropSize( rFontHeight, rDropHeight, rDropDescent ) )
{
if ( m_rWW8Export.bWrtWW8 )
{
const SwCharFmt *pSwCharFmt = rSwFmtDrop.GetCharFmt();
if ( pSwCharFmt )
{
m_rWW8Export.InsUInt16( NS_sprm::LN_CIstd );
m_rWW8Export.InsUInt16( m_rWW8Export.GetId( *pSwCharFmt ) );
}
m_rWW8Export.InsUInt16( NS_sprm::LN_CHpsPos ); // Lower the chars
m_rWW8Export.InsUInt16( static_cast< sal_uInt16 >( -((nDropLines - 1)*rDropDescent) / 10 ) );
m_rWW8Export.InsUInt16( NS_sprm::LN_CHps ); // Font Size
m_rWW8Export.InsUInt16( static_cast< sal_uInt16 >( rFontHeight / 10 ) );
}
else
{
const SwCharFmt *pSwCharFmt = rSwFmtDrop.GetCharFmt();
if ( pSwCharFmt )
{
m_rWW8Export.InsUInt16( 80 );
m_rWW8Export.InsUInt16( m_rWW8Export.GetId( *pSwCharFmt ) );
}
m_rWW8Export.pO->push_back( 101 ); // Lower the chars
m_rWW8Export.InsUInt16( static_cast< sal_uInt16 >( -((nDropLines - 1)*rDropDescent) / 10 ) );
m_rWW8Export.pO->push_back( 99 ); // Font Size
m_rWW8Export.InsUInt16( static_cast< sal_uInt16 >( rFontHeight / 10 ) );
}
}
m_rWW8Export.pChpPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), m_rWW8Export.pO->size(), m_rWW8Export.pO->data() );
m_rWW8Export.pO->clear();
}
xub_StrLen MSWordExportBase::GetNextPos( SwWW8AttrIter* aAttrIter, const SwTxtNode& rNode, xub_StrLen nAktPos )
{
// Get the bookmarks for the normal run
xub_StrLen nNextPos = aAttrIter->WhereNext();
xub_StrLen nNextBookmark = nNextPos;
if( nNextBookmark > nAktPos ) //no need to search for bookmarks otherwise (checked in UpdatePosition())
{
GetSortedBookmarks( rNode, nAktPos, nNextBookmark - nAktPos );
NearestBookmark( nNextBookmark, nAktPos, false );
}
return std::min( nNextPos, nNextBookmark );
}
void MSWordExportBase::UpdatePosition( SwWW8AttrIter* aAttrIter, xub_StrLen nAktPos, xub_StrLen /*nEnd*/ )
{
xub_StrLen nNextPos;
// go to next attribute if no bookmark is found or if the bookmark is behind the next attribute position
bool bNextBookmark = NearestBookmark( nNextPos, nAktPos, true );
if( !bNextBookmark || nNextPos > aAttrIter->WhereNext() )
aAttrIter->NextPos();
}
bool MSWordExportBase::GetBookmarks( const SwTxtNode& rNd, xub_StrLen nStt,
xub_StrLen nEnd, IMarkVector& rArr )
{
IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
sal_uLong nNd = rNd.GetIndex( );
const sal_Int32 nMarks = pMarkAccess->getMarksCount();
for ( sal_Int32 i = 0; i < nMarks; i++ )
{
IMark* pMark = ( pMarkAccess->getMarksBegin() + i )->get();
// Only keep the bookmarks starting or ending in this node
if ( pMark->GetMarkStart().nNode == nNd ||
pMark->GetMarkEnd().nNode == nNd )
{
xub_StrLen nBStart = pMark->GetMarkStart().nContent.GetIndex();
xub_StrLen nBEnd = pMark->GetMarkEnd().nContent.GetIndex();
// Keep only the bookmars starting or ending in the snippet
bool bIsStartOk = ( nBStart >= nStt ) && ( nBStart <= nEnd );
bool bIsEndOk = ( nBEnd >= nStt ) && ( nBEnd <= nEnd );
if ( bIsStartOk || bIsEndOk )
rArr.push_back( pMark );
}
}
return ( rArr.size() > 0 );
}
class CompareMarksEnd : public std::binary_function < const IMark *, const IMark *, bool >
{
public:
inline bool operator() ( const IMark * pOneB, const IMark * pTwoB ) const
{
xub_StrLen nOEnd = pOneB->GetMarkEnd().nContent.GetIndex();
xub_StrLen nTEnd = pTwoB->GetMarkEnd().nContent.GetIndex();
return nOEnd < nTEnd;
}
};
bool MSWordExportBase::NearestBookmark( xub_StrLen& rNearest, const xub_StrLen nAktPos, bool bNextPositionOnly )
{
bool bHasBookmark = false;
if ( m_rSortedMarksStart.size( ) > 0 )
{
IMark* pMarkStart = m_rSortedMarksStart.front();
xub_StrLen nNext = pMarkStart->GetMarkStart().nContent.GetIndex();
if( !bNextPositionOnly || (nNext > nAktPos ))
{
rNearest = nNext;
bHasBookmark = true;
}
}
if ( m_rSortedMarksEnd.size( ) > 0 )
{
IMark* pMarkEnd = m_rSortedMarksEnd[0];
xub_StrLen nNext = pMarkEnd->GetMarkEnd().nContent.GetIndex();
if( !bNextPositionOnly || nNext > nAktPos )
{
if ( !bHasBookmark )
rNearest = nNext;
else
rNearest = std::min( rNearest, nNext );
bHasBookmark = true;
}
}
return bHasBookmark;
}
void MSWordExportBase::GetSortedBookmarks( const SwTxtNode& rNode, xub_StrLen nAktPos, xub_StrLen nLen )
{
IMarkVector aMarksStart;
if ( GetBookmarks( rNode, nAktPos, nAktPos + nLen, aMarksStart ) )
{
IMarkVector aSortedEnd;
IMarkVector aSortedStart;
for ( IMarkVector::const_iterator it = aMarksStart.begin(), end = aMarksStart.end();
it < end; ++it )
{
IMark* pMark = (*it);
// Remove the positions egals to the current pos
xub_StrLen nStart = pMark->GetMarkStart().nContent.GetIndex();
xub_StrLen nEnd = pMark->GetMarkEnd().nContent.GetIndex();
if ( nStart > nAktPos && ( pMark->GetMarkStart().nNode == rNode.GetIndex()) )
aSortedStart.push_back( pMark );
if ( nEnd > nAktPos && nEnd <= ( nAktPos + nLen ) && (pMark->GetMarkEnd().nNode == rNode.GetIndex()) )
aSortedEnd.push_back( pMark );
}
// Sort the bookmarks by end position
std::sort( aSortedEnd.begin(), aSortedEnd.end(), CompareMarksEnd() );
m_rSortedMarksStart.swap( aSortedStart );
m_rSortedMarksEnd.swap( aSortedEnd );
}
else
{
m_rSortedMarksStart.clear( );
m_rSortedMarksEnd.clear( );
}
}
void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
{
#ifdef DBG_UTIL
::std::clog << "<OutWW8_SwTxtNode>" << ::std::endl;
#endif
ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo( mpTableInfo->getTableNodeInfo( &rNode ) );
AttrOutput().StartParagraph( pTextNodeInfo );
bool bFlyInTable = mpParentFrame && IsInTable();
if ( !bFlyInTable )
nStyleBeforeFly = GetId( lcl_getFormatCollection( *this, &rNode ) );
// nStyleBeforeFly may change when we recurse into another node, so we
// have to remember it in nStyle
sal_uInt16 nStyle = nStyleBeforeFly;
SwWW8AttrIter aAttrIter( *this, rNode );
rtl_TextEncoding eChrSet = aAttrIter.GetCharSet();
if ( bStartTOX )
{
// ignore TOX header section
const SwSectionNode* pSectNd = rNode.FindSectionNode();
if ( pSectNd && TOX_CONTENT_SECTION == pSectNd->GetSection().GetType() )
{
AttrOutput().StartTOX( pSectNd->GetSection() );
m_aCurrentCharPropStarts.push( 0 );
}
}
const SwSection* pTOXSect = 0;
if( bInWriteTOX )
{
// check for end of TOX
SwNodeIndex aIdx( rNode, 1 );
if( !aIdx.GetNode().IsTxtNode() )
{
const SwSectionNode* pTOXSectNd = rNode.FindSectionNode();
pTOXSect = &pTOXSectNd->GetSection();
const SwNode* pNxt = rNode.GetNodes().GoNext( &aIdx );
if( pNxt && pNxt->FindSectionNode() == pTOXSectNd )
pTOXSect = 0;
}
}
if ( aAttrIter.RequiresImplicitBookmark() )
{
String sBkmkName = String( RTL_CONSTASCII_USTRINGPARAM( "_toc" ) );
sBkmkName += String::CreateFromInt32( rNode.GetIndex() );
AppendWordBookmark( sBkmkName );
}
String aStr( rNode.GetTxt() );
xub_StrLen nAktPos = 0;
xub_StrLen const nEnd = aStr.Len();
bool bRedlineAtEnd = false;
int nOpenAttrWithRange = 0;
ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner;
if ( pTextNodeInfo.get() != NULL )
pTextNodeInfoInner = pTextNodeInfo->getFirstInner();
do {
const SwRedlineData* pRedlineData = aAttrIter.GetRedline( nAktPos );
AttrOutput().StartRun( pRedlineData );
if( nTxtTyp == TXT_FTN || nTxtTyp == TXT_EDN )
AttrOutput().FootnoteEndnoteRefTag();
xub_StrLen nNextAttr = GetNextPos( &aAttrIter, rNode, nAktPos );
if( nNextAttr > nEnd )
nNextAttr = nEnd;
aAttrIter.OutFlys( nAktPos );
//Append bookmarks in this range after flys, exclusive of final
//position of this range
AppendBookmarks( rNode, nAktPos, nNextAttr - nAktPos );
bool bTxtAtr = aAttrIter.IsTxtAttr( nAktPos );
nOpenAttrWithRange += aAttrIter.OutAttrWithRange(nAktPos);
xub_StrLen nLen = nNextAttr - nAktPos;
if ( !bTxtAtr && nLen )
{
sal_Unicode ch = aStr.GetChar( nAktPos );
int ofs = ( ch == CH_TXT_ATR_FIELDSTART || ch == CH_TXT_ATR_FIELDEND || ch == CH_TXT_ATR_FORMELEMENT? 1: 0 );
IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
if ( ch == CH_TXT_ATR_FIELDSTART )
{
SwPosition aPosition( rNode, SwIndex( const_cast< SwTxtNode* >( &rNode ), nAktPos ) );
::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition );
OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDSTART??" );
if ( pFieldmark && pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) )
AppendBookmark( pFieldmark->GetName(), false );
ww::eField eFieldId = lcl_getFieldId( pFieldmark );
String sCode = lcl_getFieldCode( pFieldmark );
if ( pFieldmark && pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_UNHANDLED ) ) )
{
IFieldmark::parameter_map_t::const_iterator it = pFieldmark->GetParameters()->find(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_ID_PARAM )) );
if ( it != pFieldmark->GetParameters()->end() )
{
rtl::OUString sFieldId;
it->second >>= sFieldId;
eFieldId = (ww::eField)sFieldId.toInt32();
}
it = pFieldmark->GetParameters()->find(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_CODE_PARAM )) );
if ( it != pFieldmark->GetParameters()->end() )
{
rtl::OUString sOUCode;
it->second >>= sOUCode;
sCode = sOUCode;
}
}
OutputField( NULL, eFieldId, sCode, WRITEFIELD_START | WRITEFIELD_CMD_START );
if ( pFieldmark && pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) )
WriteFormData( *pFieldmark );
else if ( pFieldmark && pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_HYPERLINK ) ) )
WriteHyperlinkData( *pFieldmark );
OutputField( NULL, lcl_getFieldId( pFieldmark ), String(), WRITEFIELD_CMD_END );
if ( pFieldmark && pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_UNHANDLED ) ) )
{
// Check for the presence of a linked OLE object
IFieldmark::parameter_map_t::const_iterator it = pFieldmark->GetParameters()->find(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_OLE_PARAM )) );
if ( it != pFieldmark->GetParameters()->end() )
{
rtl::OUString sOleId;
uno::Any aValue = it->second;
aValue >>= sOleId;
if ( sOleId.getLength( ) > 0 )
OutputLinkedOLE( sOleId );
}
}
}
else if ( ch == CH_TXT_ATR_FIELDEND )
{
SwPosition aPosition( rNode, SwIndex( const_cast< SwTxtNode* >( &rNode ), nAktPos - 1 ) );
::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition );
OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDEND??" );
ww::eField eFieldId = lcl_getFieldId( pFieldmark );
if ( pFieldmark && pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_UNHANDLED ) ) )
{
IFieldmark::parameter_map_t::const_iterator it = pFieldmark->GetParameters()->find(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( ODF_ID_PARAM )) );
if ( it != pFieldmark->GetParameters()->end() )
{
rtl::OUString sFieldId;
it->second >>= sFieldId;
eFieldId = (ww::eField)sFieldId.toInt32();
}
}
OutputField( NULL, eFieldId, String(), WRITEFIELD_CLOSE );
if ( pFieldmark && pFieldmark->GetFieldname().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMTEXT ) ) )
AppendBookmark( pFieldmark->GetName(), false );
}
else if ( ch == CH_TXT_ATR_FORMELEMENT )
{
SwPosition aPosition( rNode, SwIndex( const_cast< SwTxtNode* >( &rNode ), nAktPos ) );
::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition );
OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDSTART??" );
bool isDropdownOrCheckbox = pFieldmark && (pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMDROPDOWN ) ) ||
pFieldmark->GetFieldname( ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ODF_FORMCHECKBOX ) ));
if ( isDropdownOrCheckbox )
AppendBookmark( pFieldmark->GetName(), 0 );
OutputField( NULL, lcl_getFieldId( pFieldmark ),
lcl_getFieldCode( pFieldmark ),
WRITEFIELD_START | WRITEFIELD_CMD_START );
if ( isDropdownOrCheckbox )
WriteFormData( *pFieldmark );
OutputField( NULL, lcl_getFieldId( pFieldmark ), String(), WRITEFIELD_CLOSE );
if ( isDropdownOrCheckbox )
AppendBookmark( pFieldmark->GetName(), false );
}
nLen -= static_cast< sal_uInt16 >( ofs );
String aSnippet( aAttrIter.GetSnippet( aStr, nAktPos + static_cast< sal_uInt16 >( ofs ), nLen ) );
if ( ( nTxtTyp == TXT_EDN || nTxtTyp == TXT_FTN ) && nAktPos == 0 && nLen > 0 )
{
// Insert tab for aesthetic puposes #i24762#
if ( aSnippet.GetChar( 0 ) != 0x09 )
aSnippet.Insert( 0x09, 0 );
}
AttrOutput().RunText( aSnippet, eChrSet );
}
if ( aAttrIter.IsDropCap( nNextAttr ) )
AttrOutput().FormatDrop( rNode, aAttrIter.GetSwFmtDrop(), nStyle, pTextNodeInfo, pTextNodeInfoInner );
if (0 != nEnd)
{
// Output the character attributes
// #i51277# do this before writing flys at end of paragraph
AttrOutput().StartRunProperties();
aAttrIter.OutAttr( nAktPos );
AttrOutput().EndRunProperties( pRedlineData );
}
// At the end of line, output the attributes until the CR.
// Exception: footnotes at the end of line
if ( nNextAttr == nEnd )
{
OSL_ENSURE( nOpenAttrWithRange >= 0, "odd to see this happening, expected >= 0" );
if ( !bTxtAtr && nOpenAttrWithRange <= 0 )
{
if ( aAttrIter.IsRedlineAtEnd( nEnd ) )
bRedlineAtEnd = true;
else
{
// insert final graphic anchors if any before CR
aAttrIter.OutFlys( nEnd );
// insert final bookmarks if any before CR and after flys
AppendBookmarks( rNode, nEnd, 1 );
if ( pTOXSect )
{
m_aCurrentCharPropStarts.pop();
AttrOutput().EndTOX( *pTOXSect );
}
WriteCR( pTextNodeInfoInner );
}
}
}
if (0 == nEnd)
{
// Output the character attributes
// do it after WriteCR for an empty paragraph (otherwise
// WW8_WrFkp::Append throws SPRMs away...)
AttrOutput().StartRunProperties();
aAttrIter.OutAttr( nAktPos );
AttrOutput().EndRunProperties( pRedlineData );
}
// Exception: footnotes at the end of line
if ( nNextAttr == nEnd )
{
OSL_ENSURE(nOpenAttrWithRange >= 0,
"odd to see this happening, expected >= 0");
bool bAttrWithRange = (nOpenAttrWithRange > 0);
if ( nAktPos != nEnd )
{
nOpenAttrWithRange += aAttrIter.OutAttrWithRange(nEnd);
OSL_ENSURE(nOpenAttrWithRange == 0,
"odd to see this happening, expected 0");
}
AttrOutput().OutputFKP();
if ( bTxtAtr || bAttrWithRange || bRedlineAtEnd )
{
// insert final graphic anchors if any before CR
aAttrIter.OutFlys( nEnd );
// insert final bookmarks if any before CR and after flys
AppendBookmarks( rNode, nEnd, 1 );
if ( pTOXSect )
{
m_aCurrentCharPropStarts.pop();
AttrOutput().EndTOX( *pTOXSect );
}
WriteCR( pTextNodeInfoInner );
if ( bRedlineAtEnd )
{
AttrOutput().Redline( aAttrIter.GetRedline( nEnd ) );
AttrOutput().OutputFKP();
}
}
}
AttrOutput().WritePostitFieldReference();
AttrOutput().EndRun();
nAktPos = nNextAttr;
UpdatePosition( &aAttrIter, nAktPos, nEnd );
eChrSet = aAttrIter.GetCharSet();
}
while ( nAktPos < nEnd );
AttrOutput().StartParagraphProperties( rNode );
AttrOutput().ParagraphStyle( nStyle );
if ( mpParentFrame && IsInTable() ) // Fly-Attrs
OutputFormat( mpParentFrame->GetFrmFmt(), false, false, true );
if ( pTextNodeInfo.get() != NULL )
{
#ifdef DBG_UTIL
::std::clog << pTextNodeInfo->toString() << ::std::endl;
#endif
AttrOutput().TableInfoCell( pTextNodeInfoInner );
if (pTextNodeInfoInner->isFirstInTable())
{
const SwTable * pTable = pTextNodeInfoInner->getTable();
const SwTableFmt * pTabFmt = pTable->GetTableFmt();
if (pTabFmt != NULL)
{
if (pTabFmt->GetBreak().GetBreak() == SVX_BREAK_PAGE_BEFORE)
AttrOutput().PageBreakBefore(true);
}
}
}
if ( !bFlyInTable )
{
SfxItemSet* pTmpSet = 0;
const sal_uInt8 nPrvNxtNd = rNode.HasPrevNextLayNode();
if( (ND_HAS_PREV_LAYNODE|ND_HAS_NEXT_LAYNODE ) != nPrvNxtNd )
{
const SfxPoolItem* pItem;
if( SFX_ITEM_SET == rNode.GetSwAttrSet().GetItemState(
RES_UL_SPACE, true, &pItem ) &&
( ( !( ND_HAS_PREV_LAYNODE & nPrvNxtNd ) &&
((SvxULSpaceItem*)pItem)->GetUpper()) ||
( !( ND_HAS_NEXT_LAYNODE & nPrvNxtNd ) &&
((SvxULSpaceItem*)pItem)->GetLower()) ))
{
pTmpSet = new SfxItemSet( rNode.GetSwAttrSet() );
SvxULSpaceItem aUL( *(SvxULSpaceItem*)pItem );
// #i25901#- consider compatibility option
if (!pDoc->get(IDocumentSettingAccess::PARA_SPACE_MAX_AT_PAGES))
{
if( !(ND_HAS_PREV_LAYNODE & nPrvNxtNd ))
aUL.SetUpper( 0 );
}
// #i25901# - consider compatibility option
if (!pDoc->get(IDocumentSettingAccess::ADD_PARA_SPACING_TO_TABLE_CELLS))
{
if( !(ND_HAS_NEXT_LAYNODE & nPrvNxtNd ))
aUL.SetLower( 0 );
}
pTmpSet->Put( aUL );
}
}
sal_Bool bParaRTL = sal_False;
const SvxFrameDirectionItem* pItem = (const SvxFrameDirectionItem*)
rNode.GetSwAttrSet().GetItem(RES_FRAMEDIR);
if ( aAttrIter.IsParaRTL())
bParaRTL = sal_True;
if( rNode.IsNumbered())
{
const SwNumRule* pRule = rNode.GetNumRule();
sal_uInt8 nLvl = static_cast< sal_uInt8 >( rNode.GetActualListLevel() );
const SwNumFmt* pFmt = pRule->GetNumFmt( nLvl );
if( !pFmt )
pFmt = &pRule->Get( nLvl );
if( !pTmpSet )
pTmpSet = new SfxItemSet( rNode.GetSwAttrSet() );
SvxLRSpaceItem aLR(ItemGet<SvxLRSpaceItem>(*pTmpSet, RES_LR_SPACE));
// #i86652#
if ( pFmt->GetPositionAndSpaceMode() ==
SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aLR.SetTxtLeft( aLR.GetTxtLeft() + pFmt->GetAbsLSpace() );
}
if( rNode.IsNumbered() && rNode.IsCountedInList() )
{
// #i86652#
if ( pFmt->GetPositionAndSpaceMode() ==
SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
if (bParaRTL)
aLR.SetTxtFirstLineOfstValue(pFmt->GetAbsLSpace() - pFmt->GetFirstLineOffset());
else
aLR.SetTxtFirstLineOfst(GetWordFirstLineOffset(*pFmt));
}
// correct fix for issue i94187
if (SFX_ITEM_SET !=
pTmpSet->GetItemState(RES_PARATR_NUMRULE, false) )
{
// List style set via paragraph style - then put it into the itemset.
// This is needed to get list level and list id exported for
// the paragraph.
pTmpSet->Put( SwNumRuleItem( pRule->GetName() ));
// Put indent values into the itemset in case that the list
// style is applied via paragraph style and the list level
// indent values are not applicable.
if ( pFmt->GetPositionAndSpaceMode() ==
SvxNumberFormat::LABEL_ALIGNMENT &&
!rNode.AreListLevelIndentsApplicable() )
{
pTmpSet->Put( aLR );
}
}
}
else
pTmpSet->ClearItem(RES_PARATR_NUMRULE);
// #i86652#
if ( pFmt->GetPositionAndSpaceMode() ==
SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
pTmpSet->Put(aLR);
//#i21847#
SvxTabStopItem aItem(
ItemGet<SvxTabStopItem>(*pTmpSet, RES_PARATR_TABSTOP));
SvxTabStop aTabStop(pFmt->GetAbsLSpace());
aItem.Insert(aTabStop);
pTmpSet->Put(aItem);
MSWordExportBase::CorrectTabStopInSet(*pTmpSet, pFmt->GetAbsLSpace());
}
}
/*
If a given para is using the FRMDIR_ENVIRONMENT direction we
cannot export that, its its ltr then that's ok as thats word's
default. Otherwise we must add a RTL attribute to our export list
*/
pItem = (const SvxFrameDirectionItem*)
rNode.GetSwAttrSet().GetItem(RES_FRAMEDIR);
if (
(!pItem || pItem->GetValue() == FRMDIR_ENVIRONMENT) &&
aAttrIter.IsParaRTL()
)
{
if ( !pTmpSet )
pTmpSet = new SfxItemSet(rNode.GetSwAttrSet());
pTmpSet->Put(SvxFrameDirectionItem(FRMDIR_HORI_RIGHT_TOP, RES_FRAMEDIR));
}
// move code for handling of numbered,
// but not counted paragraphs to this place. Otherwise, the paragraph
// isn't exported as numbered, but not counted, if no other attribute
// is found in <pTmpSet>
// #i44815# adjust numbering/indents for numbered paragraphs
// without number (NO_NUMLEVEL)
// #i47013# need to check rNode.GetNumRule()!=NULL as well.
if ( ! rNode.IsCountedInList() && rNode.GetNumRule()!=NULL )
{
// WW8 does not know numbered paragraphs without number
// (NO_NUMLEVEL). In WW8AttributeOutput::ParaNumRule(), we will export
// the RES_PARATR_NUMRULE as list-id 0, which in WW8 means
// no numbering. Here, we will adjust the indents to match
// visually.
if ( !pTmpSet )
pTmpSet = new SfxItemSet(rNode.GetSwAttrSet());
// create new LRSpace item, based on the current (if present)
const SfxPoolItem* pPoolItem = NULL;
pTmpSet->GetItemState(RES_LR_SPACE, sal_True, &pPoolItem);
SvxLRSpaceItem aLRSpace(
( pPoolItem == NULL )
? SvxLRSpaceItem(0, 0, 0, 0, RES_LR_SPACE)
: *static_cast<const SvxLRSpaceItem*>( pPoolItem ) );
// new left margin = old left + label space
const SwNumRule* pRule = rNode.GetNumRule();
const SwNumFmt& rNumFmt = pRule->Get( static_cast< sal_uInt16 >(rNode.GetActualListLevel()) );
// #i86652#
if ( rNumFmt.GetPositionAndSpaceMode() ==
SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aLRSpace.SetTxtLeft( aLRSpace.GetLeft() + rNumFmt.GetAbsLSpace() );
// new first line indent = 0
// (first line indent is ignored for NO_NUMLEVEL)
if (!bParaRTL)
aLRSpace.SetTxtFirstLineOfst( 0 );
// put back the new item
pTmpSet->Put( aLRSpace );
}
// assure that numbering rule is in <pTmpSet>
if (SFX_ITEM_SET != pTmpSet->GetItemState(RES_PARATR_NUMRULE, false) )
{
pTmpSet->Put( SwNumRuleItem( pRule->GetName() ));
}
}
// #i75457#
// Export page break after attribute from paragraph style.
// If page break attribute at the text node exist, an existing page
// break after at the paragraph style hasn't got to be considered.
if ( !rNode.GetpSwAttrSet() ||
SFX_ITEM_SET != rNode.GetpSwAttrSet()->GetItemState(RES_BREAK, false) )
{
const SvxFmtBreakItem* pBreakAtParaStyle =
&(ItemGet<SvxFmtBreakItem>(rNode.GetSwAttrSet(), RES_BREAK));
if ( pBreakAtParaStyle &&
pBreakAtParaStyle->GetBreak() == SVX_BREAK_PAGE_AFTER )
{
if ( !pTmpSet )
{
pTmpSet = new SfxItemSet(rNode.GetSwAttrSet());
}
pTmpSet->Put( *pBreakAtParaStyle );
}
else if( pTmpSet )
{ // Even a pagedesc item is set, the break item can be set 'NONE',
// this has to be overruled.
const SwFmtPageDesc& rPageDescAtParaStyle =
ItemGet<SwFmtPageDesc>( rNode, RES_PAGEDESC );
if( rPageDescAtParaStyle.KnowsPageDesc() )
pTmpSet->ClearItem( RES_BREAK );
}
}
// #i76520# Emulate non-splitting tables
if ( bOutTable )
{
const SwTableNode* pTableNode = rNode.FindTableNode();
if ( pTableNode )
{
const SwTable& rTable = pTableNode->GetTable();
const SvxFmtKeepItem& rKeep = rTable.GetFrmFmt()->GetKeep();
const bool bKeep = rKeep.GetValue();
const bool bDontSplit = !bKeep ?
!rTable.GetFrmFmt()->GetLayoutSplit().GetValue() :
false;
if ( bKeep || bDontSplit )
{
// bKeep: set keep at first paragraphs in all lines
// bDontSplit : set keep at first paragraphs in all lines except from last line
// but only for non-complex tables
const SwTableBox* pBox = rNode.GetTblBox();
const SwTableLine* pLine = pBox ? pBox->GetUpper() : 0;
if ( pLine && !pLine->GetUpper() )
{
// check if box is first in that line:
if ( 0 == pLine->GetTabBoxes().GetPos( pBox ) && pBox->GetSttNd() )
{
// check if paragraph is first in that line:
if ( 1 == ( rNode.GetIndex() - pBox->GetSttNd()->GetIndex() ) )
{
bool bSetAtPara = false;
if ( bKeep )
bSetAtPara = true;
else if ( bDontSplit )
{
// check if pLine isn't last line in table
if ( rTable.GetTabLines().Count() - rTable.GetTabLines().GetPos( pLine ) != 1 )
bSetAtPara = true;
}
if ( bSetAtPara )
{
if ( !pTmpSet )
pTmpSet = new SfxItemSet(rNode.GetSwAttrSet());
const SvxFmtKeepItem aKeepItem( sal_True, RES_KEEP );
pTmpSet->Put( aKeepItem );
}
}
}
}
}
}
}
const SfxItemSet* pNewSet = pTmpSet ? pTmpSet : rNode.GetpSwAttrSet();
if( pNewSet )
{ // Para-Attrs
pStyAttr = &rNode.GetAnyFmtColl().GetAttrSet();
const SwModify* pOldMod = pOutFmtNode;
pOutFmtNode = &rNode;
// Pap-Attrs, so script is not necessary
OutputItemSet( *pNewSet, true, false, i18n::ScriptType::LATIN, false);
pStyAttr = 0;
pOutFmtNode = pOldMod;
if( pNewSet != rNode.GetpSwAttrSet() )
delete pNewSet;
}
}
AttrOutput().EndParagraphProperties();
AttrOutput().EndParagraph( pTextNodeInfoInner );
#ifdef DBG_UTIL
::std::clog << "</OutWW8_SwTxtNode>" << ::std::endl;
#endif
}
void WW8AttributeOutput::TableNodeInfo( ww8::WW8TableNodeInfo::Pointer_t pNodeInfo )
{
SVBT16 nSty;
ShortToSVBT16( GetExport().nStyleBeforeFly, nSty );
ww8::WW8TableNodeInfo::Inners_t::const_iterator aIt( pNodeInfo->getInners().begin() );
ww8::WW8TableNodeInfo::Inners_t::const_iterator aItEnd( pNodeInfo->getInners().end() );
while (aIt != aItEnd)
{
ww8::WW8TableNodeInfoInner::Pointer_t pInner = aIt->second;
if ( pInner->isEndOfCell() )
{
TableRowEnd( pInner->getDepth() );
m_rWW8Export.pO->insert( m_rWW8Export.pO->end(), (sal_uInt8*)&nSty, (sal_uInt8*)&nSty+2); // Style #
TableInfoRow( pInner );
m_rWW8Export.pPapPlc->AppendFkpEntry( m_rWW8Export.Strm().Tell(), m_rWW8Export.pO->size(), m_rWW8Export.pO->data());
m_rWW8Export.pO->clear();
}
if ( pInner->isEndOfLine() )
{
}
++aIt;
}
}
//---------------------------------------------------------------------------
// Tabellen
//---------------------------------------------------------------------------
void WW8AttributeOutput::EmptyParagraph()
{
m_rWW8Export.WriteStringAsPara( aEmptyStr );
}
bool MSWordExportBase::NoPageBreakSection( const SfxItemSet* pSet )
{
bool bRet = false;
const SfxPoolItem* pI;
if( pSet)
{
bool bNoPageBreak = false;
if ( SFX_ITEM_ON != pSet->GetItemState(RES_PAGEDESC, true, &pI)
|| 0 == ((SwFmtPageDesc*)pI)->GetPageDesc() )
{
bNoPageBreak = true;
}
if (bNoPageBreak)
{
if (SFX_ITEM_ON != pSet->GetItemState(RES_BREAK, true, &pI))
bNoPageBreak = true;
else
{
SvxBreak eBreak = ((const SvxFmtBreakItem*)pI)->GetBreak();
switch (eBreak)
{
case SVX_BREAK_PAGE_BEFORE:
case SVX_BREAK_PAGE_AFTER:
bNoPageBreak = false;
break;
default:
break;
}
}
}
bRet = bNoPageBreak;
}
return bRet;
}
void MSWordExportBase::OutputSectionNode( const SwSectionNode& rSectionNode )
{
const SwSection& rSection = rSectionNode.GetSection();
SwNodeIndex aIdx( rSectionNode, 1 );
const SwNode& rNd = aIdx.GetNode();
if ( !rNd.IsSectionNode() && !IsInTable() ) //No sections in table
{
// Bug 74245 - if the first Node inside the section has an own
// PageDesc or PageBreak attribut, then dont write
// here the section break
sal_uLong nRstLnNum = 0;
const SfxItemSet* pSet;
if ( rNd.IsTableNode() )
pSet = &rNd.GetTableNode()->GetTable().GetFrmFmt()->GetAttrSet();
else if ( rNd.IsCntntNode() )
{
pSet = &rNd.GetCntntNode()->GetSwAttrSet();
nRstLnNum = ((SwFmtLineNumber&)pSet->Get(
RES_LINENUMBER )).GetStartValue();
}
else
pSet = 0;
if ( pSet && NoPageBreakSection( pSet ) )
pSet = 0;
if ( !pSet )
{
// new Section with no own PageDesc/-Break
// -> write follow section break;
const SwSectionFmt& rFmt = *rSection.GetFmt();
ReplaceCr( msword::PageBreak ); // Indikator fuer Page/Section-Break
//Get the page in use at the top of this section
SwNodeIndex aIdxTmp(rSectionNode, 1);
const SwPageDesc *pCurrent =
SwPageDesc::GetPageDescOfNode(aIdxTmp.GetNode());
if (!pCurrent)
pCurrent = pAktPageDesc;
AppendSection( pCurrent, &rFmt, nRstLnNum );
}
}
if ( TOX_CONTENT_SECTION == rSection.GetType() )
bStartTOX = true;
}
void WW8Export::AppendSection( const SwPageDesc *pPageDesc, const SwSectionFmt* pFmt, sal_uLong nLnNum )
{
pSepx->AppendSep(Fc2Cp(Strm().Tell()), pPageDesc, pFmt, nLnNum);
}
//---------------------------------------------------------------------------
// Flys
//---------------------------------------------------------------------------
void WW8Export::OutWW6FlyFrmsInCntnt( const SwTxtNode& rNd )
{
OSL_ENSURE(!bWrtWW8, "I shouldn't be needed for Word >=8");
if ( bWrtWW8 )
return;
if (const SwpHints* pTxtAttrs = rNd.GetpSwpHints())
{
for( sal_uInt16 n=0; n < pTxtAttrs->Count(); ++n )
{
const SwTxtAttr* pAttr = (*pTxtAttrs)[ n ];
if( RES_TXTATR_FLYCNT == pAttr->Which() )
{
// zeichengebundenes Attribut
const SwFmtFlyCnt& rFlyCntnt = pAttr->GetFlyCnt();
const SwFlyFrmFmt& rFlyFrmFmt = *(SwFlyFrmFmt*)rFlyCntnt.GetFrmFmt();
const SwNodeIndex* pNodeIndex = rFlyFrmFmt.GetCntnt().GetCntntIdx();
if( pNodeIndex )
{
sal_uLong nStt = pNodeIndex->GetIndex()+1,
nEnd = pNodeIndex->GetNode().EndOfSectionIndex();
if( (nStt < nEnd) && !pDoc->GetNodes()[ nStt ]->IsNoTxtNode() )
{
Point aOffset;
// Rechtecke des Flys und des Absatzes besorgen
SwRect aParentRect(rNd.FindLayoutRect(false, &aOffset)),
aFlyRect(rFlyFrmFmt.FindLayoutRect(false, &aOffset ) );
aOffset = aFlyRect.Pos() - aParentRect.Pos();
// PaM umsetzen: auf Inhalt des Fly-Frameformats
SaveData( nStt, nEnd );
// wird in OutputFormat() ausgewertet
pFlyOffset = &aOffset;
eNewAnchorType = rFlyFrmFmt.GetAnchor().GetAnchorId();
sw::Frame aFrm(rFlyFrmFmt, SwPosition(rNd));
mpParentFrame = &aFrm;
// Ok, rausschreiben:
WriteText();
RestoreData();
}
}
}
}
}
}
void WW8AttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFmt, const Point& rNdTopLeft )
{
const SwFrmFmt &rFrmFmt = rFmt.GetFrmFmt();
const SwFmtAnchor& rAnch = rFrmFmt.GetAnchor();
bool bUseEscher = m_rWW8Export.bWrtWW8;
if ( m_rWW8Export.bWrtWW8 && rFmt.IsInline() )
{
sw::Frame::WriterSource eType = rFmt.GetWriterType();
if ((eType == sw::Frame::eGraphic) || (eType == sw::Frame::eOle))
bUseEscher = false;
else
bUseEscher = true;
/*
A special case for converting some inline form controls to form fields
when in winword 8+ mode
*/
if ((bUseEscher == true) && (eType == sw::Frame::eFormControl))
{
if ( m_rWW8Export.MiserableFormFieldExportHack( rFrmFmt ) )
return ;
}
}
if (bUseEscher)
{
OSL_ENSURE( m_rWW8Export.bWrtWW8, "this has gone horribly wrong" );
// write as escher
m_rWW8Export.AppendFlyInFlys(rFmt, rNdTopLeft);
}
else
{
bool bDone = false;
// Hole vom Node und vom letzten Node die Position in der Section
const SwNodeIndex* pNodeIndex = rFrmFmt.GetCntnt().GetCntntIdx();
sal_uLong nStt = pNodeIndex ? pNodeIndex->GetIndex()+1 : 0;
sal_uLong nEnd = pNodeIndex ? pNodeIndex->GetNode().EndOfSectionIndex() : 0;
if( nStt >= nEnd ) // kein Bereich, also kein gueltiger Node
return;
if ( !m_rWW8Export.IsInTable() && rFmt.IsInline() )
{
//Test to see if this textbox contains only a single graphic/ole
SwTxtNode* pParTxtNode = rAnch.GetCntntAnchor()->nNode.GetNode().GetTxtNode();
if ( pParTxtNode && !m_rWW8Export.pDoc->GetNodes()[ nStt ]->IsNoTxtNode() )
bDone = true;
}
if( !bDone )
{
m_rWW8Export.SaveData( nStt, nEnd );
Point aOffset;
if ( m_rWW8Export.mpParentFrame )
{
/* Munge flys in fly into absolutely positioned elements for word 6 */
const SwTxtNode* pParTxtNode = rAnch.GetCntntAnchor()->nNode.GetNode().GetTxtNode();
const SwRect aPageRect = pParTxtNode->FindPageFrmRect( sal_False, 0, sal_False );
aOffset = rFrmFmt.FindLayoutRect().Pos();
aOffset -= aPageRect.Pos();
m_rWW8Export.pFlyOffset = &aOffset;
m_rWW8Export.eNewAnchorType = FLY_AT_PAGE;
}
m_rWW8Export.mpParentFrame = &rFmt;
if (
m_rWW8Export.IsInTable() &&
(FLY_AT_PAGE != rAnch.GetAnchorId()) &&
!m_rWW8Export.pDoc->GetNodes()[ nStt ]->IsNoTxtNode()
)
{
// Beachten: Flag bOutTable wieder setzen,
// denn wir geben ja ganz normalen Content der
// Tabelenzelle aus und keinen Rahmen
// (Flag wurde oben in aSaveData() geloescht)
m_rWW8Export.bOutTable = true;
const String& rName = rFrmFmt.GetName();
m_rWW8Export.StartCommentOutput(rName);
m_rWW8Export.WriteText();
m_rWW8Export.EndCommentOutput(rName);
}
else
m_rWW8Export.WriteText();
m_rWW8Export.RestoreData();
}
}
}
void AttributeOutputBase::OutputFlyFrame( const sw::Frame& rFmt )
{
if ( !rFmt.GetCntntNode() )
return;
const SwCntntNode &rNode = *rFmt.GetCntntNode();
Point aNdPos, aPgPos;
Point* pLayPos;
bool bValidNdPos = false, bValidPgPos = false;
if (FLY_AT_PAGE == rFmt.GetFrmFmt().GetAnchor().GetAnchorId())
{
// get the Layout Node-Position.
if ( !bValidPgPos )
{
aPgPos = rNode.FindPageFrmRect(false, &aPgPos).Pos();
bValidPgPos = true;
}
pLayPos = &aPgPos;
}
else
{
// get the Layout Node-Position.
if ( !bValidNdPos )
{
aNdPos = rNode.FindLayoutRect(false, &aNdPos).Pos();
bValidNdPos = true;
}
pLayPos = &aNdPos;
}
OutputFlyFrame_Impl( rFmt, *pLayPos );
}
// write data of any redline
void WW8AttributeOutput::Redline( const SwRedlineData* pRedline )
{
if ( !pRedline )
return;
if ( pRedline->Next() )
Redline( pRedline->Next() );
static sal_uInt16 aSprmIds[ 2 * 2 * 3 ] =
{
// Ids for insert
NS_sprm::LN_CFRMark, NS_sprm::LN_CIbstRMark, NS_sprm::LN_CDttmRMark, // for WW8
0x0042, 0x0045, 0x0046, // for WW6
// Ids for delete
NS_sprm::LN_CFRMarkDel, NS_sprm::LN_CIbstRMarkDel, NS_sprm::LN_CDttmRMarkDel, // for WW8
0x0041, 0x0045, 0x0046 // for WW6
};
const sal_uInt16* pSprmIds = 0;
switch( pRedline->GetType() )
{
case nsRedlineType_t::REDLINE_INSERT:
pSprmIds = aSprmIds;
break;
case nsRedlineType_t::REDLINE_DELETE:
pSprmIds = aSprmIds + (2 * 3);
break;
case nsRedlineType_t::REDLINE_FORMAT:
if( m_rWW8Export.bWrtWW8 )
{
m_rWW8Export.InsUInt16( NS_sprm::LN_CPropRMark );
m_rWW8Export.pO->push_back( 7 ); // len
m_rWW8Export.pO->push_back( 1 );
m_rWW8Export.InsUInt16( m_rWW8Export.AddRedlineAuthor( pRedline->GetAuthor() ) );
m_rWW8Export.InsUInt32( sw::ms::DateTime2DTTM( pRedline->GetTimeStamp() ));
}
break;
default:
OSL_ENSURE(!this, "Unhandled redline type for export");
break;
}
if ( pSprmIds )
{
if ( !m_rWW8Export.bWrtWW8 )
pSprmIds += 3;
if ( m_rWW8Export.bWrtWW8 )
m_rWW8Export.InsUInt16( pSprmIds[0] );
else
m_rWW8Export.pO->push_back( msword_cast<sal_uInt8>(pSprmIds[0]) );
m_rWW8Export.pO->push_back( 1 );
if ( m_rWW8Export.bWrtWW8 )
m_rWW8Export.InsUInt16( pSprmIds[1] );
else
m_rWW8Export.pO->push_back( msword_cast<sal_uInt8>(pSprmIds[1]) );
m_rWW8Export.InsUInt16( m_rWW8Export.AddRedlineAuthor( pRedline->GetAuthor() ) );
if ( m_rWW8Export.bWrtWW8 )
m_rWW8Export.InsUInt16( pSprmIds[2] );
else
m_rWW8Export.pO->push_back( msword_cast<sal_uInt8>(pSprmIds[2]) );
m_rWW8Export.InsUInt32( sw::ms::DateTime2DTTM( pRedline->GetTimeStamp() ));
}
}
void MSWordExportBase::OutputContentNode( const SwCntntNode& rNode )
{
switch ( rNode.GetNodeType() )
{
case ND_TEXTNODE:
{
const SwTxtNode& rTextNode = *rNode.GetTxtNode();
if( !mbOutOutlineOnly || rTextNode.IsOutline() )
OutputTextNode( rTextNode );
}
break;
case ND_GRFNODE:
OutputGrfNode( *rNode.GetGrfNode() );
break;
case ND_OLENODE:
OutputOLENode( *rNode.GetOLENode() );
break;
default:
OSL_TRACE("Unhandled node, type == %d", rNode.GetNodeType() );
break;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|