From 20524789e62f4bd93c1ba9f3c234673d32944b2e Mon Sep 17 00:00:00 2001 From: Jens-Heiner Rechtien Date: Mon, 2 Aug 2004 15:27:20 +0000 Subject: INTEGRATION: CWS insight01 (1.22.22); FILE MERGED 2004/07/23 12:28:34 oj 1.22.22.3: RESYNC: (1.24-1.25); FILE MERGED 2004/05/28 19:56:46 oj 1.22.22.2: RESYNC: (1.22-1.24); FILE MERGED 2004/04/23 06:21:36 oj 1.22.22.1: new switch to disable catalog and schema --- forms/source/component/ComboBox.cxx | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx index 0cf803ec2400..1441b4d291dd 100644 --- a/forms/source/component/ComboBox.cxx +++ b/forms/source/component/ComboBox.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ComboBox.cxx,v $ * - * $Revision: 1.25 $ + * $Revision: 1.26 $ * - * last change: $Author: rt $ $Date: 2004-07-06 13:37:07 $ + * last change: $Author: hr $ $Date: 2004-08-02 16:27:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -650,15 +650,22 @@ void OComboBoxModel::loadData() break; Reference xMeta = xConnection->getMetaData(); - ::rtl::OUString aQuote = xMeta->getIdentifierQuoteString(); - ::rtl::OUString aStatement = ::rtl::OUString::createFromAscii("SELECT DISTINCT "); + OSL_ENSURE(xMeta.is(),"No database meta data!"); + if ( xMeta.is() ) + { + ::rtl::OUString aQuote = xMeta->getIdentifierQuoteString(); + ::rtl::OUString aStatement = ::rtl::OUString::createFromAscii("SELECT DISTINCT "); - aStatement += quoteName(aQuote, aFieldName); - aStatement += ::rtl::OUString::createFromAscii(" FROM "); - aStatement += quoteTableName(xMeta, m_aListSource,::dbtools::eInDataManipulation); + aStatement += quoteName(aQuote, aFieldName); + aStatement += ::rtl::OUString::createFromAscii(" FROM "); - xStmt = xConnection->createStatement(); - xListCursor = xStmt->executeQuery(aStatement); + sal_Bool bUseCatalogInSelect = ::dbtools::isDataSourcePropertyEnabled(xConnection,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UseCatalogInSelect")),sal_True); + sal_Bool bUseSchemaInSelect = ::dbtools::isDataSourcePropertyEnabled(xConnection,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UseSchemaInSelect")),sal_True); + aStatement += quoteTableName(xMeta, m_aListSource,::dbtools::eInDataManipulation,bUseCatalogInSelect,bUseSchemaInSelect); + + xStmt = xConnection->createStatement(); + xListCursor = xStmt->executeQuery(aStatement); + } } break; case ListSourceType_QUERY: { -- cgit v1.2.3