summaryrefslogtreecommitdiff
path: root/forms/source/component
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-04-16 13:55:24 +0200
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-04-16 13:55:24 +0200
commit69929004c60c78e8022f89b002128f551dc0f8c7 (patch)
tree6d5c4439769b27f8c5fcbae0595bf20b09465542 /forms/source/component
parent1b192bd38a3695cc2965ece438d47d6f74958289 (diff)
parent6c07c7cad453e4ebb447577c7313323764d50ea9 (diff)
dba33f: merge with m76-branch
Diffstat (limited to 'forms/source/component')
-rw-r--r--forms/source/component/Columns.cxx20
-rw-r--r--forms/source/component/ComboBox.cxx23
-rw-r--r--forms/source/component/Filter.cxx15
-rw-r--r--forms/source/component/FormattedField.cxx2
-rw-r--r--forms/source/component/ListBox.cxx20
5 files changed, 25 insertions, 55 deletions
diff --git a/forms/source/component/Columns.cxx b/forms/source/component/Columns.cxx
index ae1cbc2b7a5b..a93d121d4b99 100644
--- a/forms/source/component/Columns.cxx
+++ b/forms/source/component/Columns.cxx
@@ -32,6 +32,7 @@
#include "property.hrc"
#endif
#include "property.hxx"
+#include "componenttools.hxx"
#include "ids.hxx"
#include "findpos.hxx"
#include <com/sun/star/io/XPersistObject.hpp>
@@ -169,11 +170,20 @@ Sequence<sal_Int8> SAL_CALL OGridColumn::getImplementationId() throw(RuntimeExce
//------------------------------------------------------------------
Sequence<Type> SAL_CALL OGridColumn::getTypes() throw(RuntimeException)
{
- Reference<XTypeProvider> xProv;
-
- if (query_aggregation(m_xAggregate, xProv))
- return concatSequences(OGridColumn_BASE::getTypes(), xProv->getTypes());
- return OGridColumn_BASE::getTypes();
+ TypeBag aTypes( OGridColumn_BASE::getTypes() );
+ // erase the types which we do not support
+ aTypes.removeType( XFormComponent::static_type() );
+ aTypes.removeType( XServiceInfo::static_type() );
+ aTypes.removeType( XBindableValue::static_type() );
+ aTypes.removeType( XPropertyContainer::static_type() );
+ // but re-add their base class(es)
+ aTypes.addType( XChild::static_type() );
+
+ Reference< XTypeProvider > xProv;
+ if ( query_aggregation( m_xAggregate, xProv ))
+ aTypes.addTypes( xProv->getTypes() );
+
+ return aTypes.getTypes();
}
//------------------------------------------------------------------
diff --git a/forms/source/component/ComboBox.cxx b/forms/source/component/ComboBox.cxx
index 4dfdb61cbb2b..278e561de251 100644
--- a/forms/source/component/ComboBox.cxx
+++ b/forms/source/component/ComboBox.cxx
@@ -532,26 +532,11 @@ void OComboBoxModel::loadData( bool _bForce )
else
{
// otherwise look for the alias
- Reference<XSQLQueryComposerFactory> xFactory(xConnection, UNO_QUERY);
- if (!xFactory.is())
- break;
-
- Reference<XSQLQueryComposer> xComposer = xFactory->createQueryComposer();
- try
- {
- Reference<XPropertySet> xFormAsSet(xForm, UNO_QUERY);
- ::rtl::OUString aStatement;
- xFormAsSet->getPropertyValue(PROPERTY_ACTIVECOMMAND) >>= aStatement;
- xComposer->setQuery(aStatement);
- }
- catch(Exception&)
- {
- disposeComponent(xComposer);
- break;
- }
+ Reference<XPropertySet> xFormProp(xForm,UNO_QUERY);
+ Reference< XColumnsSupplier > xSupplyFields;
+ xFormProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SingleSelectQueryComposer"))) >>= xSupplyFields;
// search the field
- Reference< XColumnsSupplier > xSupplyFields(xComposer, UNO_QUERY);
DBG_ASSERT(xSupplyFields.is(), "OComboBoxModel::loadData : invalid query composer !");
Reference< XNameAccess > xFieldNames = xSupplyFields->getColumns();
@@ -562,8 +547,6 @@ void OComboBoxModel::loadData( bool _bForce )
if (hasProperty(PROPERTY_FIELDSOURCE, xComposerFieldAsSet))
xComposerFieldAsSet->getPropertyValue(PROPERTY_FIELDSOURCE) >>= aFieldName;
}
-
- disposeComponent(xComposer);
}
if (!aFieldName.getLength())
diff --git a/forms/source/component/Filter.cxx b/forms/source/component/Filter.cxx
index b4c7eddf81d8..9cbc5237cf95 100644
--- a/forms/source/component/Filter.cxx
+++ b/forms/source/component/Filter.cxx
@@ -397,17 +397,10 @@ namespace frm
const Reference< XPropertySet > xFormProps( xForm, UNO_QUERY_THROW );
// create a query composer
- const Reference< XConnection > xConnection( ::dbtools::getConnection( xForm ), UNO_SET_THROW );
- const Reference< XSQLQueryComposerFactory > xFactory( xConnection, UNO_QUERY_THROW );
- const Reference< XSQLQueryComposer > xComposer( xFactory->createQueryComposer(), UNO_SET_THROW );
-
- // set the statement on the composer
- ::rtl::OUString sStatement;
- xFormProps->getPropertyValue( PROPERTY_ACTIVECOMMAND ) >>= sStatement;
- xComposer->setQuery( sStatement );
+ Reference< XColumnsSupplier > xSuppColumns;
+ xFormProps->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SingleSelectQueryComposer"))) >>= xSuppColumns;
- // the field we're bound to
- const Reference< XColumnsSupplier > xSuppColumns( xComposer, UNO_QUERY_THROW );
+ const Reference< XConnection > xConnection( ::dbtools::getConnection( xForm ), UNO_SET_THROW );
const Reference< XNameAccess > xFieldNames( xSuppColumns->getColumns(), UNO_SET_THROW );
if ( !xFieldNames->hasByName( sFieldName ) )
return;
@@ -417,7 +410,7 @@ namespace frm
xComposerFieldProps->getPropertyValue( PROPERTY_TABLENAME ) >>= sTableName;
// obtain the table of the field
- const Reference< XTablesSupplier > xSuppTables( xComposer, UNO_QUERY_THROW );
+ const Reference< XTablesSupplier > xSuppTables( xSuppColumns, UNO_QUERY_THROW );
const Reference< XNameAccess > xTablesNames( xSuppTables->getTables(), UNO_SET_THROW );
const Reference< XNamed > xNamedTable( xTablesNames->getByName( sTableName ), UNO_QUERY_THROW );
sTableName = xNamedTable->getName();
diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx
index 6e11fa7c9dbb..a35a300dda78 100644
--- a/forms/source/component/FormattedField.cxx
+++ b/forms/source/component/FormattedField.cxx
@@ -580,7 +580,7 @@ void OFormattedModel::_propertyChanged( const com::sun::star::beans::PropertyCha
// as m_aSaveValue (which is used by commitControlValueToDbColumn) is format dependent we have
// to recalc it, which is done by translateDbColumnToControlValue
- if ( m_xColumn.is() && m_xAggregateFastSet.is() && !m_xCursor->isBeforeFirst() && !m_xCursor->isAfterLast())
+ if ( m_xColumn.is() && m_xAggregateFastSet.is() && !m_xCursor->isBeforeFirst() && !m_xCursor->isAfterLast())
{
setControlValue( translateDbColumnToControlValue(), eOther );
}
diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx
index 0aa90d9919cf..3ef087c42bf5 100644
--- a/forms/source/component/ListBox.cxx
+++ b/forms/source/component/ListBox.cxx
@@ -701,25 +701,10 @@ namespace frm
else
{
// otherwise look for the alias
- Reference<XSQLQueryComposerFactory> xFactory(xConnection, UNO_QUERY);
- if (!xFactory.is())
- break;
-
- Reference<XSQLQueryComposer> xComposer = xFactory->createQueryComposer();
- try
- {
- ::rtl::OUString aStatement;
- xFormProps->getPropertyValue( PROPERTY_ACTIVECOMMAND ) >>= aStatement;
- xComposer->setQuery( aStatement );
- }
- catch(Exception&)
- {
- disposeComponent(xComposer);
- break;
- }
+ Reference< XColumnsSupplier > xSupplyFields;
+ xFormProps->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SingleSelectQueryComposer"))) >>= xSupplyFields;
// search the field
- Reference<XColumnsSupplier> xSupplyFields(xComposer, UNO_QUERY);
DBG_ASSERT(xSupplyFields.is(), "OListBoxModel::loadData : invalid query composer !");
Reference<XNameAccess> xFieldNames = xSupplyFields->getColumns();
@@ -730,7 +715,6 @@ namespace frm
if (hasProperty(PROPERTY_FIELDSOURCE, xComposerFieldAsSet))
xComposerFieldAsSet->getPropertyValue(PROPERTY_FIELDSOURCE) >>= aFieldName;
}
- disposeComponent(xComposer);
}
}
if (!aFieldName.getLength())