Browse Source

Exclude CF_DIB if copied from excel, often causes lockups

scott brogden 8 years ago
parent
commit
fd9071545c
3 changed files with 24 additions and 0 deletions
  1. 7 0
      Clip.cpp
  2. 13 0
      Options.cpp
  3. 4 0
      Options.h

+ 7 - 0
Clip.cpp

@@ -416,6 +416,13 @@ int CClip::LoadFromClipboard(CClipTypes* pClipTypes, bool checkClipboardIgnore,
 	{
 		cf.m_cfType = pTypes->ElementAt(i);
 
+		if (cf.m_cfType == CF_DIB &&
+			g_Opt.m_excludeCF_DIBInExcel &&
+			activeApp.MakeLower() == _T("excel.exe"))
+		{
+			continue;
+		}
+
 		BOOL bSuccess = false;
 		Log(StrF(_T("Begin try and load type %s"), GetFormatName(cf.m_cfType)));
 		

+ 13 - 0
Options.cpp

@@ -67,6 +67,7 @@ BOOL CGetSetOptions::m_showScrollBar = false;
 CGetSetOptions g_Opt;
 BOOL CGetSetOptions::m_bShowAlwaysOnTopWarning = TRUE;
 CRegExFilterHelper CGetSetOptions::m_regexHelper;
+BOOL CGetSetOptions::m_excludeCF_DIBInExcel = TRUE;
 
 CGetSetOptions::CGetSetOptions()
 {
@@ -177,6 +178,7 @@ void CGetSetOptions::LoadSettings()
 	m_bOutputDebugString = false;
 	m_showScrollBar = GetShowScrollBar();
 	m_bShowAlwaysOnTopWarning = GetShowAlwaysOnTopWarning();
+	m_excludeCF_DIBInExcel = GetExcludeCF_DIBInExcel();
 
 	GetExtraNetworkPassword(true);
 
@@ -2486,4 +2488,15 @@ BOOL CGetSetOptions::GetOpenToGroupByActiveExe()
 void CGetSetOptions::SetOpenToGroupByActiveExe(int val)
 {
 	SetProfileLong(_T("OpenToGroupByActiveExe"), val);
+}
+
+BOOL CGetSetOptions::GetExcludeCF_DIBInExcel()
+{
+	return GetProfileLong(_T("ExcludeCF_DIBInExcel"), TRUE);
+}
+
+void CGetSetOptions::SetExcludeCF_DIBInExcel(int val)
+{
+	m_excludeCF_DIBInExcel = val;
+	SetProfileLong(_T("ExcludeCF_DIBInExcel"), val);
 }

+ 4 - 0
Options.h

@@ -566,6 +566,10 @@ public:
 
 	static BOOL GetOpenToGroupByActiveExe();
 	static void SetOpenToGroupByActiveExe(int val);
+
+	static BOOL m_excludeCF_DIBInExcel;
+	static BOOL GetExcludeCF_DIBInExcel();
+	static void SetExcludeCF_DIBInExcel(int val);
 };
 
 // global for easy access and for initialization of fast access variables