Browse Source

Start custom drag names for mutliple drops at 1

Scott Brogden 4 years ago
parent
commit
ccf375222e
1 changed files with 14 additions and 7 deletions
  1. 14 7
      OleClipSource.cpp

+ 14 - 7
OleClipSource.cpp

@@ -1142,6 +1142,12 @@ HGLOBAL COleClipSource::ConvertToFileDrop()
 	int dragId = CGetSetOptions::GetDragId();
 	int dragId = CGetSetOptions::GetDragId();
 	int origDragId = dragId;
 	int origDragId = dragId;
 
 
+	auto customDragName = g_Opt.GetTempDragFileName();
+	if (customDragName != _T(""))
+	{
+		dragId = 1;
+	}
+
 	for (int i = 0; i < m_ClipIDs.GetCount(); i++)
 	for (int i = 0; i < m_ClipIDs.GetCount(); i++)
 	{
 	{
 		CClip fileClip;
 		CClip fileClip;
@@ -1152,9 +1158,9 @@ HGLOBAL COleClipSource::ConvertToFileDrop()
 		{
 		{
 			CString name = _T("text");
 			CString name = _T("text");
 			CString file;
 			CString file;
-			if (g_Opt.GetTempDragFileName() != _T(""))
+			if (customDragName != _T(""))
 			{
 			{
-				name = g_Opt.GetTempDragFileName();
+				name = customDragName;
 				CString id;				
 				CString id;				
 				id.Format(_T("%d"), dragId++);
 				id.Format(_T("%d"), dragId++);
 
 
@@ -1181,9 +1187,9 @@ HGLOBAL COleClipSource::ConvertToFileDrop()
 			{
 			{
 				CString name = _T("text");
 				CString name = _T("text");
 				CString file;
 				CString file;
-				if (g_Opt.GetTempDragFileName() != _T(""))
+				if (customDragName != _T(""))
 				{
 				{
-					name = g_Opt.GetTempDragFileName();
+					name = customDragName;
 					CString id;
 					CString id;
 					id.Format(_T("%d"), dragId++);				
 					id.Format(_T("%d"), dragId++);				
 
 
@@ -1217,9 +1223,9 @@ HGLOBAL COleClipSource::ConvertToFileDrop()
 				{
 				{
 					CString name = _T("image");
 					CString name = _T("image");
 					CString file;
 					CString file;
-					if (g_Opt.GetTempDragFileName() != _T(""))
+					if (customDragName != _T(""))
 					{
 					{
-						name = g_Opt.GetTempDragFileName();
+						name = customDragName;
 						CString id;
 						CString id;
 						id.Format(_T("%d"), dragId++);
 						id.Format(_T("%d"), dragId++);
 						CString fileId = "";
 						CString fileId = "";
@@ -1244,7 +1250,8 @@ HGLOBAL COleClipSource::ConvertToFileDrop()
 		}
 		}
 	}
 	}
 
 
-	if(dragId != origDragId)
+	if(customDragName == _T("") &&
+		dragId != origDragId)
 	{
 	{
 		CGetSetOptions::SetDragId(dragId);
 		CGetSetOptions::SetDragId(dragId);
 	}
 	}