Skip to content

Commit

Permalink
Reformat and refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
shmuz committed Jan 12, 2025
1 parent a2264a9 commit 637c8a3
Show file tree
Hide file tree
Showing 7 changed files with 217 additions and 350 deletions.
16 changes: 7 additions & 9 deletions far/src/clipboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,19 +248,17 @@ wchar_t *Clipboard::Paste(bool &IsVertical, int MaxChars)
if (MaxChars >= 0 && CharsCount < (size_t)MaxChars)
CharsCount = (size_t)MaxChars;

IsVertical = false;
wchar_t *ClipText = (wchar_t *)malloc((CharsCount + 1) * sizeof(wchar_t));
if (ClipText)
{
if (ClipText) {
wmemcpy(ClipText, (const wchar_t *)ClipData, CharsCount);
ClipText[CharsCount] = 0;
}

IsVertical = false;

if (wcsstr(ClipText, NATIVE_EOLW)) {
UINT FormatType = RegisterFormat(FAR_VerticalBlock_Unicode);
if (FormatType && IsFormatAvailable(FormatType)) {
IsVertical = true;
if (wcsstr(ClipText, NATIVE_EOLW)) {
UINT FormatType = RegisterFormat(FAR_VerticalBlock_Unicode);
if (FormatType && IsFormatAvailable(FormatType)) {
IsVertical = true;
}
}
}

Expand Down
1 change: 1 addition & 0 deletions far/src/console/grabber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Grabber::Grabber() :
DisplayObject();
Process();
delete SaveScr;
SaveScr = nullptr; //prevent repeated deletion in ScreenObject
pFrame->Unlock();
FrameManager->RefreshFrame();
}
Expand Down
1 change: 0 additions & 1 deletion far/src/console/grabber.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class Grabber:Modal
{
private:
ChangeMacroArea Cma;
SaveScreen *SaveScr;
GrabberArea PrevArea;
GrabberArea GArea;
int ResetArea;
Expand Down
Loading

0 comments on commit 637c8a3

Please sign in to comment.