mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Avoid a couple copies in Trans::addDeadKeys().
Spotted by Coverity scan.
This commit is contained in:
parent
7946dfacfa
commit
8ea9c2da03
@ -176,19 +176,13 @@ tex_accent getkeymod(string const &);
|
|||||||
|
|
||||||
void Trans::addDeadkey(tex_accent accent, docstring const & keys)
|
void Trans::addDeadkey(tex_accent accent, docstring const & keys)
|
||||||
{
|
{
|
||||||
KmodInfo tmp;
|
kmod_list_[accent] = KmodInfo(keys, accent, KmodException());
|
||||||
tmp.data = keys;
|
|
||||||
tmp.accent = accent;
|
|
||||||
kmod_list_[accent] = tmp;
|
|
||||||
|
|
||||||
for (char_type key : keys) {
|
for (char_type key : keys) {
|
||||||
// FIXME This is a hack.
|
// FIXME This is a hack.
|
||||||
// tmp is no valid UCS4 string, but misused to store the
|
// tmp is no valid UCS4 string, but misused to store the
|
||||||
// accent.
|
// accent.
|
||||||
docstring tmpd;
|
keymap_[key] = docstring() + char_type(0) + char_type(accent);
|
||||||
tmpd += char_type(0);
|
|
||||||
tmpd += char_type(accent);
|
|
||||||
keymap_[key] = tmpd;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,6 +112,9 @@ public:
|
|||||||
///
|
///
|
||||||
KmodInfo() : accent(TEX_NOACCENT) {}
|
KmodInfo() : accent(TEX_NOACCENT) {}
|
||||||
///
|
///
|
||||||
|
KmodInfo(docstring const & d, tex_accent a, KmodException const & e)
|
||||||
|
: data(d), accent(a), exception_list(e) {}
|
||||||
|
///
|
||||||
docstring data;
|
docstring data;
|
||||||
///
|
///
|
||||||
tex_accent accent;
|
tex_accent accent;
|
||||||
|
Loading…
Reference in New Issue
Block a user