Browse Source

global shortcut keys for last 10 positions updated to handle sticky clips

git-svn-id: svn://svn.code.sf.net/p/ditto-cp/code/trunk@695 595ec19a-5cb4-439b-94a8-42fb3063c22c
sabrogden 11 years ago
parent
commit
b4ace1c34a
1 changed files with 6 additions and 2 deletions
  1. 6 2
      MainFrm.cpp

+ 6 - 2
MainFrm.cpp

@@ -393,7 +393,11 @@ void CMainFrame::DoTextOnlyPaste()
 void CMainFrame::DoFirstTenPositionsPaste(int nPos)
 {
     try
-    {
+	{
+		CString csSort = "case when (Main.stickyClipOrder = 0 OR Main.stickyClipOrder IS NULL) then -9999999 else Main.stickyClipOrder END DESC, "
+			"Main.bIsGroup ASC, "
+			"clipOrder DESC";
+
 		CString filter = "((Main.bIsGroup = 1 AND Main.lParentID = -1) OR (Main.bIsGroup = 0 AND Main.lParentID = -1))";
 
 		if(g_Opt.m_bShowAllClipsInMainList)
@@ -401,7 +405,7 @@ void CMainFrame::DoFirstTenPositionsPaste(int nPos)
 			filter = "((Main.bIsGroup = 1 AND Main.lParentID = -1) OR Main.bIsGroup = 0)";
 		}
 
-        CppSQLite3Query q = theApp.m_db.execQueryEx(_T("SELECT lID, bIsGroup FROM Main WHERE %s ORDER BY bIsGroup ASC, clipOrder DESC LIMIT 1 OFFSET %d"), filter, nPos);
+        CppSQLite3Query q = theApp.m_db.execQueryEx(_T("SELECT lID, bIsGroup FROM Main WHERE %s ORDER BY %s LIMIT 1 OFFSET %d"), filter, csSort, nPos);
 
         if(q.eof() == false)
         {