tdf#70506 implement getColumnLabel function

which is responsible for aliasnames defined with the SQL 'AS' keyword.

Change-Id: I6aaf1ba6969e2bd738941e41492338382168bc89
Reviewed-on: https://gerrit.libreoffice.org/32042
Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
This commit is contained in:
Wastack
2016-12-15 12:19:59 +01:00
committed by Julien Nabet
parent 9abac96518
commit ef1aee0f80

View File

@@ -128,8 +128,13 @@ OUString SAL_CALL OResultSetMetaData::getColumnTypeName(sal_Int32 column)
OUString SAL_CALL OResultSetMetaData::getColumnLabel(sal_Int32 column)
throw(SQLException, RuntimeException, std::exception)
{
// TODO: clarify what this is -- probably not the alias
return getColumnName(column);
// aliasname
verifyValidColumn(column);
OUString sRet(m_pSqlda->sqlvar[column-1].aliasname,
m_pSqlda->sqlvar[column-1].aliasname_length,
RTL_TEXTENCODING_UTF8);
sanitizeIdentifier(sRet);
return sRet;
}
OUString SAL_CALL OResultSetMetaData::getColumnServiceName(sal_Int32 column)