mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-04 01:46:42 +00:00
GRAPHICS: MACGUI: add default format before we are using the text from global clipboard
This commit is contained in:
parent
d4abe958bd
commit
4419ae9a0b
@ -1728,7 +1728,7 @@ Common::U32String MacText::getTextChunk(int startRow, int startCol, int endRow,
|
||||
// mostly, we refering reshuffleParagraph to implement this function
|
||||
void MacText::insertTextFromClipboard() {
|
||||
int ppos = 0;
|
||||
Common::U32String str = _wm->getTextFromClipboard(&ppos);
|
||||
Common::U32String str = _wm->getTextFromClipboard(Common::U32String(_defaultFormatting.toString()), &ppos);
|
||||
|
||||
if (_textLines.empty()) {
|
||||
splitString(str, 0);
|
||||
|
@ -430,13 +430,13 @@ void MacWindowManager::setTextInClipboard(const Common::U32String &str) {
|
||||
g_system->setTextInClipboard(stripFormat(str));
|
||||
}
|
||||
|
||||
Common::U32String MacWindowManager::getTextFromClipboard(int *size) {
|
||||
Common::U32String MacWindowManager::getTextFromClipboard(const Common::U32String &format, int *size) {
|
||||
Common::U32String global_str = g_system->getTextFromClipboard();
|
||||
// str is what we need
|
||||
Common::U32String str;
|
||||
if (_clipboard.empty()) {
|
||||
// if wm clipboard is empty, then we use the global clipboard, which won't contain the format
|
||||
str = global_str;
|
||||
str = format + global_str;
|
||||
if (size)
|
||||
*size = str.size();
|
||||
} else {
|
||||
@ -448,7 +448,7 @@ Common::U32String MacWindowManager::getTextFromClipboard(int *size) {
|
||||
*size = tmp.size();
|
||||
} else {
|
||||
// otherwise, we prefer the global one
|
||||
str = global_str;
|
||||
str = format + global_str;
|
||||
if (size)
|
||||
*size = str.size();
|
||||
}
|
||||
|
@ -321,7 +321,7 @@ public:
|
||||
* @param size will change to the length of real text in clipboard
|
||||
* @return the text in clipboard, which may contained the format
|
||||
*/
|
||||
Common::U32String getTextFromClipboard(int *size = nullptr);
|
||||
Common::U32String getTextFromClipboard(const Common::U32String &format = Common::U32String(), int *size = nullptr);
|
||||
|
||||
public:
|
||||
MacFontManager *_fontMan;
|
||||
|
Loading…
x
Reference in New Issue
Block a user