Browse Source

Set group clip order correctly, it was using the wrong sort order

git-svn-id: svn://svn.code.sf.net/p/ditto-cp/code/trunk@781 595ec19a-5cb4-439b-94a8-42fb3063c22c
sabrogden 10 years ago
parent
commit
6015f49fee
1 changed files with 3 additions and 2 deletions
  1. 3 2
      Clip.cpp

+ 3 - 2
Clip.cpp

@@ -537,7 +537,8 @@ bool CClip::AddToDB(bool bCheckForDuplicates)
 	{
 		m_CRC = GenerateCRC();
 
-		if(bCheckForDuplicates)
+		if(bCheckForDuplicates &&
+			m_parentId < 0)
 		{	
 			int nID = FindDuplicate();
 			if(nID >= 0)
@@ -961,7 +962,7 @@ double CClip::GetNewOrder(int parentId, int clipId)
 		}
 		else
 		{
-			CppSQLite3Query q = theApp.m_db.execQueryEx(_T("SELECT clipGroupOrder, mText FROM Main WHERE lParentID = %d ORDER BY clipOrder DESC LIMIT 1"), parentId);			
+			CppSQLite3Query q = theApp.m_db.execQueryEx(_T("SELECT clipGroupOrder, mText FROM Main WHERE lParentID = %d ORDER BY clipGroupOrder DESC LIMIT 1"), parentId);			
 			if(q.eof() == false)
 			{
 				existingMaxOrder = q.getFloatField(_T("clipGroupOrder"));