Skip to content

Commit

Permalink
Start custom drag names for mutliple drops at 1
Browse files Browse the repository at this point in the history
  • Loading branch information
sabrogden committed Sep 11, 2021
1 parent 8d7c27b commit ccf3752
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions OleClipSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,12 @@ HGLOBAL COleClipSource::ConvertToFileDrop()
int dragId = CGetSetOptions::GetDragId();
int origDragId = dragId;

auto customDragName = g_Opt.GetTempDragFileName();
if (customDragName != _T(""))
{
dragId = 1;
}

for (int i = 0; i < m_ClipIDs.GetCount(); i++)
{
CClip fileClip;
Expand All @@ -1152,9 +1158,9 @@ HGLOBAL COleClipSource::ConvertToFileDrop()
{
CString name = _T("text");
CString file;
if (g_Opt.GetTempDragFileName() != _T(""))
if (customDragName != _T(""))
{
name = g_Opt.GetTempDragFileName();
name = customDragName;
CString id;
id.Format(_T("%d"), dragId++);

Expand All @@ -1181,9 +1187,9 @@ HGLOBAL COleClipSource::ConvertToFileDrop()
{
CString name = _T("text");
CString file;
if (g_Opt.GetTempDragFileName() != _T(""))
if (customDragName != _T(""))
{
name = g_Opt.GetTempDragFileName();
name = customDragName;
CString id;
id.Format(_T("%d"), dragId++);

Expand Down Expand Up @@ -1217,9 +1223,9 @@ HGLOBAL COleClipSource::ConvertToFileDrop()
{
CString name = _T("image");
CString file;
if (g_Opt.GetTempDragFileName() != _T(""))
if (customDragName != _T(""))
{
name = g_Opt.GetTempDragFileName();
name = customDragName;
CString id;
id.Format(_T("%d"), dragId++);
CString fileId = "";
Expand All @@ -1244,7 +1250,8 @@ HGLOBAL COleClipSource::ConvertToFileDrop()
}
}

if(dragId != origDragId)
if(customDragName == _T("") &&
dragId != origDragId)
{
CGetSetOptions::SetDragId(dragId);
}
Expand Down

0 comments on commit ccf3752

Please sign in to comment.