project64/Source/Project64/UserInterface
Summate 65a9097980
Allowing a paste into a number field to be trimmed automatically (#2414)
The specific issue I experienced is that Excel/LibreOffice Calc add a newline when you copy the contents of a single cell. This is bad behavior and they should provide a copy option that does not do that, but alas, it's much harder to get that into those applications. This behavior made it impossible to paste an otherwise-valid hex address into the Project64 fields without first putting it into Notepad, deleting the newline, recopying, and then doing the paste from there. If the field was simply text, you can go into the field edit and shift + home to select all and then do a copy, but that does not work for a formula. When you edit the file, it shows the formula instead. Therefore, you have absolutely no way of working around this except pasting it somewhere else and removing the newline manually.

In principle, there's no reason why you wouldn't trim the ends at least. Whitespace on either end is useless to you. However, content being after the newline should be rejected as it was before.

There were two secondary issues in the pasting code that are fixed here: One is that it only sort of collapsed single spaces. So if you had more than one space, spaces still would have ended up in the result. Actually I think the semantics were slightly more insidious, <space><number> would have turned into <number><same number> effectively. The only thing it did was remove the space by duplicating the number. If you had two spaces, then it would have ended up with e.g. <space><number><same number>. The only case where this wouldn't have happened is a space at the end which would have been preserved in the paste.

Secondly, it mutated the clipboard data directly. This would have lead to confusing results where multiple pastes would have had clipboard data in the clipboard itself move from, for example, two spaces to a single space to no spaces at all. The better solution is to preprocess to figure out how big we ultimately want our space-less result to be and stamp out the copy ourselves skipping anything we don't want. Leave the clipboard alone.

If it's desired to preserve single spaces only in the middle, the code will need to be modified a bit.

Co-authored-by: Summate <summate.ssbm@gmail.com>
2024-06-06 14:22:26 +09:30
..
Bitmaps Make Status Bar, About Dialog and Language Selector DPI Aware 2019-04-19 13:51:42 -07:00
Debugger Core: Change the Program counter to be 64bit 2024-06-06 14:09:12 +09:30
Icons [Icon] Add 256x256 size 2019-04-19 14:41:13 -07:00
Settings Core: Remove protecting memory option 2024-05-09 17:56:28 +09:30
WTLControls Allowing a paste into a number field to be trimmed automatically (#2414) 2024-06-06 14:22:26 +09:30
About.cpp Project64: Code clean up 2022-09-21 14:46:07 +09:30
About.h Project64: Code cleanup 2022-09-26 12:01:54 +09:30
CheatUI.cpp Clean up warnings 2023-02-28 10:09:08 +10:30
CheatUI.h Project64: Code cleanup 2022-09-26 12:01:54 +09:30
DiscordRPC.cpp Project64: Code clean up 2022-09-21 14:46:07 +09:30
DiscordRPC.h Project64: Code cleanup 2022-09-26 12:01:54 +09:30
EnhancementUI.cpp Core: have an option for rdram to be different between known and unknown roms 2023-01-16 20:53:48 +10:30
EnhancementUI.h Project64: Code cleanup 2022-09-26 12:01:54 +09:30
LoggingUI.cpp Project64: Code cleanup 2022-09-26 12:01:54 +09:30
LoggingUI.h Project64: Code cleanup 2022-09-26 12:01:54 +09:30
MainMenu.cpp Core: Remove protecting memory option 2024-05-09 17:56:28 +09:30
MainMenu.h Core: Remove protecting memory option 2024-05-09 17:56:28 +09:30
MainWindow.cpp Clean up warnings 2023-02-28 10:09:08 +10:30
MainWindow.h Clean up warnings 2023-02-28 10:09:08 +10:30
MenuItem.cpp Clean up warnings 2023-02-28 10:09:08 +10:30
MenuItem.h Project64: Code cleanup 2022-09-26 12:01:54 +09:30
MenuShortCuts.cpp Clean up warnings 2023-02-28 10:09:08 +10:30
MenuShortCuts.h Project64: Code cleanup 2022-09-26 12:01:54 +09:30
Notification.cpp Clean up warnings 2023-02-28 10:09:08 +10:30
Notification.h Project64: Code cleanup 2022-09-26 12:01:54 +09:30
ProjectSupport.cpp Fix typo in support window code (#2395) 2023-11-23 22:54:19 +10:30
ProjectSupport.h Fix typo in support window code (#2395) 2023-11-23 22:54:19 +10:30
RomBrowser.cpp Clean up warnings 2023-02-28 10:09:08 +10:30
RomBrowser.h x64: Fix rom browser showing columns 2023-03-04 07:19:35 +10:30
RomInformation.cpp Clean up warnings 2023-02-28 10:09:08 +10:30
RomInformation.h Clean up warnings 2023-02-28 10:09:08 +10:30
SettingsConfig.cpp Clean up warnings 2023-02-28 10:09:08 +10:30
SettingsConfig.h Project64: Code cleanup 2022-09-26 12:01:54 +09:30
SupportEnterCode.cpp Clean up warnings 2023-02-28 10:09:08 +10:30
SupportEnterCode.h Project64: Code cleanup 2022-09-26 12:01:54 +09:30
SupportWindow.cpp Fix typo in support window code (#2395) 2023-11-23 22:54:19 +10:30
SupportWindow.h Project64: Code cleanup 2022-09-26 12:01:54 +09:30
UIResources.rc Core: Remove protecting memory option 2024-05-09 17:56:28 +09:30
WelcomeScreen.cpp Add editbox to choose directory dialog (#2340) 2023-02-14 08:12:38 +10:30
WelcomeScreen.h Project64: Code cleanup 2022-09-26 12:01:54 +09:30
resource.h Core: Remove protecting memory option 2024-05-09 17:56:28 +09:30