Skip to content

Commit 69d7ee1

Browse files
committed
only open CF_HDROP files from the clipboard if no text is in the clipboard
1 parent 8da7a58 commit 69d7ee1

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/Commands/CmdClipboard.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file is part of BowPad.
22
//
3-
// Copyright (C) 2014-2022 - Stefan Kueng
3+
// Copyright (C) 2014-2022, 2024 - Stefan Kueng
44
//
55
// This program is free software: you can redistribute it and/or modify
66
// it under the terms of the GNU General Public License as published by
@@ -305,11 +305,14 @@ bool CCmdPaste::Execute()
305305
CClipboardHelper clipboard;
306306
if (clipboard.Open(GetScintillaWnd()))
307307
{
308-
HANDLE hData = GetClipboardData(CF_HDROP);
309-
if (hData)
308+
if (!IsClipboardFormatAvailable(CF_UNICODETEXT) || (GetKeyState(VK_SHIFT) & 0x8000))
310309
{
311-
HDROP hDrop = static_cast<HDROP>(hData);
312-
OpenHDROP(hDrop);
310+
HANDLE hData = GetClipboardData(CF_HDROP);
311+
if (hData)
312+
{
313+
HDROP hDrop = static_cast<HDROP>(hData);
314+
OpenHDROP(hDrop);
315+
}
313316
}
314317
}
315318
}

0 commit comments

Comments
 (0)