X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftex-accent.C;h=2ad2d0d84cb7e09dbb99f399e2f4335973568024;hb=9f7498dbdf16f61cd5c9ee82e0cb6576d2bf620f;hp=75535215a6a0c569b597f18acdb945aba2b36bbf;hpb=0eccdd1c3613e5170deb77b22174dd0afde833e9;p=lyx.git diff --git a/src/tex-accent.C b/src/tex-accent.C index 75535215a6..2ad2d0d84c 100644 --- a/src/tex-accent.C +++ b/src/tex-accent.C @@ -1,5 +1,19 @@ +/* This file is part of + * ====================================================== + * + * LyX, The Document Processor + * + * Copyright 1995 Matthias Ettrich + * Copyright 1995-2000 The LyX Team. + * + * ====================================================== */ + #include +#ifdef __GNUG__ +#pragma implementation +#endif + #include #include "tex-accent.h" #include "commandtags.h" @@ -36,10 +50,9 @@ */ // I am not sure how some of the XWindows names coresponds to the TeX ones. -//static -tex_accent_struct lyx_accent_table[18] ={ - { (tex_accent)0, "", "", "",(kb_action)0}, - {TEX_ACUTE, "\\'", " AEIOUYaeiouySZszRLCNrlcn","acute", LFUN_ACUTE}, +tex_accent_struct lyx_accent_table[18] = { + { static_cast(0), "", "", "", static_cast(0)}, + {TEX_ACUTE, "\\'", " AEIOUYaeiouySZszRLCNrlcn", "acute", LFUN_ACUTE}, {TEX_GRAVE, "\\`", " aeiouAEIOU", "grave", LFUN_GRAVE}, {TEX_MACRON, "\\=", " EeAIOUaiou", "macron", LFUN_MACRON}, {TEX_TILDE, "\\~", " ANOanoIiUu", "tilde", LFUN_TILDE}, @@ -51,43 +64,43 @@ tex_accent_struct lyx_accent_table[18] ={ {TEX_TIE, "\\t", " ", "tie", LFUN_TIE}, {TEX_BREVE, "\\u", " AaGgUu", "breve", LFUN_BREVE}, {TEX_CARON, "\\v", " LSTZlstzCEDNRcednr", "caron", LFUN_CARON}, -// {TEX_SPECIAL_CARON, "\\q", "","ooo", LFUN_SPECIAL_CARON}, +// {TEX_SPECIAL_CARON, "\\q", "", "ooo", LFUN_SPECIAL_CARON}, {TEX_HUNGUML, "\\H", " OUou", "hugarian_umlaut", LFUN_HUNG_UMLAUT}, {TEX_UMLAUT, "\\\"", " AEIOUaeiouy", "umlaut", LFUN_UMLAUT}, {TEX_DOT, "\\.", " ZzICGicgEe", "dot", LFUN_DOT}, {TEX_OGONEK, "\\k", " AaEe", "ogonek", LFUN_OGONEK}, - { (tex_accent)0, "", "", "",(kb_action)0}}; - + { static_cast(0), "", "", "", static_cast(0)}}; + tex_accent_struct get_accent(kb_action action) { - int i=0; - while (i<=TEX_MAX_ACCENT){ + int i = 0; + while (i <= TEX_MAX_ACCENT){ if (lyx_accent_table[i].action == action) return lyx_accent_table[i]; - i++; + ++i; } - struct tex_accent_struct temp = { (tex_accent)0, 0, 0, - 0,(kb_action)0}; + struct tex_accent_struct temp = { static_cast(0), 0, 0, + 0, static_cast(0)}; return temp; } -string DoAccent(const string& s,tex_accent accent) +string DoAccent(string const & s, tex_accent accent) { string res; - res+=lyx_accent_table[accent].cmd; - res+='{'; - if (s=="i" || s=="j") { - res+='\\'; + res += lyx_accent_table[accent].cmd; + res += '{'; + if (s == "i" || s == "j") { + res += '\\'; } - res+=s; - res+='}'; + res += s; + res += '}'; return res; } -string DoAccent(char c,tex_accent accent) +string DoAccent(char c, tex_accent accent) { - return DoAccent(tostr(c),accent); + return DoAccent(tostr(c), accent); }