diff options
author | Kurt Zenker <kz@openoffice.org> | 2008-08-14 16:14:34 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2008-08-14 16:14:34 +0000 |
commit | a86df7e25b40eed6acc3488d6a51593ac56cff9a (patch) | |
tree | 66eee5f476910b66ca45ffd7abc719a4f4ac4202 /sdext | |
parent | INTEGRATION: CWS pdf25 (1.1.2); FILE ADDED (diff) | |
download | core-a86df7e25b40eed6acc3488d6a51593ac56cff9a.tar.gz core-a86df7e25b40eed6acc3488d6a51593ac56cff9a.zip |
INTEGRATION: CWS pdf25 (1.1.2); FILE ADDED
2008/07/24 11:37:44 akhva 1.1.2.1: #90061
Diffstat (limited to 'sdext')
-rwxr-xr-x | sdext/source/pdfimport/wrapper/hash.cxx | 212 | ||||
-rwxr-xr-x | sdext/source/pdfimport/wrapper/keyword_list | 52 |
2 files changed, 264 insertions, 0 deletions
diff --git a/sdext/source/pdfimport/wrapper/hash.cxx b/sdext/source/pdfimport/wrapper/hash.cxx new file mode 100755 index 000000000000..7723f5b33c16 --- /dev/null +++ b/sdext/source/pdfimport/wrapper/hash.cxx @@ -0,0 +1,212 @@ +/* C++ code produced by gperf version 3.0.2 */ +/* Command-line: gperf -C -t -l -L C++ -m 20 -Z PdfKeywordHash keyword_list */ +/* Computed positions: -k'4-5,$' */ + +#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ + && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ + && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ + && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ + && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ + && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ + && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ + && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ + && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ + && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ + && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ + && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ + && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ + && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ + && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ + && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ + && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ + && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ + && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ + && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ + && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ + && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ + && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) +/* The character set is not based on ISO-646. */ +#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>." +#endif + +#line 1 "keyword_list" +struct hash_entry { const char* name; enum parseKey eKey; }; + +#if defined __GNUC__ +#pragma GCC system_header +#endif + +#define TOTAL_KEYWORDS 45 +#define MIN_WORD_LENGTH 7 +#define MAX_WORD_LENGTH 19 +#define MIN_HASH_VALUE 8 +#define MAX_HASH_VALUE 63 +/* maximum key range = 56, duplicates = 0 */ + +class PdfKeywordHash +{ +private: + static inline unsigned int hash (const char *str, unsigned int len); +public: + static const struct hash_entry *in_word_set (const char *str, unsigned int len); +}; + +inline unsigned int +PdfKeywordHash::hash (register const char *str, register unsigned int len) +{ + static const unsigned char asso_values[] = + { + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 14, 64, 38, 64, + 1, 64, 64, 64, 31, 64, 16, 32, 20, 64, + 15, 0, 64, 21, 15, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 0, 14, 64, + 64, 5, 20, 64, 4, 11, 0, 19, 2, 22, + 11, 30, 0, 64, 0, 9, 0, 5, 64, 4, + 64, 13, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, + 64, 64, 64, 64, 64, 64, 64 + }; + return len + asso_values[(unsigned char)str[4]+1] + asso_values[(unsigned char)str[3]] + asso_values[(unsigned char)str[len - 1]]; +} + +const struct hash_entry * +PdfKeywordHash::in_word_set (register const char *str, register unsigned int len) +{ + static const unsigned char lengthtable[] = + { + 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 8, 12, + 8, 10, 10, 12, 13, 9, 15, 16, 17, 14, 15, 15, 10, 13, + 14, 15, 14, 11, 12, 9, 9, 17, 9, 19, 11, 8, 14, 7, + 9, 19, 15, 13, 10, 10, 13, 9, 8, 8, 17, 12, 0, 0, + 0, 0, 0, 0, 0, 10, 0, 8 + }; + static const struct hash_entry wordlist[] = + { + {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 29 "keyword_list" + {"setFont",SETFONT}, + {""}, {""}, {""}, +#line 8 "keyword_list" + {"clipPath",CLIPPATH}, +#line 28 "keyword_list" + {"setFillColor",SETFILLCOLOR}, +#line 19 "keyword_list" + {"fillPath",FILLPATH}, +#line 45 "keyword_list" + {"updateFont",UPDATEFONT}, +#line 17 "keyword_list" + {"eoClipPath",EOCLIPPATH}, +#line 25 "keyword_list" + {"restoreState",RESTORESTATE}, +#line 46 "keyword_list" + {"updateLineCap",UPDATELINECAP}, +#line 38 "keyword_list" + {"startPage",STARTPAGE}, +#line 42 "keyword_list" + {"updateFillColor",UPDATEFILLCOLOR}, +#line 50 "keyword_list" + {"updateMiterLimit",UPDATEMITERLIMIT}, +#line 51 "keyword_list" + {"updateStrokeColor",UPDATESTROKECOLOR}, +#line 47 "keyword_list" + {"updateLineDash",UPDATELINEDASH}, +#line 49 "keyword_list" + {"updateLineWidth",UPDATELINEWIDTH}, +#line 40 "keyword_list" + {"updateBlendMode",UPDATEBLENDMODE}, +#line 30 "keyword_list" + {"setLineCap",SETLINECAP}, +#line 21 "keyword_list" + {"intersectClip",INTERSECTCLIP}, +#line 44 "keyword_list" + {"updateFlatness",UPDATEFLATNESS}, +#line 22 "keyword_list" + {"intersectEoClip",INTERSECTEOCLIP}, +#line 48 "keyword_list" + {"updateLineJoin",UPDATELINEJOIN}, +#line 31 "keyword_list" + {"setLineDash",SETLINEDASH}, +#line 33 "keyword_list" + {"setLineWidth",SETLINEWIDTH}, +#line 24 "keyword_list" + {"pushState",PUSHSTATE}, +#line 26 "keyword_list" + {"saveState",SAVESTATE}, +#line 43 "keyword_list" + {"updateFillOpacity",UPDATEFILLOPACITY}, +#line 41 "keyword_list" + {"updateCtm",UPDATECTM}, +#line 52 "keyword_list" + {"updateStrokeOpacity",UPDATESTROKEOPACITY}, +#line 32 "keyword_list" + {"setLineJoin",SETLINEJOIN}, +#line 23 "keyword_list" + {"popState",POPSTATE}, +#line 36 "keyword_list" + {"setStrokeColor",SETSTROKECOLOR}, +#line 15 "keyword_list" + {"endPage",ENDPAGE}, +#line 20 "keyword_list" + {"hyperLink",HYPERLINK}, +#line 14 "keyword_list" + {"drawSoftMaskedImage",DRAWSOFTMASKEDIMAGE}, +#line 13 "keyword_list" + {"drawMaskedImage",DRAWMASKEDIMAGE}, +#line 34 "keyword_list" + {"setMiterLimit",SETMITERLIMIT}, +#line 39 "keyword_list" + {"strokePath",STROKEPATH}, +#line 18 "keyword_list" + {"eoFillPath",EOFILLPATH}, +#line 16 "keyword_list" + {"endTextObject",ENDTEXTOBJECT}, +#line 10 "keyword_list" + {"drawImage",DRAWIMAGE}, +#line 9 "keyword_list" + {"drawChar",DRAWCHAR}, +#line 12 "keyword_list" + {"drawMask",DRAWMASK}, +#line 37 "keyword_list" + {"setTransformation",SETTRANSFORMATION}, +#line 27 "keyword_list" + {"setBlendMode",SETBLENDMODE}, + {""}, {""}, {""}, {""}, {""}, {""}, {""}, +#line 35 "keyword_list" + {"setPageNum",SETPAGENUM}, + {""}, +#line 11 "keyword_list" + {"drawLink",DRAWLINK } + }; + + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) + { + register int key = hash (str, len); + + if (key <= MAX_HASH_VALUE && key >= 0) + if (len == lengthtable[key]) + { + register const char *s = wordlist[key].name; + + if (*str == *s && !memcmp (str + 1, s + 1, len - 1)) + return &wordlist[key]; + } + } + return 0; +} diff --git a/sdext/source/pdfimport/wrapper/keyword_list b/sdext/source/pdfimport/wrapper/keyword_list new file mode 100755 index 000000000000..b8775fbb93a8 --- /dev/null +++ b/sdext/source/pdfimport/wrapper/keyword_list @@ -0,0 +1,52 @@ +struct hash_entry { const char* name; enum parseKey eKey; }; + +#if defined __GNUC__ +#pragma GCC system_header +#endif + +%% +clipPath,CLIPPATH +drawChar,DRAWCHAR +drawImage,DRAWIMAGE +drawLink,DRAWLINK +drawMask,DRAWMASK +drawMaskedImage,DRAWMASKEDIMAGE +drawSoftMaskedImage,DRAWSOFTMASKEDIMAGE +endPage,ENDPAGE +endTextObject,ENDTEXTOBJECT +eoClipPath,EOCLIPPATH +eoFillPath,EOFILLPATH +fillPath,FILLPATH +hyperLink,HYPERLINK +intersectClip,INTERSECTCLIP +intersectEoClip,INTERSECTEOCLIP +popState,POPSTATE +pushState,PUSHSTATE +restoreState,RESTORESTATE +saveState,SAVESTATE +setBlendMode,SETBLENDMODE +setFillColor,SETFILLCOLOR +setFont,SETFONT +setLineCap,SETLINECAP +setLineDash,SETLINEDASH +setLineJoin,SETLINEJOIN +setLineWidth,SETLINEWIDTH +setMiterLimit,SETMITERLIMIT +setPageNum,SETPAGENUM +setStrokeColor,SETSTROKECOLOR +setTransformation,SETTRANSFORMATION +startPage,STARTPAGE +strokePath,STROKEPATH +updateBlendMode,UPDATEBLENDMODE +updateCtm,UPDATECTM +updateFillColor,UPDATEFILLCOLOR +updateFillOpacity,UPDATEFILLOPACITY +updateFlatness,UPDATEFLATNESS +updateFont,UPDATEFONT +updateLineCap,UPDATELINECAP +updateLineDash,UPDATELINEDASH +updateLineJoin,UPDATELINEJOIN +updateLineWidth,UPDATELINEWIDTH +updateMiterLimit,UPDATEMITERLIMIT +updateStrokeColor,UPDATESTROKECOLOR +updateStrokeOpacity,UPDATESTROKEOPACITY |