summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2015-01-28 18:24:40 +0100
committerLionel Elie Mamane <lionel@mamane.lu>2015-01-28 18:29:30 +0100
commitd613f6e00cbd315f21d49e58d18178f00bda83c5 (patch)
treeb66bd6354fabce278b7f9b467ea82e9662af65af /connectivity
parentabb5e84c74b781f3615862695db4e5eaadc12cfe (diff)
Query Design: use correct name for columns that come from another query.
Change-Id: I25b4ccdc2f50ba89687e1f4c871f286251a28e21
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/parse/sqlnode.cxx5
1 files changed, 3 insertions, 2 deletions
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;