mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-08 09:37:53 +00:00
Remove MyGUI color codes when copying to system clipboard
This commit is contained in:
parent
49a6579d3a
commit
f476aa4ade
@ -492,7 +492,8 @@ namespace MWInput
|
|||||||
}
|
}
|
||||||
if (arg.keysym.sym == SDLK_x && (arg.keysym.mod & SDL_Keymod(KMOD_CTRL)))
|
if (arg.keysym.sym == SDLK_x && (arg.keysym.mod & SDL_Keymod(KMOD_CTRL)))
|
||||||
{
|
{
|
||||||
std::string text = edit->getTextSelection();
|
// Discard color codes and other escape characters
|
||||||
|
std::string text = MyGUI::TextIterator::getOnlyText(edit->getTextSelection());
|
||||||
if (text.length())
|
if (text.length())
|
||||||
{
|
{
|
||||||
SDL_SetClipboardText(text.c_str());
|
SDL_SetClipboardText(text.c_str());
|
||||||
@ -504,7 +505,8 @@ namespace MWInput
|
|||||||
{
|
{
|
||||||
if (arg.keysym.sym == SDLK_c && (arg.keysym.mod & SDL_Keymod(KMOD_CTRL)))
|
if (arg.keysym.sym == SDLK_c && (arg.keysym.mod & SDL_Keymod(KMOD_CTRL)))
|
||||||
{
|
{
|
||||||
std::string text = edit->getTextSelection();
|
// Discard color codes and other escape characters
|
||||||
|
std::string text = MyGUI::TextIterator::getOnlyText(edit->getTextSelection());
|
||||||
if (text.length())
|
if (text.length())
|
||||||
SDL_SetClipboardText(text.c_str());
|
SDL_SetClipboardText(text.c_str());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user