From 3b09ae20a3ed526cd80fe27be785e8bc9ff2ce5e Mon Sep 17 00:00:00 2001 From: Lionel Elie Mamane Date: Wed, 28 Jan 2015 18:24:40 +0100 Subject: Query Design: use correct name for columns that come from another query. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I25b4ccdc2f50ba89687e1f4c871f286251a28e21 Reviewed-on: https://gerrit.libreoffice.org/14232 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- connectivity/source/parse/sqlnode.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'connectivity') diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index 37bfbdeda2a6..08e089d7478b 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -1158,7 +1158,8 @@ OUString OSQLParser::stringToDouble(const OUString& _rValue,sal_Int16 _nScale) OSQLParseNode* OSQLParser::predicateTree(OUString& rErrorMessage, const OUString& rStatement, const Reference< ::com::sun::star::util::XNumberFormatter > & xFormatter, - const Reference< XPropertySet > & xField) + const Reference< XPropertySet > & xField, + bool bUseRealName) { // Guard the parsing ::osl::MutexGuard aGuard(getMutex()); @@ -1182,7 +1183,7 @@ OSQLParseNode* OSQLParser::predicateTree(OUString& rErrorMessage, const OUString // #75243# use the RealName of the column if there is any otherwise the name which could be the alias // of the field Reference< XPropertySetInfo> xInfo = m_xField->getPropertySetInfo(); - if ( xInfo->hasPropertyByName(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_REALNAME))) + if ( bUseRealName && xInfo->hasPropertyByName(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_REALNAME))) m_xField->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_REALNAME)) >>= aString; else m_xField->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= aString; -- cgit v1.2.3