X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftex-accent.C;h=eb65f1df6a90a73c71e5a4988a0af36943dda4a0;hb=98c966c64594611e469313314abd1e59524adb4a;hp=40671ec6a9f71587e9f7473fe4311f7b12a744c6;hpb=def72111a5ac739cf8c5377a67adeee64c37e1ab;p=lyx.git diff --git a/src/tex-accent.C b/src/tex-accent.C index 40671ec6a9..eb65f1df6a 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-2001 The LyX Team. + * + * ====================================================== */ + #include +#ifdef __GNUG__ +#pragma implementation +#endif + #include #include "tex-accent.h" #include "commandtags.h" @@ -36,46 +50,46 @@ */ // I am not sure how some of the XWindows names coresponds to the TeX ones. -//static 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}, - {TEX_UNDERBAR, "\\b", " ", "underbar", LFUN_UNDERBAR}, - {TEX_CEDILLA, "\\c", " CcSsTtRLGrlgNKnk", "cedilla", LFUN_CEDILLA}, - {TEX_UNDERDOT, "\\d", " ", "underdot", LFUN_UNDERDOT}, - {TEX_CIRCUMFLEX, "\\^", " AEIOUaeiouHJhjCGScgs", "circumflex", LFUN_CIRCUMFLEX}, - {TEX_CIRCLE, "\\r", " AaUu", "circle", LFUN_CIRCLE}, - {TEX_TIE, "\\t", " ", "tie", LFUN_TIE}, - {TEX_BREVE, "\\u", " AaGgUu", "breve", LFUN_BREVE}, - {TEX_CARON, "\\v", " LSTZlstzCEDNRcednr", "caron", LFUN_CARON}, + { 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}, + {TEX_UNDERBAR, "\\b", /*" ",*/ "underbar", LFUN_UNDERBAR}, + {TEX_CEDILLA, "\\c", /*" CcSsTtRLGrlgNKnk",*/ "cedilla", LFUN_CEDILLA}, + {TEX_UNDERDOT, "\\d", /*" ",*/ "underdot", LFUN_UNDERDOT}, + {TEX_CIRCUMFLEX, "\\^", /*" AEIOUaeiouHJhjCGScgs",*/ "circumflex", LFUN_CIRCUMFLEX}, + {TEX_CIRCLE, "\\r", /*" AaUu",*/ "circle", LFUN_CIRCLE}, + {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_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}, - { static_cast(0), "", "", "", static_cast(0)}}; - + {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}, + { static_cast(0), "", /*"",*/ "", static_cast(0)}}; + tex_accent_struct get_accent(kb_action action) { int i = 0; - while (i <= TEX_MAX_ACCENT){ + while (i <= TEX_MAX_ACCENT) { if (lyx_accent_table[i].action == action) return lyx_accent_table[i]; ++i; } - struct tex_accent_struct temp = { static_cast(0), 0, 0, + struct tex_accent_struct temp = { static_cast(0), 0, 0, static_cast(0)}; return temp; } -string DoAccent(string const & s, tex_accent accent) + +string const DoAccent(string const & s, tex_accent accent) { string res; - + res += lyx_accent_table[accent].cmd; res += '{'; if (s == "i" || s == "j") { @@ -86,8 +100,8 @@ string DoAccent(string const & s, tex_accent accent) return res; } -string DoAccent(char c, tex_accent accent) + +string const DoAccent(char c, tex_accent accent) { return DoAccent(tostr(c), accent); } -