Skip to content

Commit

Permalink
only open CF_HDROP files from the clipboard if no text is in the clip…
Browse files Browse the repository at this point in the history
…board
  • Loading branch information
stefankueng committed Nov 1, 2024
1 parent 8da7a58 commit 69d7ee1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/Commands/CmdClipboard.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is part of BowPad.
//
// Copyright (C) 2014-2022 - Stefan Kueng
// Copyright (C) 2014-2022, 2024 - Stefan Kueng
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -305,11 +305,14 @@ bool CCmdPaste::Execute()
CClipboardHelper clipboard;
if (clipboard.Open(GetScintillaWnd()))
{
HANDLE hData = GetClipboardData(CF_HDROP);
if (hData)
if (!IsClipboardFormatAvailable(CF_UNICODETEXT) || (GetKeyState(VK_SHIFT) & 0x8000))
{
HDROP hDrop = static_cast<HDROP>(hData);
OpenHDROP(hDrop);
HANDLE hData = GetClipboardData(CF_HDROP);
if (hData)
{
HDROP hDrop = static_cast<HDROP>(hData);
OpenHDROP(hDrop);
}
}
}
}
Expand Down

0 comments on commit 69d7ee1

Please sign in to comment.