From 3417a7e59c8146d0c1f80b7190cc113db71300f6 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Fri, 26 Jun 2009 08:59:23 +0000 Subject: =?UTF-8?q?=E2=80=A2=20fixed=20issue=20for=20sorting=20the=20Custo?= =?UTF-8?q?m=20Query=20table=20via=20clicking=20at=20the=20header=20if=20n?= =?UTF-8?q?o=20ORDER=20BY=20statement=20was=20found=20in=20the=20original?= =?UTF-8?q?=20statement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/CustomQuery.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Source') diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m index 8ceb822c..6bb65056 100644 --- a/Source/CustomQuery.m +++ b/Source/CustomQuery.m @@ -1305,9 +1305,11 @@ //make queryString and perform query if([queryString isMatchedByRegex:@"(?i)\\s+ORDER\\s+BY\\s+(.|\\n)+(\\s+(DESC|ASC))?(\\s|\\n)+(?=(LI|PR|IN|FO|LO))"]) [queryString replaceOccurrencesOfRegex:@"(?i)\\s+ORDER\\s+BY\\s+(.|\\n)+((\\s|\\n)+(DESC|ASC))?(\\s|\\n)+(?=(LI|PR|IN|FO|LO))" withString:newOrder]; - else + else if ([queryString isMatchedByRegex:@"(?i)\\s+ORDER\\s+BY\\s+(.|\\n)+((\\s|\\n)+(DESC|ASC))?"]) [queryString replaceOccurrencesOfRegex:@"(?i)\\s+ORDER\\s+BY\\s+(.|\\n)+((\\s|\\n)+(DESC|ASC))?" withString:newOrder]; - + else + [queryString appendFormat:@" %@", newOrder]; + tableReloadAfterEdting = YES; [self performQueries:[NSArray arrayWithObject:queryString]]; -- cgit v1.2.3