From d613f6e00cbd315f21d49e58d18178f00bda83c5 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. Change-Id: I25b4ccdc2f50ba89687e1f4c871f286251a28e21 --- 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 aaedf70b30b7..3e5ab6a74883 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -1159,7 +1159,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()); @@ -1183,7 +1184,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