diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2021-12-12 11:59:53 +0100 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2022-01-12 19:57:45 +0100 |
commit | 880c58db42192ebe9718a59aff44cf4d083f4049 (patch) | |
tree | b0b131ecb78f7ab8c1c4da25029f7e7c31d61505 /basegfx/README.md | |
parent | d1068539a1eb305ebcbb301f2f8f6fda0ab2d6ee (diff) |
tdf#38235: fix sort failure for Evolution
Several issues to deal with:
1) The initial pb:
"Error setting the source criteria. The column XXX must be visible as a column. SQL status: 01000, Error code 1000."
=>
OEvoabResultSetMetaData::getColumnLabel was returning the nickname of the column with g_param_spec_get_nick
we just want the column name to display and to use
2) SQL parsing in OCommonStatement::orderByAnalysis
2 "sub-issues":
a) ENSURE_OR_THROW was testing SQL_ISRULE( pAscDesc, opt_asc_desc )
opt_asc_desc is defined in connectivity/source/parse/sqlbison.y with:
opt_asc_desc:
{$$ = SQL_NEW_RULE;}
| SQL_TOKEN_ASC
| SQL_TOKEN_DESC
;
not sure if it should be kept but for DESC I had to use this:
SQL_ISTOKEN(pAscDesc, DESC)
b) Retrieve of ascending
By default ascending is at true but then we tested the node with:
if ( ( pAscDesc->count() == 1 ) && SQL_ISTOKEN( pAscDesc->getChild( 0 ), DESC )
But when we use DESC, it's directly a TOKEN so just this should suffice:
bool bAscending = !SQL_ISTOKEN(pAscDesc, DESC);
3) CompareContacts wasn't taking into account bAscending
since we use comparison function for g_slist_sort_with_data, I only used
int nOrder = 1;
// if descending sort, reverse order
if (!sortCol.bAscending)
nOrder = -1;
and multiply the result with this to have the ad hoc order
Change-Id: I3c360a5ef9cf0dc737a7ce4a138d2d2586abdca9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126698
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
(cherry picked from commit ab864bd178a44208c98a2fd1b1248df5f1db1fc9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126967
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'basegfx/README.md')
0 files changed, 0 insertions, 0 deletions