| OLD | NEW |
| 1 /* ***** BEGIN LICENSE BLOCK ***** | 1 /* ***** BEGIN LICENSE BLOCK ***** |
| 2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
| 3 * | 3 * |
| 4 * The contents of this file are subject to the Mozilla Public License Version | 4 * The contents of this file are subject to the Mozilla Public License Version |
| 5 * 1.1 (the "License"); you may not use this file except in compliance with | 5 * 1.1 (the "License"); you may not use this file except in compliance with |
| 6 * the License. You may obtain a copy of the License at | 6 * the License. You may obtain a copy of the License at |
| 7 * http://www.mozilla.org/MPL/ | 7 * http://www.mozilla.org/MPL/ |
| 8 * | 8 * |
| 9 * Software distributed under the License is distributed on an "AS IS" basis, | 9 * Software distributed under the License is distributed on an "AS IS" basis, |
| 10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | 10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
| 11 * for the specific language governing rights and limitations under the | 11 * for the specific language governing rights and limitations under the |
| 12 * License. | 12 * License. |
| 13 * | 13 * |
| 14 * The Original Code is Hunspell, based on MySpell. | 14 * The Original Code is Hunspell, based on MySpell. |
| 15 * | 15 * |
| 16 * The Initial Developers of the Original Code are | 16 * The Initial Developers of the Original Code are |
| 17 * Kevin Hendricks (MySpell) and Laszlo Nemeth (Hunspell). | 17 * Kevin Hendricks (MySpell) and Németh László (Hunspell). |
| 18 * Portions created by the Initial Developers are Copyright (C) 2002-2005 | 18 * Portions created by the Initial Developers are Copyright (C) 2002-2005 |
| 19 * the Initial Developers. All Rights Reserved. | 19 * the Initial Developers. All Rights Reserved. |
| 20 * | 20 * |
| 21 * Contributor(s): | 21 * Contributor(s): David Einstein, Davide Prina, Giuseppe Modugno, |
| 22 * David Einstein | 22 * Gianluca Turconi, Simon Brouwer, Noll János, Bíró Árpád, |
| 23 * Davide Prina | 23 * Goldman Eleonóra, Sarlós Tamás, Bencsáth Boldizsár, Halácsy Péter, |
| 24 * Giuseppe Modugno | 24 * Dvornik László, Gefferth András, Nagy Viktor, Varga Dániel, Chris Halls, |
| 25 * Gianluca Turconi | 25 * Rene Engelhard, Bram Moolenaar, Dafydd Jones, Harri Pitkänen |
| 26 * Simon Brouwer | |
| 27 * Noll Janos | |
| 28 * Biro Arpad | |
| 29 * Goldman Eleonora | |
| 30 * Sarlos Tamas | |
| 31 * Bencsath Boldizsar | |
| 32 * Halacsy Peter | |
| 33 * Dvornik Laszlo | |
| 34 * Gefferth Andras | |
| 35 * Nagy Viktor | |
| 36 * Varga Daniel | |
| 37 * Chris Halls | |
| 38 * Rene Engelhard | |
| 39 * Bram Moolenaar | |
| 40 * Dafydd Jones | |
| 41 * Harri Pitkanen | |
| 42 * Andras Timar | |
| 43 * Tor Lillqvist | |
| 44 * | 26 * |
| 45 * Alternatively, the contents of this file may be used under the terms of | 27 * Alternatively, the contents of this file may be used under the terms of |
| 46 * either the GNU General Public License Version 2 or later (the "GPL"), or | 28 * either the GNU General Public License Version 2 or later (the "GPL"), or |
| 47 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), | 29 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), |
| 48 * in which case the provisions of the GPL or the LGPL are applicable instead | 30 * in which case the provisions of the GPL or the LGPL are applicable instead |
| 49 * of those above. If you wish to allow use of your version of this file only | 31 * of those above. If you wish to allow use of your version of this file only |
| 50 * under the terms of either the GPL or the LGPL, and not to allow others to | 32 * under the terms of either the GPL or the LGPL, and not to allow others to |
| 51 * use your version of this file under the terms of the MPL, indicate your | 33 * use your version of this file under the terms of the MPL, indicate your |
| 52 * decision by deleting the provisions above and replace them with the notice | 34 * decision by deleting the provisions above and replace them with the notice |
| 53 * and other provisions required by the GPL or the LGPL. If you do not delete | 35 * and other provisions required by the GPL or the LGPL. If you do not delete |
| 54 * the provisions above, a recipient may use your version of this file under | 36 * the provisions above, a recipient may use your version of this file under |
| 55 * the terms of any one of the MPL, the GPL or the LGPL. | 37 * the terms of any one of the MPL, the GPL or the LGPL. |
| 56 * | 38 * |
| 57 * ***** END LICENSE BLOCK ***** */ | 39 * ***** END LICENSE BLOCK ***** */ |
| 58 | 40 |
| 59 #ifndef HUNSPELL_CHROME_CLIENT | 41 #include <cstdlib> |
| 60 #include "config.h" | 42 #include <cstring> |
| 43 #include <cstdio> |
| 44 #include <ctype.h> |
| 45 |
| 46 #include "../hunspell/csutil.hxx" |
| 47 #include "odfparser.hxx" |
| 48 |
| 49 #ifndef W32 |
| 50 using namespace std; |
| 61 #endif | 51 #endif |
| 52 |
| 53 static const char* PATTERN[][2] = { |
| 54 {"<office:meta>", "</office:meta>"}, |
| 55 {"<office:settings>", "</office:settings>"}, |
| 56 {"<office:binary-data>", "</office:binary-data>"}, |
| 57 {"<!--", "-->"}, |
| 58 {"<[cdata[", "]]>"}, // XML comment |
| 59 {"<", ">"}}; |
| 60 |
| 61 #define PATTERN_LEN (sizeof(PATTERN) / (sizeof(char*) * 2)) |
| 62 |
| 63 static const char* (*PATTERN2)[2] = NULL; |
| 64 |
| 65 #define PATTERN_LEN2 0 |
| 66 |
| 67 ODFParser::ODFParser(const char* wordchars) |
| 68 : XMLParser(wordchars) { |
| 69 } |
| 70 |
| 71 ODFParser::ODFParser(const w_char* wordchars, int len) |
| 72 : XMLParser(wordchars, len) { |
| 73 } |
| 74 |
| 75 bool ODFParser::next_token(std::string& t) { |
| 76 return XMLParser::next_token(PATTERN, PATTERN_LEN, PATTERN2, PATTERN_LEN2, t); |
| 77 } |
| 78 |
| 79 ODFParser::~ODFParser() {} |
| OLD | NEW |