diff options
author | Ocke Janssen [oj] <Ocke.Janssen@sun.com> | 2010-01-22 08:14:22 +0100 |
---|---|---|
committer | Ocke Janssen [oj] <Ocke.Janssen@sun.com> | 2010-01-22 08:14:22 +0100 |
commit | e86bc3d2a8c51809dcab6c382856c34183e9aefa (patch) | |
tree | f0bc7933014455fa4f01e4c83a5e73f0abe372d2 /forms/source/runtime/formoperations.cxx | |
parent | 75068d8d8cb93b85f6fbaee788af0f8a59ebd1b3 (diff) |
dba33f: #i108548# extend SingleSelectQueryComposer appendFilterByColumn with additonal parameter
Diffstat (limited to 'forms/source/runtime/formoperations.cxx')
-rw-r--r-- | forms/source/runtime/formoperations.cxx | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/forms/source/runtime/formoperations.cxx b/forms/source/runtime/formoperations.cxx index 66e2065a6..6d291a6da 100644 --- a/forms/source/runtime/formoperations.cxx +++ b/forms/source/runtime/formoperations.cxx @@ -51,6 +51,8 @@ #include <com/sun/star/form/XConfirmDeleteListener.hpp> #include <com/sun/star/sdb/RowChangeEvent.hpp> #include <com/sun/star/sdb/RowChangeAction.hpp> +#include <com/sun/star/sdb/SQLFilterOperator.hpp> +#include <com/sun/star/sdbc/DataType.hpp> #include <com/sun/star/form/XReset.hpp> #include <com/sun/star/beans/XMultiPropertySet.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> @@ -97,6 +99,7 @@ namespace frm using ::com::sun::star::form::runtime::FeatureState; using ::com::sun::star::lang::IllegalArgumentException; using ::com::sun::star::sdbc::SQLException; + using namespace ::com::sun::star::sdbc; using ::com::sun::star::form::XForm; using ::com::sun::star::ucb::AlreadyInitializedException; using ::com::sun::star::util::XModifyBroadcaster; @@ -115,6 +118,7 @@ namespace frm using ::com::sun::star::sdbcx::XRowLocate; using ::com::sun::star::form::XConfirmDeleteListener; using ::com::sun::star::sdb::RowChangeEvent; + using namespace ::com::sun::star::sdb; using ::com::sun::star::form::XReset; using ::com::sun::star::beans::XMultiPropertySet; using ::com::sun::star::uno::makeAny; @@ -1687,7 +1691,23 @@ namespace frm void FormOperations::impl_appendFilterByColumn_throw( const void* _pActionParam ) const { const param_appendFilterByColumn* pParam = static_cast< const param_appendFilterByColumn* >( _pActionParam ); - m_xParser->appendFilterByColumn( pParam->xField, sal_True ); + sal_Int32 nOp = SQLFilterOperator::EQUAL; + if ( pParam->xField.is() ) + { + sal_Int32 nType = 0; + pParam->xField->getPropertyValue(PROPERTY_FIELDTYPE) >>= nType; + switch(nType) + { + case DataType::VARCHAR: + case DataType::CHAR: + case DataType::LONGVARCHAR: + nOp = SQLFilterOperator::LIKE; + break; + default: + nOp = SQLFilterOperator::EQUAL; + } + } + m_xParser->appendFilterByColumn( pParam->xField, sal_True,nOp ); } //------------------------------------------------------------------------------ |