Files
libreoffice/hwpfilter/source/hwpeq.cxx

750 lines
24 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
2003-10-15 13:44:37 +00:00
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
// DVO: always use standard headers:
#include <istream>
#include <sstream>
using namespace std;
#include "mzstring.h"
#include "hwpeq.h"
#include <sal/types.h>
#include <sal/macros.h>
2003-10-15 13:44:37 +00:00
/* @Man: hwp수식을 LaTeX으로 바꾸기 */
2003-10-15 13:44:37 +00:00
#ifdef WIN32
# define ENDL "\r\n"
#else /* !WIN32 */
# define ENDL "\n"
#endif
#define WS " \t\r\n\v\f"
#define EQ_CASE 0x01 // case sensitive cmd
#define EQ_ENV 0x02 // equiv to latex environment
#define EQ_ATOP 0x04 // must revert order
#define IS_WS(ch) (strchr(WS, ch))
#define IS_BINARY(ch) (strchr("+-<=>", ch))
#ifdef WIN32
#define STRICMP stricmp
#else
#define STRICMP strcasecmp
#endif
// sub and sup scipt script status
enum { SCRIPT_NONE, SCRIPT_SUB, SCRIPT_SUP, SCRIPT_ALL};
static int eq_word(MzString& outs, istream *strm, int script = SCRIPT_NONE);
static bool eq_sentence(MzString& outs, istream *strm, const char *end = 0);
2003-10-15 13:44:37 +00:00
struct hwpeq {
const char *key; // hwp math keyword
const char *latex; // corresponding latex keywork
int nargs; // # of argument
unsigned char flag; // case sensitive?
};
static const hwpeq eq_tbl[] = {
2003-10-15 13:44:37 +00:00
{ "!=", "\\equiv ", 0, 0 },
{ "#", "\\\\", 0, 0 },
{ "+-", "\\pm ", 0, 0 },
{ "-+", "\\mp ", 0, 0 },
{ "<=", "\\leq ", 0, 0 },
{ "==", "\\equiv ", 0, 0 },
{ ">=", "\\geq ", 0, 0 },
{ "Pr", NULL, 0, 0 },
{ "^", "^", 1, 0 },
{ "_", "_", 1, 0 },
{ "`", "\\;", 0, 0 },
{ "acute", NULL, 1, 0 },
{ "aleph", NULL, 0, 0 },
{ "alpha", NULL, 0, EQ_CASE },
{ "amalg", NULL, 0, 0 },
{ "and", NULL, 0, 0 },
{ "angle", NULL, 0, 0 },
{ "angstrom", NULL, 0, 0 },
{ "approx", NULL, 0, 0 },
{ "arc", NULL, 0, 0 },
{ "arccos", NULL, 0, 0 },
{ "arch", NULL, 0, 0 },
{ "arcsin", NULL, 0, 0 },
{ "arctan", NULL, 0, 0 },
{ "arg", NULL, 0, 0 },
{ "assert", "\\vdash", 0, 0 },
{ "ast", NULL, 0, 0 },
{ "asymp", NULL, 0, 0 },
{ "atop", NULL, 1, EQ_ATOP },
{ "backslash", NULL, 0, 0 },
{ "bar", NULL, 1, 0 },
{ "because", NULL, 0, 0 },
{ "beta", NULL, 0, EQ_CASE },
{ "big", NULL, 0, EQ_CASE },
{ "bigcap", NULL, 0, 0 },
{ "bigcirc", NULL, 0, 0 },
{ "bigcup", NULL, 0, 0 },
{ "bigg", NULL, 0, EQ_CASE },
{ "bigodiv", NULL, 0, 0 },
{ "bigodot", NULL, 0, 0 },
{ "bigominus", NULL, 0, 0 },
{ "bigoplus", NULL, 0, 0 },
{ "bigotimes", NULL, 0, 0 },
{ "bigsqcap", NULL, 0, 0 },
{ "bigsqcup", NULL, 0, 0 },
{ "biguplus", NULL, 0, 0 },
{ "bigvee", NULL, 0, 0 },
{ "bigwedge", NULL, 0, 0 },
{ "binom", NULL, 2, 0 },
{ "bmatrix", NULL, 0, EQ_ENV },
{ "bold", NULL, 0, 0 },
{ "bot", NULL, 0, 0 },
{ "breve", NULL, 1, 0 },
{ "buildrel", NULL, 0, 0 }, // LATER
{ "bullet", NULL, 0, 0 },
{ "cap", NULL, 0, 0 },
{ "cases", NULL, 0, EQ_ENV },
{ "ccol", NULL, 0, 0 }, /* 세로로 가운데 */
2003-10-15 13:44:37 +00:00
{ "cdot", NULL, 0, 0 },
{ "cdots", NULL, 0, 0 },
{ "check", NULL, 1, 0 },
{ "chi", NULL, 0, EQ_CASE },
{ "choose", NULL, 0, EQ_ATOP },
{ "circ", NULL, 0, 0 },
{ "col", NULL, 0, 0 }, // LATER
{ "cong", NULL, 0, 0 },
{ "coprod", NULL, 0, 0 },
{ "cos", NULL, 0, 0 },
{ "cosec", NULL, 0, 0 },
{ "cosh", NULL, 0, 0 },
{ "cot", NULL, 0, 0 },
{ "coth", NULL, 0, 0 },
{ "cpile", NULL, 0, 0 }, // LATER
{ "csc", NULL, 0, 0 },
{ "cup", NULL, 0, 0 },
{ "dagger", NULL, 0, 0 },
{ "dashv", NULL, 0, 0 },
{ "ddagger", NULL, 0, 0 },
{ "ddot", NULL, 1, 0 },
{ "ddots", NULL, 0, 0 },
{ "def", NULL, 0, 0 },
{ "deg", NULL, 0, 0 },
{ "del", NULL, 0, 0 },
{ "delta", NULL, 0, EQ_CASE },
{ "diamond", NULL, 0, 0 },
{ "dim", NULL, 0, 0 },
{ "div", NULL, 0, 0 },
{ "divide", NULL, 0, 0 },
{ "dline", NULL, 0, 0 },
{ "dmatrix", NULL, 0, EQ_ENV },
{ "dot", NULL, 1, 0 },
{ "doteq", NULL, 0, 0 },
{ "dotsaxis", NULL, 0, 0 },
{ "dotsdiag", NULL, 0, 0 },
{ "dotslow", "\\ldots", 0, 0 },
{ "dotsvert", "\\vdots", 0, 0 },
{ "downarrow", NULL, 0, EQ_CASE },
{ "dsum", "+", 0, 0 },
{ "dyad", NULL, 0, 0 }, // LATER
{ "ell", NULL, 0, 0 },
{ "emptyset", NULL, 0, 0 },
{ "epsilon", NULL, 0, EQ_CASE },
{ "eqalign", NULL, 0, EQ_ENV },
{ "equiv", NULL, 0, 0 },
{ "eta", NULL, 0, EQ_CASE },
{ "exarrow", NULL, 0, 0 },
{ "exist", "\\exists", 0, 0 },
{ "exists", NULL, 0, 0 },
{ "exp", NULL, 0, EQ_CASE },
{ "for", NULL, 0, 0 },
{ "forall", NULL, 0, 0 },
{ "from", "_", 1, 0 },
{ "gamma", NULL, 0, EQ_CASE },
{ "gcd", NULL, 0, 0 },
{ "ge", "\\geq", 0, 0 },
{ "geq", NULL, 0, 0 },
{ "ggg", NULL, 0, 0 },
{ "grad", NULL, 0, 0 },
{ "grave", NULL, 1, 0 },
{ "hat", "\\widehat", 1, 0 },
{ "hbar", NULL, 0, 0 },
{ "hom", NULL, 0, 0 },
{ "hookleft", NULL, 0, 0 },
{ "hookright", NULL, 0, 0 },
{ "identical", NULL, 0, 0 }, // LATER
{ "if", NULL, 0, 0 },
{ "imag", NULL, 0, 0 },
{ "image", NULL, 0, 0 },
{ "imath", NULL, 0, 0 },
{ "in", NULL, 0, 0 },
{ "inf", "\\infty", 0, 0 },
{ "infinity", "\\infty", 0, 0 },
{ "infty", NULL, 0, 0 },
{ "int", NULL, 0, 0 },
{ "integral", "\\int", 0, 0 },
{ "inter", "\\bigcap", 0, 0 },
{ "iota", NULL, 0, EQ_CASE },
{ "iso", NULL, 0, 0 }, // ams
{ "it", NULL, 0, 0 },
{ "jmath", NULL, 0, 0 },
{ "kappa", NULL, 0, EQ_CASE },
{ "ker", NULL, 0, 0 },
{ "lambda", NULL, 0, EQ_CASE },
{ "land", NULL, 0, 0 }, // LATER
{ "langle", NULL, 0, 0 },
{ "larrow", "\\leftarrow", 0, EQ_CASE },
{ "lbrace", NULL, 0, 0 },
{ "lbrack", "[", 0, 0 },
{ "lceil", NULL, 0, 0 },
{ "lcol", NULL, 0, 0 }, // LATER
{ "ldots", NULL, 0, 0 },
{ "le", NULL, 0, 0 },
{ "left", NULL, 0, 0 },
{ "leftarrow", NULL, 0, EQ_CASE },
{ "leq", NULL, 0, 0 },
{ "lfloor", NULL, 0, 0 },
{ "lg", NULL, 0, 0 },
{ "lim", NULL, 0, EQ_CASE },
{ "line", "\\vert", 0, 0 },
{ "liter", "\\ell", 0, 0 },
{ "lll", NULL, 0, 0 }, // ams
{ "ln", NULL, 0, 0 },
{ "log", NULL, 0, 0 },
{ "lor", "\\vee", 0, 0 },
{ "lparen", "(", 0, 0 },
{ "lpile", NULL, 0, 0 }, // LATER
{ "lrarrow", "\\leftrightarrow", 0, EQ_CASE },
{ "lrharpoons", "\\leftrightharpoons",0, 0 },
{ "mapsto", NULL, 0, 0 },
{ "massert", "\\dashv", 0, 0 },
{ "matrix", NULL, 0, EQ_ENV },
{ "max", NULL, 0, 0 },
{ "mho", NULL, 0, 0 }, // ams
{ "min", NULL, 0, 0 },
{ "minusplus", NULL, 0, 0 },
{ "mit", "", 0, 0 }, // font
{ "mod", "\\bmod", 0, 0 },
{ "models", NULL, 0, 0 },
{ "msangle", NULL, 0, 0 }, // LATER
{ "mu", NULL, 0, EQ_CASE },
{ "nabla", NULL, 0, 0 },
{ "ne", NULL, 0, 0 },
{ "nearrow", NULL, 0, 0 },
{ "neg", NULL, 0, 0 },
{ "neq", NULL, 0, 0 },
{ "nequiv", NULL, 0, 0 },
{ "ni", NULL, 0, 0 },
{ "not", NULL, 0, 0 },
{ "notin", NULL, 0, 0 },
{ "nu", NULL, 0, EQ_CASE },
{ "nwarrow", NULL, 0, 0 },
{ "odiv", NULL, 0, 0 },
{ "odot", NULL, 0, 0 },
{ "oint", NULL, 0, 0 },
{ "omega", NULL, 0, EQ_CASE },
{ "omicron", NULL, 0, EQ_CASE },
{ "ominus", NULL, 0, 0 },
{ "oplus", NULL, 0, 0 },
{ "or ", NULL, 0, 0 },
{ "oslash", NULL, 0, 0 },
{ "otimes", NULL, 0, 0 },
{ "over", NULL, 1, EQ_ATOP },
{ "overline", NULL, 1, 0 },
{ "owns", "\\ni", 0, 0 },
{ "parallel", NULL, 0, 0 },
{ "partial", NULL, 0, 0 },
{ "phantom", NULL, 0, 0 },
{ "phi", NULL, 0, EQ_CASE },
{ "pi", NULL, 0, EQ_CASE },
{ "pile", NULL, 0, 0 }, // LATER
{ "plusminus", "\\pm", 0, 0 },
{ "pmatrix", NULL, 0, EQ_ENV },
{ "prec", NULL, 0, 0 },
{ "prep", NULL, 0, 0 },
{ "prime", NULL, 0, 0 },
{ "prod", NULL, 0, 0 },
{ "propto", NULL, 0, 0 },
{ "psi", NULL, 0, EQ_CASE },
{ "rangle", NULL, 0, 0 },
{ "rarrow", "\\rightarrow", 0, EQ_CASE },
{ "rbrace", "]", 0, 0 },
{ "rbrace", NULL, 0, 0 },
{ "rceil", NULL, 0, 0 },
{ "rcol", NULL, 0, 0 }, // LATER
{ "real", "\\Re", 0, 0 },
{ "reimage", NULL, 0, 0 },
{ "rel", NULL, 0, 0 },
{ "rfloor", NULL, 0, 0 },
{ "rho", NULL, 0, EQ_CASE },
{ "right", NULL, 0, 0 },
{ "rightarrow", NULL, 0, EQ_CASE },
{ "rlharpoons", NULL, 0, 0 },
{ "rm", NULL, 0, 0 },
{ "root", "\\sqrt", 1, 0 },
{ "rparen", ")", 0, 0 },
{ "rpile", NULL, 0, 0 }, // LATER
{ "rtangle", NULL, 0, 0 },
{ "sangle", NULL, 0, 0 },
{ "scale", NULL, 0, 0 },
{ "searrow", NULL, 0, 0 },
{ "sec", NULL, 0, 0 },
{ "sigma", NULL, 0, EQ_CASE },
{ "sim", NULL, 0, 0 },
{ "simeq", NULL, 0, 0 },
{ "sin", NULL, 0, 0 },
{ "sinh", NULL, 0, 0 },
{ "slash", NULL, 0, 0 },
{ "smallint", NULL, 0, 0 },
{ "smallinter", NULL, 0, 0 },
{ "smalloint", NULL, 0, 0 },
{ "smallprod", NULL, 0, 0 },
{ "smallsum", NULL, 0, 0 },
{ "smallunion", NULL, 0, 0 },
{ "smcoprod", NULL, 0, 0 },
{ "sqcap", NULL, 0, 0 },
{ "sqcup", NULL, 0, 0 },
{ "sqrt", NULL, 1, 0 },
{ "sqsubset", NULL, 0, 0 },
{ "sqsubseteq", NULL, 0, 0 },
{ "sqsupset", NULL, 0, 0 },
{ "sqsupseteq", NULL, 0, 0 },
{ "star", NULL, 0, 0 },
{ "sub", "_", 0, 0 },
{ "subset", NULL, 0, 0 },
{ "subseteq", NULL, 0, 0 },
{ "succ", NULL, 0, 0 },
{ "sum", NULL, 0, 0 },
{ "sup", "^", 0, 0 },
{ "superset", NULL, 0, 0 },
{ "supset", NULL, 0, 0 },
{ "supseteq", NULL, 0, 0 },
{ "swarrow", NULL, 0, 0 },
{ "tan", NULL, 0, 0 },
{ "tanh", NULL, 0, 0 },
{ "tau", NULL, 0, EQ_CASE },
{ "therefore", NULL, 0, 0 },
{ "theta", NULL, 0, EQ_CASE },
{ "tilde", "\\widetilde", 1, 0 },
{ "times", NULL, 0, 0 },
{ "to", "^", 1, 0 },
{ "top", NULL, 0, 0 },
{ "triangle", NULL, 0, 0 },
{ "triangled", NULL, 0, 0 },
{ "trianglel", NULL, 0, 0 },
{ "triangler", NULL, 0, 0 },
{ "triangleu", NULL, 0, 0 },
{ "udarrow", "\\updownarrow",0, EQ_CASE },
{ "under", "\\underline", 1, 0 },
{ "underline", "\\underline", 1, 0 },
{ "union", "\\bigcup", 0, 0 },
{ "uparrow", NULL, 0, EQ_CASE },
{ "uplus", NULL, 0, 0 },
{ "upsilon", NULL, 0, EQ_CASE },
{ "varepsilon", NULL, 0, 0 },
{ "varphi", NULL, 0, 0 },
{ "varpi", NULL, 0, 0 },
{ "varrho", NULL, 0, 0 },
{ "varsigma", NULL, 0, 0 },
{ "vartheta", NULL, 0, 0 },
{ "varupsilon", NULL, 0, 0 },
{ "vdash", NULL, 0, 0 },
{ "vdots", NULL, 0, 0 },
{ "vec", NULL, 1, 0 },
{ "vee", NULL, 0, 0 },
{ "vert", NULL, 0, 0 },
{ "wedge", NULL, 0, 0 },
{ "wp", NULL, 0, 0 },
{ "xi", NULL, 0, EQ_CASE },
{ "xor", NULL, 0, 0 },
{ "zeta", NULL, 0, EQ_CASE }
};
static const hwpeq *lookup_eqn(char *str)
2003-10-15 13:44:37 +00:00
{
static const int eqCount = SAL_N_ELEMENTS(eq_tbl);
2003-10-15 13:44:37 +00:00
int m, k, l = 0, r = eqCount;
const hwpeq *result = 0;
2003-10-15 13:44:37 +00:00
while( l < r ) {
m = (l + r) / 2;
k = strcmp(eq_tbl[m].key, str);
if( k == 0 ) {
result = eq_tbl + m;;
break;
}
else if( k < 0 )
l = m + 1;
else
r = m;
}
return result;
}
/* 첫자만 대문자이거나 전부 대문자면 소문자로 바꾼다. */
2003-10-15 13:44:37 +00:00
static char *make_keyword( char *keyword, const char *token)
{
assert(keyword);
char *ptr;
bool result = true;
int len = strlen(token);
2003-10-15 13:44:37 +00:00
if( 255 < len )
strncpy(keyword, token, 255);
else
strcpy(keyword, token);
if( (token[0] & 0x80) || islower(token[0]) ||
strlen(token) < 2 )
return keyword;
int capital = isupper(keyword[1]);
for( ptr = keyword + 2; *ptr && result; ptr++ )
if( (*ptr & 0x80) ||
(!capital && isupper(*ptr)) ||
(capital && islower(*ptr)) )
result = false;
if( result ) {
ptr = keyword;
while( *ptr ) {
if( isupper(*ptr) )
*ptr = sal::static_int_cast<char>(tolower(*ptr));
2003-10-15 13:44:37 +00:00
ptr++;
}
}
return keyword;
}
Many spelling fixes: directories h* - p*. Attempt to clean up most but certainly not all the spelling mistakes that found home in OpenOffice through decades. We could probably blame the international nature of the code but it is somewhat shameful that this wasn't done before. (cherry picked from commit 11a1ff6144521aeabb0c6db25c89a2ac31bedee0) Conflicts: external/libxmlsec/xmlsec1-customkeymanage.patch hwpfilter/source/hwpeq.cxx icc/README icu/createmak.pl idl/source/objects/object.cxx idlc/inc/idlc/errorhandler.hxx include/jvmfwk/framework.h include/oox/helper/propertyset.hxx instsetoo_native/inc_ure/windows/msi_templates/_Validat.idt javainstaller2/src/JavaSetup/org/openoffice/setup/Controller/PrologueCtrl.java javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/LinuxInstaller.java javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/SolarisInstaller.java javainstaller2/src/JavaSetup/org/openoffice/setup/InstallerHelper/LinuxHelper.java javainstaller2/src/JavaSetup/org/openoffice/setup/SetupData/ProductDescription.java javainstaller2/src/JavaSetup/org/openoffice/setup/Util/Controller.java javainstaller2/src/JavaSetup/org/openoffice/setup/Util/ExecuteProcess.java javaunohelper/com/sun/star/comp/helper/SharedLibraryLoader.java javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java jurt/com/sun/star/comp/servicemanager/ServiceManager.java jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx jvmfwk/source/elements.cxx jvmfwk/source/elements.hxx l10ntools/inc/wtranode.hxx l10ntools/inc/wtratree.hxx l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Convert.java l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ConverterException.java l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/FileMaker.java l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIWriter.java l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIandSDFMerger.java l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFReader.java l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFWriter.java l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFWriter.java l10ntools/scripts/localize.pl l10ntools/scripts/localize_old.pl l10ntools/source/cfgmerge.cxx l10ntools/source/export.cxx l10ntools/source/filter/merge/FCFGMerge.java l10ntools/source/filter/merge/Merger.java l10ntools/source/filter/utils/Cache.java l10ntools/source/filter/utils/ConfigHelper.java l10ntools/source/filter/utils/FileHelper.java l10ntools/source/filter/utils/XMLHelper.java l10ntools/source/merge.cxx l10ntools/source/tagtest.cxx l10ntools/source/xmlparse.cxx l10ntools/source/xrmmerge.cxx libtextcat/libtextcat-2.2.patch libxml2/libxml2-long-path.patch linguistic/inc/linguistic/misc.hxx linguistic/source/lngsvcmgr.cxx migrationanalysis/src/driver_docs/allstrings.ulf migrationanalysis/src/driver_docs/sources/AnalysisDriver.bas migrationanalysis/src/driver_docs/sources/CommonMigrationAnalyser.bas migrationanalysis/src/driver_docs/sources/word/MigrationAnalyser.cls migrationanalysis/src/msokill/msokill.cpp migrationanalysis/src/wizard/Wizard.frm odk/examples/DevelopersGuide/Accessibility/EventHandler.java odk/examples/DevelopersGuide/Accessibility/EventListenerProxy.java odk/examples/DevelopersGuide/Accessibility/GraphicalDisplay.java odk/examples/DevelopersGuide/Forms/DataAwareness.java odk/examples/DevelopersGuide/Forms/KeyGenerator.java odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/FunctionHelper.java odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Interceptor.java odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/NativeView.java odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusView.java odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/ViewContainer.java odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/FilterOptions.java odk/examples/cpp/complextoolbarcontrols/Makefile odk/setsdkenv_windows.template offapi/com/sun/star/accessibility/AccessibleEventId.idl offapi/com/sun/star/accessibility/AccessibleEventObject.idl offapi/com/sun/star/accessibility/AccessibleRelationType.idl offapi/com/sun/star/accessibility/XAccessible.idl offapi/com/sun/star/accessibility/XAccessibleRelationSet.idl offapi/com/sun/star/accessibility/XAccessibleStateSet.idl offapi/com/sun/star/animations/Event.idl offapi/com/sun/star/animations/XAnimationNode.idl offapi/com/sun/star/awt/AccessibleListBoxList.idl offapi/com/sun/star/awt/XLayoutFlow.idl offapi/com/sun/star/awt/XMessageBoxFactory.idl offapi/com/sun/star/awt/XPopupMenu.idl offapi/com/sun/star/awt/grid/XGridColumn.idl offapi/com/sun/star/chart/ChartAxis.idl offapi/com/sun/star/chart2/data/TabularDataProviderArguments.idl offapi/com/sun/star/chart2/data/XDatabaseDataProvider.idl offapi/com/sun/star/configuration/AdministrationProvider.idl offapi/com/sun/star/configuration/ConfigurationRegistry.idl offapi/com/sun/star/configuration/backend/XBackendChangesNotifier.idl offapi/com/sun/star/datatransfer/XDataFormatTranslator.idl offapi/com/sun/star/datatransfer/clipboard/RenderingCapabilities.idl offapi/com/sun/star/deployment/InvalidRemovedParameterException.idl offapi/com/sun/star/document/DocumentInfo.idl offapi/com/sun/star/document/EmptyUndoStackException.idl offapi/com/sun/star/document/EventObject.idl offapi/com/sun/star/document/ExtendedTypeDetection.idl offapi/com/sun/star/document/ExtendedTypeDetectionFactory.idl offapi/com/sun/star/document/FilterFactory.idl offapi/com/sun/star/document/MediaDescriptor.idl offapi/com/sun/star/document/NoSuchFilterRequest.idl offapi/com/sun/star/document/OfficeDocument.idl offapi/com/sun/star/document/TypeDetection.idl offapi/com/sun/star/document/UndoContextNotClosedException.idl offapi/com/sun/star/document/XExtendedFilterDetection.idl offapi/com/sun/star/document/XFilter.idl offapi/com/sun/star/document/XInteractionFilterSelect.idl offapi/com/sun/star/document/XTypeDetection.idl offapi/com/sun/star/drawing/Hatch.idl offapi/com/sun/star/drawing/XDrawPages.idl offapi/com/sun/star/drawing/XShapeBinder.idl offapi/com/sun/star/drawing/framework/XConfigurationControllerRequestQueue.idl offapi/com/sun/star/drawing/framework/XRelocatableResource.idl offapi/com/sun/star/embed/ElementModes.idl offapi/com/sun/star/embed/EntryInitModes.idl offapi/com/sun/star/embed/Storage.idl offapi/com/sun/star/embed/StorageFactory.idl offapi/com/sun/star/embed/StorageStream.idl offapi/com/sun/star/embed/XCommonEmbedPersist.idl offapi/com/sun/star/embed/XEmbedObjectClipboardCreator.idl offapi/com/sun/star/embed/XEmbeddedClient.idl offapi/com/sun/star/embed/XInplaceClient.idl offapi/com/sun/star/embed/XInplaceObject.idl offapi/com/sun/star/embed/XInsertObjectDialog.idl offapi/com/sun/star/embed/XPersistanceHolder.idl offapi/com/sun/star/embed/XStorage.idl offapi/com/sun/star/embed/XTransactionBroadcaster.idl offapi/com/sun/star/embed/XTransactionListener.idl offapi/com/sun/star/form/FormComponents.idl offapi/com/sun/star/form/XSubmitListener.idl offapi/com/sun/star/form/binding/BindableDataAwareControlModel.idl offapi/com/sun/star/form/binding/BindableDatabaseListBox.idl offapi/com/sun/star/form/component/DatabaseComboBox.idl offapi/com/sun/star/form/component/DatabaseFormattedField.idl offapi/com/sun/star/form/component/DatabasePatternField.idl offapi/com/sun/star/form/component/DatabaseTextField.idl offapi/com/sun/star/form/component/GridControl.idl offapi/com/sun/star/frame/Components.idl offapi/com/sun/star/frame/ContentHandler.idl offapi/com/sun/star/frame/ContentHandlerFactory.idl offapi/com/sun/star/frame/Desktop.idl offapi/com/sun/star/frame/DispatchDescriptor.idl offapi/com/sun/star/frame/DispatchProvider.idl offapi/com/sun/star/frame/DispatchRecorder.idl offapi/com/sun/star/frame/Frame.idl offapi/com/sun/star/frame/FrameActionEvent.idl offapi/com/sun/star/frame/FrameLoaderFactory.idl offapi/com/sun/star/frame/ProtocolHandler.idl offapi/com/sun/star/frame/XControlNotificationListener.idl offapi/com/sun/star/frame/XDesktop.idl offapi/com/sun/star/frame/XDispatchRecorderSupplier.idl offapi/com/sun/star/frame/XDocumentTemplates.idl offapi/com/sun/star/frame/XFrame.idl offapi/com/sun/star/frame/XFrameLoader.idl offapi/com/sun/star/frame/XInterceptorInfo.idl offapi/com/sun/star/frame/XRecordableDispatch.idl offapi/com/sun/star/frame/XStatusbarController.idl offapi/com/sun/star/frame/XStorable2.idl offapi/com/sun/star/frame/XSynchronousDispatch.idl offapi/com/sun/star/frame/XTerminateListener2.idl offapi/com/sun/star/graphic/GraphicObject.idl offapi/com/sun/star/graphic/XGraphicObject.idl offapi/com/sun/star/inspection/XNumericControl.idl offapi/com/sun/star/inspection/XObjectInspectorModel.idl offapi/com/sun/star/inspection/XPropertyHandler.idl offapi/com/sun/star/installation/XProtocolHandlerCheck.idl offapi/com/sun/star/installation/protocols.idl offapi/com/sun/star/linguistic2/SpellFailure.idl offapi/com/sun/star/linguistic2/XLinguServiceManager.idl offapi/com/sun/star/mail/XMailServer.idl offapi/com/sun/star/mozilla/XPluginInstance.idl offapi/com/sun/star/mozilla/XPluginInstanceSyncPeer.idl offapi/com/sun/star/packages/zip/ZipIOException.idl offapi/com/sun/star/presentation/OutlineView.idl offapi/com/sun/star/presentation/XPresentation2.idl offapi/com/sun/star/presentation/XSlideShow.idl offapi/com/sun/star/presentation/XSlideShowController.idl offapi/com/sun/star/report/XFunction.idl offapi/com/sun/star/report/XFunctionsSupplier.idl offapi/com/sun/star/report/XReportComponent.idl offapi/com/sun/star/report/XReportDefinition.idl offapi/com/sun/star/report/meta/XFunctionManager.idl offapi/com/sun/star/resource/XStringResourcePersistence.idl offapi/com/sun/star/resource/XStringResourceWithLocation.idl offapi/com/sun/star/resource/XStringResourceWithStorage.idl offapi/com/sun/star/sdb/DataSettings.idl offapi/com/sun/star/sdb/ErrorCondition.idl offapi/com/sun/star/sdb/SQLContext.idl offapi/com/sun/star/sdb/Table.idl offapi/com/sun/star/sdb/XRowSetApproveListener.idl offapi/com/sun/star/sdb/application/XDatabaseDocumentUI.idl offapi/com/sun/star/sdb/tools/XConnectionTools.idl offapi/com/sun/star/sdbc/DataType.idl offapi/com/sun/star/sdbc/XDatabaseMetaData.idl offapi/com/sun/star/sdbcx/Descriptor.idl offapi/com/sun/star/security/DocumentSignatureInformation.idl offapi/com/sun/star/sheet/AccessibleSpreadsheetDocumentView.idl offapi/com/sun/star/sheet/AccessibleSpreadsheetPageView.idl offapi/com/sun/star/sheet/DatabaseRange.idl offapi/com/sun/star/smarttags/XSmartTagAction.idl offapi/com/sun/star/table/AccessibleTableView.idl offapi/com/sun/star/table/CellProperties.idl offapi/com/sun/star/table/CellRangeListSource.idl offapi/com/sun/star/table/CellValueBinding.idl offapi/com/sun/star/table/XMergeableCellRange.idl offapi/com/sun/star/task/DocumentPasswordRequest.idl offapi/com/sun/star/task/JobExecutor.idl offapi/com/sun/star/task/MasterPasswordRequest.idl offapi/com/sun/star/task/PasswordRequest.idl offapi/com/sun/star/task/XJob.idl offapi/com/sun/star/text/AccessiblePageView.idl offapi/com/sun/star/text/AccessibleTextDocumentView.idl offapi/com/sun/star/text/LineNumberingProperties.idl offapi/com/sun/star/text/NumberingRules.idl offapi/com/sun/star/text/XRelativeTextContentRemove.idl offapi/com/sun/star/text/textfield/Database.idl offapi/com/sun/star/text/textfield/SetExpression.idl offapi/com/sun/star/text/textfield/docinfo/Description.idl offapi/com/sun/star/text/textfield/docinfo/Info0.idl offapi/com/sun/star/text/textfield/docinfo/Info1.idl offapi/com/sun/star/text/textfield/docinfo/Info2.idl offapi/com/sun/star/text/textfield/docinfo/Info3.idl offapi/com/sun/star/text/textfield/docinfo/Keywords.idl offapi/com/sun/star/text/textfield/docinfo/Revision.idl offapi/com/sun/star/text/textfield/docinfo/Subject.idl offapi/com/sun/star/text/textfield/docinfo/Title.idl offapi/com/sun/star/ucb/CommandFailedException.idl offapi/com/sun/star/ucb/Content.idl offapi/com/sun/star/ucb/ContentAction.idl offapi/com/sun/star/ucb/FetchError.idl offapi/com/sun/star/ucb/FetchResult.idl offapi/com/sun/star/ucb/HierarchyDataSource.idl offapi/com/sun/star/ucb/InteractiveFileIOException.idl offapi/com/sun/star/ucb/SearchRecursion.idl offapi/com/sun/star/ucb/UniversalContentBroker.idl offapi/com/sun/star/ucb/XAnyCompare.idl offapi/com/sun/star/ucb/XCachedContentResultSetFactory.idl offapi/com/sun/star/ucb/XCachedDynamicResultSetFactory.idl offapi/com/sun/star/ucb/XContentIdentifierMapping.idl offapi/com/sun/star/ui/UIElementType.idl offapi/com/sun/star/ui/dialogs/FilePicker.idl offapi/com/sun/star/ui/dialogs/FolderPicker.idl offapi/com/sun/star/util/PathSubstitution.idl offapi/com/sun/star/util/XChangesNotifier.idl offapi/com/sun/star/util/XCloseBroadcaster.idl offapi/com/sun/star/util/XCloseListener.idl offapi/com/sun/star/util/XCloseable.idl offapi/com/sun/star/util/XStringSubstitution.idl offapi/com/sun/star/util/XTextSearch.idl offapi/com/sun/star/util/XURLTransformer.idl offapi/com/sun/star/xforms/XModel.idl offapi/com/sun/star/xml/sax/XFastAttributeList.idl offapi/com/sun/star/xml/sax/XFastParser.idl officecfg/registry/data/org/openoffice/Office/Labels.xcu officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu officecfg/registry/schema/org/openoffice/Office/Common.xcs officecfg/registry/schema/org/openoffice/Office/Embedding.xcs officecfg/registry/schema/org/openoffice/Office/ExtensionDependencies.xcs officecfg/registry/schema/org/openoffice/Office/ExtensionManager.xcs officecfg/registry/schema/org/openoffice/Office/Histories.xcs officecfg/registry/schema/org/openoffice/Office/OptionsDialog.xcs officecfg/registry/schema/org/openoffice/Office/Paths.xcs officecfg/registry/schema/org/openoffice/Office/PresenterScreen.xcs officecfg/registry/schema/org/openoffice/Office/TabBrowse.xcs officecfg/registry/schema/org/openoffice/Office/UI.xcs officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs officecfg/registry/schema/org/openoffice/Office/UI/WindowState.xcs officecfg/registry/schema/org/openoffice/Office/WebWizard.xcs officecfg/registry/schema/org/openoffice/Office/Writer.xcs officecfg/registry/schema/org/openoffice/Setup.xcs officecfg/registry/schema/org/openoffice/TypeDetection/Types.xcs oox/source/xls/sheetdatabuffer.cxx package/source/xstor/xstorage.cxx padmin/source/padialog.src postprocess/signing/signing.pl pyuno/source/module/pyuno_module.cxx Change-Id: I60c7b6d661ff803b5e9214ac7fefb32772ef19a7
2014-04-29 19:11:53 +00:00
// token reading function
2003-10-15 13:44:37 +00:00
struct eq_stack {
MzString white;
MzString token;
istream *strm;
eq_stack() { strm = 0; };
bool state(istream *s) {
if( strm != s) { white = 0; token = 0; }
return token.length() != 0;
}
};
static eq_stack *stk = 0;
void push_token(MzString &white, MzString &token, istream *strm)
{
// one time stack
assert(stk->state(strm) == false);
stk->white = white;
stk->token = token;
stk->strm = strm;
}
Many spelling fixes: directories h* - p*. Attempt to clean up most but certainly not all the spelling mistakes that found home in OpenOffice through decades. We could probably blame the international nature of the code but it is somewhat shameful that this wasn't done before. (cherry picked from commit 11a1ff6144521aeabb0c6db25c89a2ac31bedee0) Conflicts: external/libxmlsec/xmlsec1-customkeymanage.patch hwpfilter/source/hwpeq.cxx icc/README icu/createmak.pl idl/source/objects/object.cxx idlc/inc/idlc/errorhandler.hxx include/jvmfwk/framework.h include/oox/helper/propertyset.hxx instsetoo_native/inc_ure/windows/msi_templates/_Validat.idt javainstaller2/src/JavaSetup/org/openoffice/setup/Controller/PrologueCtrl.java javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/LinuxInstaller.java javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/SolarisInstaller.java javainstaller2/src/JavaSetup/org/openoffice/setup/InstallerHelper/LinuxHelper.java javainstaller2/src/JavaSetup/org/openoffice/setup/SetupData/ProductDescription.java javainstaller2/src/JavaSetup/org/openoffice/setup/Util/Controller.java javainstaller2/src/JavaSetup/org/openoffice/setup/Util/ExecuteProcess.java javaunohelper/com/sun/star/comp/helper/SharedLibraryLoader.java javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java jurt/com/sun/star/comp/servicemanager/ServiceManager.java jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx jvmfwk/source/elements.cxx jvmfwk/source/elements.hxx l10ntools/inc/wtranode.hxx l10ntools/inc/wtratree.hxx l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Convert.java l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ConverterException.java l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/FileMaker.java l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIWriter.java l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIandSDFMerger.java l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFReader.java l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFWriter.java l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFWriter.java l10ntools/scripts/localize.pl l10ntools/scripts/localize_old.pl l10ntools/source/cfgmerge.cxx l10ntools/source/export.cxx l10ntools/source/filter/merge/FCFGMerge.java l10ntools/source/filter/merge/Merger.java l10ntools/source/filter/utils/Cache.java l10ntools/source/filter/utils/ConfigHelper.java l10ntools/source/filter/utils/FileHelper.java l10ntools/source/filter/utils/XMLHelper.java l10ntools/source/merge.cxx l10ntools/source/tagtest.cxx l10ntools/source/xmlparse.cxx l10ntools/source/xrmmerge.cxx libtextcat/libtextcat-2.2.patch libxml2/libxml2-long-path.patch linguistic/inc/linguistic/misc.hxx linguistic/source/lngsvcmgr.cxx migrationanalysis/src/driver_docs/allstrings.ulf migrationanalysis/src/driver_docs/sources/AnalysisDriver.bas migrationanalysis/src/driver_docs/sources/CommonMigrationAnalyser.bas migrationanalysis/src/driver_docs/sources/word/MigrationAnalyser.cls migrationanalysis/src/msokill/msokill.cpp migrationanalysis/src/wizard/Wizard.frm odk/examples/DevelopersGuide/Accessibility/EventHandler.java odk/examples/DevelopersGuide/Accessibility/EventListenerProxy.java odk/examples/DevelopersGuide/Accessibility/GraphicalDisplay.java odk/examples/DevelopersGuide/Forms/DataAwareness.java odk/examples/DevelopersGuide/Forms/KeyGenerator.java odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/FunctionHelper.java odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Interceptor.java odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/NativeView.java odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusView.java odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/ViewContainer.java odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/FilterOptions.java odk/examples/cpp/complextoolbarcontrols/Makefile odk/setsdkenv_windows.template offapi/com/sun/star/accessibility/AccessibleEventId.idl offapi/com/sun/star/accessibility/AccessibleEventObject.idl offapi/com/sun/star/accessibility/AccessibleRelationType.idl offapi/com/sun/star/accessibility/XAccessible.idl offapi/com/sun/star/accessibility/XAccessibleRelationSet.idl offapi/com/sun/star/accessibility/XAccessibleStateSet.idl offapi/com/sun/star/animations/Event.idl offapi/com/sun/star/animations/XAnimationNode.idl offapi/com/sun/star/awt/AccessibleListBoxList.idl offapi/com/sun/star/awt/XLayoutFlow.idl offapi/com/sun/star/awt/XMessageBoxFactory.idl offapi/com/sun/star/awt/XPopupMenu.idl offapi/com/sun/star/awt/grid/XGridColumn.idl offapi/com/sun/star/chart/ChartAxis.idl offapi/com/sun/star/chart2/data/TabularDataProviderArguments.idl offapi/com/sun/star/chart2/data/XDatabaseDataProvider.idl offapi/com/sun/star/configuration/AdministrationProvider.idl offapi/com/sun/star/configuration/ConfigurationRegistry.idl offapi/com/sun/star/configuration/backend/XBackendChangesNotifier.idl offapi/com/sun/star/datatransfer/XDataFormatTranslator.idl offapi/com/sun/star/datatransfer/clipboard/RenderingCapabilities.idl offapi/com/sun/star/deployment/InvalidRemovedParameterException.idl offapi/com/sun/star/document/DocumentInfo.idl offapi/com/sun/star/document/EmptyUndoStackException.idl offapi/com/sun/star/document/EventObject.idl offapi/com/sun/star/document/ExtendedTypeDetection.idl offapi/com/sun/star/document/ExtendedTypeDetectionFactory.idl offapi/com/sun/star/document/FilterFactory.idl offapi/com/sun/star/document/MediaDescriptor.idl offapi/com/sun/star/document/NoSuchFilterRequest.idl offapi/com/sun/star/document/OfficeDocument.idl offapi/com/sun/star/document/TypeDetection.idl offapi/com/sun/star/document/UndoContextNotClosedException.idl offapi/com/sun/star/document/XExtendedFilterDetection.idl offapi/com/sun/star/document/XFilter.idl offapi/com/sun/star/document/XInteractionFilterSelect.idl offapi/com/sun/star/document/XTypeDetection.idl offapi/com/sun/star/drawing/Hatch.idl offapi/com/sun/star/drawing/XDrawPages.idl offapi/com/sun/star/drawing/XShapeBinder.idl offapi/com/sun/star/drawing/framework/XConfigurationControllerRequestQueue.idl offapi/com/sun/star/drawing/framework/XRelocatableResource.idl offapi/com/sun/star/embed/ElementModes.idl offapi/com/sun/star/embed/EntryInitModes.idl offapi/com/sun/star/embed/Storage.idl offapi/com/sun/star/embed/StorageFactory.idl offapi/com/sun/star/embed/StorageStream.idl offapi/com/sun/star/embed/XCommonEmbedPersist.idl offapi/com/sun/star/embed/XEmbedObjectClipboardCreator.idl offapi/com/sun/star/embed/XEmbeddedClient.idl offapi/com/sun/star/embed/XInplaceClient.idl offapi/com/sun/star/embed/XInplaceObject.idl offapi/com/sun/star/embed/XInsertObjectDialog.idl offapi/com/sun/star/embed/XPersistanceHolder.idl offapi/com/sun/star/embed/XStorage.idl offapi/com/sun/star/embed/XTransactionBroadcaster.idl offapi/com/sun/star/embed/XTransactionListener.idl offapi/com/sun/star/form/FormComponents.idl offapi/com/sun/star/form/XSubmitListener.idl offapi/com/sun/star/form/binding/BindableDataAwareControlModel.idl offapi/com/sun/star/form/binding/BindableDatabaseListBox.idl offapi/com/sun/star/form/component/DatabaseComboBox.idl offapi/com/sun/star/form/component/DatabaseFormattedField.idl offapi/com/sun/star/form/component/DatabasePatternField.idl offapi/com/sun/star/form/component/DatabaseTextField.idl offapi/com/sun/star/form/component/GridControl.idl offapi/com/sun/star/frame/Components.idl offapi/com/sun/star/frame/ContentHandler.idl offapi/com/sun/star/frame/ContentHandlerFactory.idl offapi/com/sun/star/frame/Desktop.idl offapi/com/sun/star/frame/DispatchDescriptor.idl offapi/com/sun/star/frame/DispatchProvider.idl offapi/com/sun/star/frame/DispatchRecorder.idl offapi/com/sun/star/frame/Frame.idl offapi/com/sun/star/frame/FrameActionEvent.idl offapi/com/sun/star/frame/FrameLoaderFactory.idl offapi/com/sun/star/frame/ProtocolHandler.idl offapi/com/sun/star/frame/XControlNotificationListener.idl offapi/com/sun/star/frame/XDesktop.idl offapi/com/sun/star/frame/XDispatchRecorderSupplier.idl offapi/com/sun/star/frame/XDocumentTemplates.idl offapi/com/sun/star/frame/XFrame.idl offapi/com/sun/star/frame/XFrameLoader.idl offapi/com/sun/star/frame/XInterceptorInfo.idl offapi/com/sun/star/frame/XRecordableDispatch.idl offapi/com/sun/star/frame/XStatusbarController.idl offapi/com/sun/star/frame/XStorable2.idl offapi/com/sun/star/frame/XSynchronousDispatch.idl offapi/com/sun/star/frame/XTerminateListener2.idl offapi/com/sun/star/graphic/GraphicObject.idl offapi/com/sun/star/graphic/XGraphicObject.idl offapi/com/sun/star/inspection/XNumericControl.idl offapi/com/sun/star/inspection/XObjectInspectorModel.idl offapi/com/sun/star/inspection/XPropertyHandler.idl offapi/com/sun/star/installation/XProtocolHandlerCheck.idl offapi/com/sun/star/installation/protocols.idl offapi/com/sun/star/linguistic2/SpellFailure.idl offapi/com/sun/star/linguistic2/XLinguServiceManager.idl offapi/com/sun/star/mail/XMailServer.idl offapi/com/sun/star/mozilla/XPluginInstance.idl offapi/com/sun/star/mozilla/XPluginInstanceSyncPeer.idl offapi/com/sun/star/packages/zip/ZipIOException.idl offapi/com/sun/star/presentation/OutlineView.idl offapi/com/sun/star/presentation/XPresentation2.idl offapi/com/sun/star/presentation/XSlideShow.idl offapi/com/sun/star/presentation/XSlideShowController.idl offapi/com/sun/star/report/XFunction.idl offapi/com/sun/star/report/XFunctionsSupplier.idl offapi/com/sun/star/report/XReportComponent.idl offapi/com/sun/star/report/XReportDefinition.idl offapi/com/sun/star/report/meta/XFunctionManager.idl offapi/com/sun/star/resource/XStringResourcePersistence.idl offapi/com/sun/star/resource/XStringResourceWithLocation.idl offapi/com/sun/star/resource/XStringResourceWithStorage.idl offapi/com/sun/star/sdb/DataSettings.idl offapi/com/sun/star/sdb/ErrorCondition.idl offapi/com/sun/star/sdb/SQLContext.idl offapi/com/sun/star/sdb/Table.idl offapi/com/sun/star/sdb/XRowSetApproveListener.idl offapi/com/sun/star/sdb/application/XDatabaseDocumentUI.idl offapi/com/sun/star/sdb/tools/XConnectionTools.idl offapi/com/sun/star/sdbc/DataType.idl offapi/com/sun/star/sdbc/XDatabaseMetaData.idl offapi/com/sun/star/sdbcx/Descriptor.idl offapi/com/sun/star/security/DocumentSignatureInformation.idl offapi/com/sun/star/sheet/AccessibleSpreadsheetDocumentView.idl offapi/com/sun/star/sheet/AccessibleSpreadsheetPageView.idl offapi/com/sun/star/sheet/DatabaseRange.idl offapi/com/sun/star/smarttags/XSmartTagAction.idl offapi/com/sun/star/table/AccessibleTableView.idl offapi/com/sun/star/table/CellProperties.idl offapi/com/sun/star/table/CellRangeListSource.idl offapi/com/sun/star/table/CellValueBinding.idl offapi/com/sun/star/table/XMergeableCellRange.idl offapi/com/sun/star/task/DocumentPasswordRequest.idl offapi/com/sun/star/task/JobExecutor.idl offapi/com/sun/star/task/MasterPasswordRequest.idl offapi/com/sun/star/task/PasswordRequest.idl offapi/com/sun/star/task/XJob.idl offapi/com/sun/star/text/AccessiblePageView.idl offapi/com/sun/star/text/AccessibleTextDocumentView.idl offapi/com/sun/star/text/LineNumberingProperties.idl offapi/com/sun/star/text/NumberingRules.idl offapi/com/sun/star/text/XRelativeTextContentRemove.idl offapi/com/sun/star/text/textfield/Database.idl offapi/com/sun/star/text/textfield/SetExpression.idl offapi/com/sun/star/text/textfield/docinfo/Description.idl offapi/com/sun/star/text/textfield/docinfo/Info0.idl offapi/com/sun/star/text/textfield/docinfo/Info1.idl offapi/com/sun/star/text/textfield/docinfo/Info2.idl offapi/com/sun/star/text/textfield/docinfo/Info3.idl offapi/com/sun/star/text/textfield/docinfo/Keywords.idl offapi/com/sun/star/text/textfield/docinfo/Revision.idl offapi/com/sun/star/text/textfield/docinfo/Subject.idl offapi/com/sun/star/text/textfield/docinfo/Title.idl offapi/com/sun/star/ucb/CommandFailedException.idl offapi/com/sun/star/ucb/Content.idl offapi/com/sun/star/ucb/ContentAction.idl offapi/com/sun/star/ucb/FetchError.idl offapi/com/sun/star/ucb/FetchResult.idl offapi/com/sun/star/ucb/HierarchyDataSource.idl offapi/com/sun/star/ucb/InteractiveFileIOException.idl offapi/com/sun/star/ucb/SearchRecursion.idl offapi/com/sun/star/ucb/UniversalContentBroker.idl offapi/com/sun/star/ucb/XAnyCompare.idl offapi/com/sun/star/ucb/XCachedContentResultSetFactory.idl offapi/com/sun/star/ucb/XCachedDynamicResultSetFactory.idl offapi/com/sun/star/ucb/XContentIdentifierMapping.idl offapi/com/sun/star/ui/UIElementType.idl offapi/com/sun/star/ui/dialogs/FilePicker.idl offapi/com/sun/star/ui/dialogs/FolderPicker.idl offapi/com/sun/star/util/PathSubstitution.idl offapi/com/sun/star/util/XChangesNotifier.idl offapi/com/sun/star/util/XCloseBroadcaster.idl offapi/com/sun/star/util/XCloseListener.idl offapi/com/sun/star/util/XCloseable.idl offapi/com/sun/star/util/XStringSubstitution.idl offapi/com/sun/star/util/XTextSearch.idl offapi/com/sun/star/util/XURLTransformer.idl offapi/com/sun/star/xforms/XModel.idl offapi/com/sun/star/xml/sax/XFastAttributeList.idl offapi/com/sun/star/xml/sax/XFastParser.idl officecfg/registry/data/org/openoffice/Office/Labels.xcu officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu officecfg/registry/schema/org/openoffice/Office/Common.xcs officecfg/registry/schema/org/openoffice/Office/Embedding.xcs officecfg/registry/schema/org/openoffice/Office/ExtensionDependencies.xcs officecfg/registry/schema/org/openoffice/Office/ExtensionManager.xcs officecfg/registry/schema/org/openoffice/Office/Histories.xcs officecfg/registry/schema/org/openoffice/Office/OptionsDialog.xcs officecfg/registry/schema/org/openoffice/Office/Paths.xcs officecfg/registry/schema/org/openoffice/Office/PresenterScreen.xcs officecfg/registry/schema/org/openoffice/Office/TabBrowse.xcs officecfg/registry/schema/org/openoffice/Office/UI.xcs officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs officecfg/registry/schema/org/openoffice/Office/UI/WindowState.xcs officecfg/registry/schema/org/openoffice/Office/WebWizard.xcs officecfg/registry/schema/org/openoffice/Office/Writer.xcs officecfg/registry/schema/org/openoffice/Setup.xcs officecfg/registry/schema/org/openoffice/TypeDetection/Types.xcs oox/source/xls/sheetdatabuffer.cxx package/source/xstor/xstorage.cxx padmin/source/padialog.src postprocess/signing/signing.pl pyuno/source/module/pyuno_module.cxx Change-Id: I60c7b6d661ff803b5e9214ac7fefb32772ef19a7
2014-04-29 19:11:53 +00:00
/*
.
*/
2003-10-15 13:44:37 +00:00
/* control char, control sequence, binary sequence,
alphabet string, sigle character */
static int next_token(MzString &white, MzString &token, istream *strm)
{
int ch = 0;
2003-10-15 13:44:37 +00:00
if( stk->state(strm) ) {
white = stk->white;
token = stk->token;
stk->token = 0;
stk->white = 0;
return token.length();
}
token = 0;
white = 0;
if( !strm->good() || (ch = strm->get()) == EOF )
return 0;
Many spelling fixes: directories h* - p*. Attempt to clean up most but certainly not all the spelling mistakes that found home in OpenOffice through decades. We could probably blame the international nature of the code but it is somewhat shameful that this wasn't done before. (cherry picked from commit 11a1ff6144521aeabb0c6db25c89a2ac31bedee0) Conflicts: external/libxmlsec/xmlsec1-customkeymanage.patch hwpfilter/source/hwpeq.cxx icc/README icu/createmak.pl idl/source/objects/object.cxx idlc/inc/idlc/errorhandler.hxx include/jvmfwk/framework.h include/oox/helper/propertyset.hxx instsetoo_native/inc_ure/windows/msi_templates/_Validat.idt javainstaller2/src/JavaSetup/org/openoffice/setup/Controller/PrologueCtrl.java javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/LinuxInstaller.java javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/SolarisInstaller.java javainstaller2/src/JavaSetup/org/openoffice/setup/InstallerHelper/LinuxHelper.java javainstaller2/src/JavaSetup/org/openoffice/setup/SetupData/ProductDescription.java javainstaller2/src/JavaSetup/org/openoffice/setup/Util/Controller.java javainstaller2/src/JavaSetup/org/openoffice/setup/Util/ExecuteProcess.java javaunohelper/com/sun/star/comp/helper/SharedLibraryLoader.java javaunohelper/com/sun/star/lib/uno/helper/MultiTypeInterfaceContainer.java jurt/com/sun/star/comp/servicemanager/ServiceManager.java jvmfwk/plugins/sunmajor/pluginlib/sunversion.cxx jvmfwk/source/elements.cxx jvmfwk/source/elements.hxx l10ntools/inc/wtranode.hxx l10ntools/inc/wtratree.hxx l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Convert.java l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ConverterException.java l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/FileMaker.java l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIWriter.java l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIandSDFMerger.java l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFReader.java l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFWriter.java l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFWriter.java l10ntools/scripts/localize.pl l10ntools/scripts/localize_old.pl l10ntools/source/cfgmerge.cxx l10ntools/source/export.cxx l10ntools/source/filter/merge/FCFGMerge.java l10ntools/source/filter/merge/Merger.java l10ntools/source/filter/utils/Cache.java l10ntools/source/filter/utils/ConfigHelper.java l10ntools/source/filter/utils/FileHelper.java l10ntools/source/filter/utils/XMLHelper.java l10ntools/source/merge.cxx l10ntools/source/tagtest.cxx l10ntools/source/xmlparse.cxx l10ntools/source/xrmmerge.cxx libtextcat/libtextcat-2.2.patch libxml2/libxml2-long-path.patch linguistic/inc/linguistic/misc.hxx linguistic/source/lngsvcmgr.cxx migrationanalysis/src/driver_docs/allstrings.ulf migrationanalysis/src/driver_docs/sources/AnalysisDriver.bas migrationanalysis/src/driver_docs/sources/CommonMigrationAnalyser.bas migrationanalysis/src/driver_docs/sources/word/MigrationAnalyser.cls migrationanalysis/src/msokill/msokill.cpp migrationanalysis/src/wizard/Wizard.frm odk/examples/DevelopersGuide/Accessibility/EventHandler.java odk/examples/DevelopersGuide/Accessibility/EventListenerProxy.java odk/examples/DevelopersGuide/Accessibility/GraphicalDisplay.java odk/examples/DevelopersGuide/Forms/DataAwareness.java odk/examples/DevelopersGuide/Forms/KeyGenerator.java odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/DocumentView.java odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/FunctionHelper.java odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/Interceptor.java odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/NativeView.java odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/OnewayExecutor.java odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusListener.java odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/StatusView.java odk/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/ViewContainer.java odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/AsciiReplaceFilter.java odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/AsciiFilter/FilterOptions.java odk/examples/cpp/complextoolbarcontrols/Makefile odk/setsdkenv_windows.template offapi/com/sun/star/accessibility/AccessibleEventId.idl offapi/com/sun/star/accessibility/AccessibleEventObject.idl offapi/com/sun/star/accessibility/AccessibleRelationType.idl offapi/com/sun/star/accessibility/XAccessible.idl offapi/com/sun/star/accessibility/XAccessibleRelationSet.idl offapi/com/sun/star/accessibility/XAccessibleStateSet.idl offapi/com/sun/star/animations/Event.idl offapi/com/sun/star/animations/XAnimationNode.idl offapi/com/sun/star/awt/AccessibleListBoxList.idl offapi/com/sun/star/awt/XLayoutFlow.idl offapi/com/sun/star/awt/XMessageBoxFactory.idl offapi/com/sun/star/awt/XPopupMenu.idl offapi/com/sun/star/awt/grid/XGridColumn.idl offapi/com/sun/star/chart/ChartAxis.idl offapi/com/sun/star/chart2/data/TabularDataProviderArguments.idl offapi/com/sun/star/chart2/data/XDatabaseDataProvider.idl offapi/com/sun/star/configuration/AdministrationProvider.idl offapi/com/sun/star/configuration/ConfigurationRegistry.idl offapi/com/sun/star/configuration/backend/XBackendChangesNotifier.idl offapi/com/sun/star/datatransfer/XDataFormatTranslator.idl offapi/com/sun/star/datatransfer/clipboard/RenderingCapabilities.idl offapi/com/sun/star/deployment/InvalidRemovedParameterException.idl offapi/com/sun/star/document/DocumentInfo.idl offapi/com/sun/star/document/EmptyUndoStackException.idl offapi/com/sun/star/document/EventObject.idl offapi/com/sun/star/document/ExtendedTypeDetection.idl offapi/com/sun/star/document/ExtendedTypeDetectionFactory.idl offapi/com/sun/star/document/FilterFactory.idl offapi/com/sun/star/document/MediaDescriptor.idl offapi/com/sun/star/document/NoSuchFilterRequest.idl offapi/com/sun/star/document/OfficeDocument.idl offapi/com/sun/star/document/TypeDetection.idl offapi/com/sun/star/document/UndoContextNotClosedException.idl offapi/com/sun/star/document/XExtendedFilterDetection.idl offapi/com/sun/star/document/XFilter.idl offapi/com/sun/star/document/XInteractionFilterSelect.idl offapi/com/sun/star/document/XTypeDetection.idl offapi/com/sun/star/drawing/Hatch.idl offapi/com/sun/star/drawing/XDrawPages.idl offapi/com/sun/star/drawing/XShapeBinder.idl offapi/com/sun/star/drawing/framework/XConfigurationControllerRequestQueue.idl offapi/com/sun/star/drawing/framework/XRelocatableResource.idl offapi/com/sun/star/embed/ElementModes.idl offapi/com/sun/star/embed/EntryInitModes.idl offapi/com/sun/star/embed/Storage.idl offapi/com/sun/star/embed/StorageFactory.idl offapi/com/sun/star/embed/StorageStream.idl offapi/com/sun/star/embed/XCommonEmbedPersist.idl offapi/com/sun/star/embed/XEmbedObjectClipboardCreator.idl offapi/com/sun/star/embed/XEmbeddedClient.idl offapi/com/sun/star/embed/XInplaceClient.idl offapi/com/sun/star/embed/XInplaceObject.idl offapi/com/sun/star/embed/XInsertObjectDialog.idl offapi/com/sun/star/embed/XPersistanceHolder.idl offapi/com/sun/star/embed/XStorage.idl offapi/com/sun/star/embed/XTransactionBroadcaster.idl offapi/com/sun/star/embed/XTransactionListener.idl offapi/com/sun/star/form/FormComponents.idl offapi/com/sun/star/form/XSubmitListener.idl offapi/com/sun/star/form/binding/BindableDataAwareControlModel.idl offapi/com/sun/star/form/binding/BindableDatabaseListBox.idl offapi/com/sun/star/form/component/DatabaseComboBox.idl offapi/com/sun/star/form/component/DatabaseFormattedField.idl offapi/com/sun/star/form/component/DatabasePatternField.idl offapi/com/sun/star/form/component/DatabaseTextField.idl offapi/com/sun/star/form/component/GridControl.idl offapi/com/sun/star/frame/Components.idl offapi/com/sun/star/frame/ContentHandler.idl offapi/com/sun/star/frame/ContentHandlerFactory.idl offapi/com/sun/star/frame/Desktop.idl offapi/com/sun/star/frame/DispatchDescriptor.idl offapi/com/sun/star/frame/DispatchProvider.idl offapi/com/sun/star/frame/DispatchRecorder.idl offapi/com/sun/star/frame/Frame.idl offapi/com/sun/star/frame/FrameActionEvent.idl offapi/com/sun/star/frame/FrameLoaderFactory.idl offapi/com/sun/star/frame/ProtocolHandler.idl offapi/com/sun/star/frame/XControlNotificationListener.idl offapi/com/sun/star/frame/XDesktop.idl offapi/com/sun/star/frame/XDispatchRecorderSupplier.idl offapi/com/sun/star/frame/XDocumentTemplates.idl offapi/com/sun/star/frame/XFrame.idl offapi/com/sun/star/frame/XFrameLoader.idl offapi/com/sun/star/frame/XInterceptorInfo.idl offapi/com/sun/star/frame/XRecordableDispatch.idl offapi/com/sun/star/frame/XStatusbarController.idl offapi/com/sun/star/frame/XStorable2.idl offapi/com/sun/star/frame/XSynchronousDispatch.idl offapi/com/sun/star/frame/XTerminateListener2.idl offapi/com/sun/star/graphic/GraphicObject.idl offapi/com/sun/star/graphic/XGraphicObject.idl offapi/com/sun/star/inspection/XNumericControl.idl offapi/com/sun/star/inspection/XObjectInspectorModel.idl offapi/com/sun/star/inspection/XPropertyHandler.idl offapi/com/sun/star/installation/XProtocolHandlerCheck.idl offapi/com/sun/star/installation/protocols.idl offapi/com/sun/star/linguistic2/SpellFailure.idl offapi/com/sun/star/linguistic2/XLinguServiceManager.idl offapi/com/sun/star/mail/XMailServer.idl offapi/com/sun/star/mozilla/XPluginInstance.idl offapi/com/sun/star/mozilla/XPluginInstanceSyncPeer.idl offapi/com/sun/star/packages/zip/ZipIOException.idl offapi/com/sun/star/presentation/OutlineView.idl offapi/com/sun/star/presentation/XPresentation2.idl offapi/com/sun/star/presentation/XSlideShow.idl offapi/com/sun/star/presentation/XSlideShowController.idl offapi/com/sun/star/report/XFunction.idl offapi/com/sun/star/report/XFunctionsSupplier.idl offapi/com/sun/star/report/XReportComponent.idl offapi/com/sun/star/report/XReportDefinition.idl offapi/com/sun/star/report/meta/XFunctionManager.idl offapi/com/sun/star/resource/XStringResourcePersistence.idl offapi/com/sun/star/resource/XStringResourceWithLocation.idl offapi/com/sun/star/resource/XStringResourceWithStorage.idl offapi/com/sun/star/sdb/DataSettings.idl offapi/com/sun/star/sdb/ErrorCondition.idl offapi/com/sun/star/sdb/SQLContext.idl offapi/com/sun/star/sdb/Table.idl offapi/com/sun/star/sdb/XRowSetApproveListener.idl offapi/com/sun/star/sdb/application/XDatabaseDocumentUI.idl offapi/com/sun/star/sdb/tools/XConnectionTools.idl offapi/com/sun/star/sdbc/DataType.idl offapi/com/sun/star/sdbc/XDatabaseMetaData.idl offapi/com/sun/star/sdbcx/Descriptor.idl offapi/com/sun/star/security/DocumentSignatureInformation.idl offapi/com/sun/star/sheet/AccessibleSpreadsheetDocumentView.idl offapi/com/sun/star/sheet/AccessibleSpreadsheetPageView.idl offapi/com/sun/star/sheet/DatabaseRange.idl offapi/com/sun/star/smarttags/XSmartTagAction.idl offapi/com/sun/star/table/AccessibleTableView.idl offapi/com/sun/star/table/CellProperties.idl offapi/com/sun/star/table/CellRangeListSource.idl offapi/com/sun/star/table/CellValueBinding.idl offapi/com/sun/star/table/XMergeableCellRange.idl offapi/com/sun/star/task/DocumentPasswordRequest.idl offapi/com/sun/star/task/JobExecutor.idl offapi/com/sun/star/task/MasterPasswordRequest.idl offapi/com/sun/star/task/PasswordRequest.idl offapi/com/sun/star/task/XJob.idl offapi/com/sun/star/text/AccessiblePageView.idl offapi/com/sun/star/text/AccessibleTextDocumentView.idl offapi/com/sun/star/text/LineNumberingProperties.idl offapi/com/sun/star/text/NumberingRules.idl offapi/com/sun/star/text/XRelativeTextContentRemove.idl offapi/com/sun/star/text/textfield/Database.idl offapi/com/sun/star/text/textfield/SetExpression.idl offapi/com/sun/star/text/textfield/docinfo/Description.idl offapi/com/sun/star/text/textfield/docinfo/Info0.idl offapi/com/sun/star/text/textfield/docinfo/Info1.idl offapi/com/sun/star/text/textfield/docinfo/Info2.idl offapi/com/sun/star/text/textfield/docinfo/Info3.idl offapi/com/sun/star/text/textfield/docinfo/Keywords.idl offapi/com/sun/star/text/textfield/docinfo/Revision.idl offapi/com/sun/star/text/textfield/docinfo/Subject.idl offapi/com/sun/star/text/textfield/docinfo/Title.idl offapi/com/sun/star/ucb/CommandFailedException.idl offapi/com/sun/star/ucb/Content.idl offapi/com/sun/star/ucb/ContentAction.idl offapi/com/sun/star/ucb/FetchError.idl offapi/com/sun/star/ucb/FetchResult.idl offapi/com/sun/star/ucb/HierarchyDataSource.idl offapi/com/sun/star/ucb/InteractiveFileIOException.idl offapi/com/sun/star/ucb/SearchRecursion.idl offapi/com/sun/star/ucb/UniversalContentBroker.idl offapi/com/sun/star/ucb/XAnyCompare.idl offapi/com/sun/star/ucb/XCachedContentResultSetFactory.idl offapi/com/sun/star/ucb/XCachedDynamicResultSetFactory.idl offapi/com/sun/star/ucb/XContentIdentifierMapping.idl offapi/com/sun/star/ui/UIElementType.idl offapi/com/sun/star/ui/dialogs/FilePicker.idl offapi/com/sun/star/ui/dialogs/FolderPicker.idl offapi/com/sun/star/util/PathSubstitution.idl offapi/com/sun/star/util/XChangesNotifier.idl offapi/com/sun/star/util/XCloseBroadcaster.idl offapi/com/sun/star/util/XCloseListener.idl offapi/com/sun/star/util/XCloseable.idl offapi/com/sun/star/util/XStringSubstitution.idl offapi/com/sun/star/util/XTextSearch.idl offapi/com/sun/star/util/XURLTransformer.idl offapi/com/sun/star/xforms/XModel.idl offapi/com/sun/star/xml/sax/XFastAttributeList.idl offapi/com/sun/star/xml/sax/XFastParser.idl officecfg/registry/data/org/openoffice/Office/Labels.xcu officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu officecfg/registry/schema/org/openoffice/Office/Common.xcs officecfg/registry/schema/org/openoffice/Office/Embedding.xcs officecfg/registry/schema/org/openoffice/Office/ExtensionDependencies.xcs officecfg/registry/schema/org/openoffice/Office/ExtensionManager.xcs officecfg/registry/schema/org/openoffice/Office/Histories.xcs officecfg/registry/schema/org/openoffice/Office/OptionsDialog.xcs officecfg/registry/schema/org/openoffice/Office/Paths.xcs officecfg/registry/schema/org/openoffice/Office/PresenterScreen.xcs officecfg/registry/schema/org/openoffice/Office/TabBrowse.xcs officecfg/registry/schema/org/openoffice/Office/UI.xcs officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs officecfg/registry/schema/org/openoffice/Office/UI/WindowState.xcs officecfg/registry/schema/org/openoffice/Office/WebWizard.xcs officecfg/registry/schema/org/openoffice/Office/Writer.xcs officecfg/registry/schema/org/openoffice/Setup.xcs officecfg/registry/schema/org/openoffice/TypeDetection/Types.xcs oox/source/xls/sheetdatabuffer.cxx package/source/xstor/xstorage.cxx padmin/source/padialog.src postprocess/signing/signing.pl pyuno/source/module/pyuno_module.cxx Change-Id: I60c7b6d661ff803b5e9214ac7fefb32772ef19a7
2014-04-29 19:11:53 +00:00
// read preceding ws
2003-10-15 13:44:37 +00:00
if( IS_WS(ch) ) {
do white << (char) ch;
while( IS_WS(ch = strm->get()) );
}
if( ch == '\\' || ch & 0x80 || isalpha(ch) ) {
if( ch == '\\' ) {
token << (char) ch;
ch = strm->get();
}
do {
token << (char) ch;
ch = strm->get();
} while( ch != EOF && (ch & 0x80 || isalpha(ch)) ) ;
strm->putback(sal::static_int_cast<char>(ch));
/* sub, sub, over, atop 특수 처리
next_state() .
*/
2003-10-15 13:44:37 +00:00
if( !STRICMP("sub", token) || !STRICMP("from", token) ||
!STRICMP("sup", token) || !STRICMP("to", token) ||
!STRICMP("over", token) || !STRICMP("atop", token) ||
!STRICMP("left", token) || !STRICMP("right", token) )
{
char buf[256];
make_keyword(buf, token);
token = buf;
}
if( !token.compare("sub") || !token.compare("from") )
token = "_";
if( !token.compare("sup") || !token.compare("to") )
token = "^";
}
else if( IS_BINARY(ch) ) {
do token << (char) ch;
while( IS_BINARY(ch = strm->get()) );
strm->putback(sal::static_int_cast<char>(ch));
2003-10-15 13:44:37 +00:00
}
else if( isdigit(ch) ) {
do token << (char) ch;
while( isdigit(ch = strm->get()) );
strm->putback(sal::static_int_cast<char>(ch));
2003-10-15 13:44:37 +00:00
}
else
token << (char) ch;
2011-01-30 22:57:10 +01:00
2003-10-15 13:44:37 +00:00
return token.length();
}
static int read_white_space(MzString& outs, istream *strm)
{
2011-06-09 23:06:51 +02:00
int result;
2003-10-15 13:44:37 +00:00
if( stk->state(strm) ) {
outs << stk->white;
stk->white = 0;
result = stk->token[0];
}
else {
2011-06-09 23:06:51 +02:00
int ch;
2003-10-15 13:44:37 +00:00
while( IS_WS(ch = strm->get()) )
outs << (char )ch;
strm->putback(sal::static_int_cast<char>(ch));
2003-10-15 13:44:37 +00:00
result = ch;
}
return result;
}
/* 인수가 필요하지 않은 경우 각 항목간의 구분은 space와 brace
sqrt {ab}c = sqrt{ab} c
(, } grouping
^, _ .
sqrt
sqrt a -> sqrt{a}
sqrt {a} -> sqrt{a}
1 .
\frac a b -> frac{a}{b}
over의
a over b -> {a}over{b}
*/
2003-10-15 13:44:37 +00:00
static int eq_word(MzString& outs, istream *strm, int status)
{
MzString token, white, state;
2011-06-09 23:06:51 +02:00
int result;
2003-10-15 13:44:37 +00:00
char keyword[256];
const hwpeq *eq;
2003-10-15 13:44:37 +00:00
next_token(white, token, strm);
if (token.length() <= 0)
return 0;
result = token[0];
if( token.compare("{") == 0 ) {
state << white << token;
eq_sentence(state, strm, "}");
}
else if( token.compare("left") == 0 ) {
state << white << token;
next_token(white, token, strm);
state << white << token;
eq_sentence(state, strm, "right");
next_token(white, token, strm);
state << white << token;
}
else {
/* 정상적인 token */
2003-10-15 13:44:37 +00:00
int script_status = SCRIPT_NONE;
while( true ) {
2003-10-15 13:44:37 +00:00
state << white << token;
make_keyword(keyword, token);
if( token[0] == '^' )
script_status |= SCRIPT_SUP;
else if( token[0] == '_' )
script_status |= SCRIPT_SUB;
else
script_status = SCRIPT_NONE;
if( 0 != (eq = lookup_eqn(keyword)) ) {
2011-06-09 23:06:51 +02:00
int nargs = eq->nargs;
int ch;
2003-10-15 13:44:37 +00:00
while( nargs-- ) {
ch = read_white_space(state, strm);
if( ch != '{' ) state << '{';
eq_word(state, strm, script_status);
if( ch != '{' ) state << '}';
}
}
if( !next_token(white, token, strm) )
break;
// end loop and restart with this
if( (token[0] == '^' && status && !(status & SCRIPT_SUP)) ||
(token[0] == '_' && status && !(status & SCRIPT_SUB)) ||
strcmp("over", token) == 0 || strcmp("atop", token) == 0 ||
strchr("{}#&`", token[0]) ||
(!strchr("^_", token[0]) && white.length()) ) {
push_token(white, token, strm);
break;
}
}
}
outs << state;
2011-01-30 22:57:10 +01:00
2003-10-15 13:44:37 +00:00
return result;
}
static bool eq_sentence(MzString& outs, istream *strm, const char *end)
2003-10-15 13:44:37 +00:00
{
MzString state;
MzString white, token;
bool multiline = false;
read_white_space(outs, strm);
while( eq_word(state, strm) ) {
if( !next_token(white, token, strm) ||
(end && strcmp(token.c_str(), end) == 0) )
{
state << white << token;
break;
}
push_token(white, token, strm);
if( !token.compare("atop") || !token.compare("over") )
outs << '{' << state << '}';
else {
if( !token.compare("#") )
multiline = true;
outs << state;
}
state = 0;
read_white_space(outs, strm);
}
outs << state;
return multiline;
}
static char eq2ltxconv(MzString& sstr, istream *strm, const char *sentinel)
{
MzString white, token;
char key[256];
2003-10-15 13:44:37 +00:00
int ch, result;
const hwpeq *eq = 0;
2003-10-15 13:44:37 +00:00
while( 0 != (result = next_token(white, token, strm)) ) {
2003-10-15 13:44:37 +00:00
if( sentinel && (result == 1) && strchr(sentinel, token[0]) )
break;
make_keyword(key, token);
if( (eq = lookup_eqn(key)) != 0 ) {
if( eq->latex )
strcpy(key, eq->latex);
else {
key[0] = '\\';
strcpy(key + 1, eq->key);
}
if( (eq->flag & EQ_CASE) && isupper(token[0]) )
key[1] = sal::static_int_cast<char>(toupper(key[1]));
2003-10-15 13:44:37 +00:00
token = key;
}
if( token[0] == '{' ) { // grouping
sstr << white << token;
eq2ltxconv(sstr, strm, "}");
sstr << '}';
}
else if( eq && (eq->flag & EQ_ENV) ) {
next_token(white, token, strm);
if( token[0] != '{' ) return 0;
sstr << "\\begin" << "{" << eq->key << "}" << ENDL ;
eq2ltxconv(sstr, strm, "}");
if( sstr[sstr.length() - 1] != '\n' )
sstr << ENDL ;
sstr << "\\end" << "{" << eq->key << "}" << ENDL ;
}
else if( eq && (eq->flag & EQ_ATOP) ) {
if( sstr.length() == 0 )
sstr << '{';
else {
int pos = sstr.rfind('}');
if( 0 < pos)
sstr.replace(pos, ' ');
}
sstr << token;
while( (ch = strm->get()) != EOF && IS_WS(ch) )
sstr << (char)ch;
if( ch != '{' )
sstr << "{}";
else {
eq2ltxconv(sstr, strm, "}");
sstr << '}';
}
}
else
sstr << white << token;
}
return token[0];
}
void eq2latex(MzString& outs, char *s)
{
assert(s);
if( stk == 0 )
stk = new eq_stack;
MzString tstr;
istringstream tstrm(s);
2003-10-15 13:44:37 +00:00
bool eqnarray = eq_sentence(tstr, &tstrm);
istringstream strm(tstr.c_str());
2003-10-15 13:44:37 +00:00
if( eqnarray )
outs << "\\begin{array}{rllll}" << ENDL;
eq2ltxconv(outs, &strm, 0);
outs << ENDL;
if( eqnarray )
outs << "\\end{array}" << ENDL;
delete stk;
stk = 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */