diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2014-12-01 18:59:06 +0100 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2014-12-01 19:06:01 +0100 |
commit | 5a96c7cb511d1997d8e5188fbaa028c6ff1b2dd3 (patch) | |
tree | 4a608ea604579524330db09e74166dd6843593f2 /dbaccess | |
parent | e4b8b7000525f34710f6dde35f45a629f1a4b383 (diff) |
fdo#86852 correctly recognise NULL values in query parameter values dialog
Change-Id: I3c0cf976e0a9fbafe6eee768799a2f48c2ee0ea9
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/api/SingleSelectQueryComposer.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/paramdialog.cxx | 8 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/queryfilter.cxx | 3 |
3 files changed, 5 insertions, 10 deletions
diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index ef3c0e079e16..f8f8c2b93410 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -1510,11 +1510,11 @@ namespace if ( i_xSelectColumns.is() && i_xSelectColumns->hasByName(sColumnName) ) { Reference<XPropertySet> xColumn(i_xSelectColumns->getByName(sColumnName),UNO_QUERY); - sValue = i_aPredicateInputController.getPredicateValue(sValue,xColumn,true); + sValue = i_aPredicateInputController.getPredicateValueStr(sValue,xColumn); } else { - sValue = i_aPredicateInputController.getPredicateValue(pAndIter->Name,sValue,true); + sValue = i_aPredicateInputController.getPredicateValueStr(pAndIter->Name,sValue); } lcl_addFilterCriteria_throw(pAndIter->Handle,sValue,sRet); ++pAndIter; diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx index f4fdc07c1ec9..d39d86fb623a 100644 --- a/dbaccess/source/ui/dlg/paramdialog.cxx +++ b/dbaccess/source/ui/dlg/paramdialog.cxx @@ -95,12 +95,6 @@ namespace dbaui pValues->Name = ::comphelper::getString(xParamAsSet->getPropertyValue(PROPERTY_NAME)); m_pAllParams->InsertEntry(pValues->Name); - if (!pValues->Value.hasValue()) - // it won't have a value, 'cause it's default constructed. But may be later we support - // initializing this dialog with values - pValues->Value = makeAny( OUString() ); - // default the values to an empty string - m_aVisitedParams.push_back(0); // not visited, not dirty } @@ -239,7 +233,7 @@ namespace dbaui OUString sValue; pValues->Value >>= sValue; - pValues->Value <<= OUString( m_aPredicateInput.getPredicateValue( sValue, xParamAsSet, false ) ); + pValues->Value <<= m_aPredicateInput.getPredicateValue( sValue, xParamAsSet ); } } catch(Exception&) diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx b/dbaccess/source/ui/dlg/queryfilter.cxx index f8ad536b0f3c..7c3ad2591b37 100644 --- a/dbaccess/source/ui/dlg/queryfilter.cxx +++ b/dbaccess/source/ui/dlg/queryfilter.cxx @@ -346,7 +346,8 @@ bool DlgFilterCrit::getCondition(const ListBox& _rField,const ListBox& _rComp,co _rFilter.Handle = GetOSQLPredicateType( _rComp.GetSelectEntry() ); if ( SQLFilterOperator::SQLNULL != _rFilter.Handle && _rFilter.Handle != SQLFilterOperator::NOT_SQLNULL ) { - OUString sPredicateValue = m_aPredicateInput.getPredicateValue( _rValue.GetText(), getMatchingColumn( _rValue ), false ); + OUString sPredicateValue; + m_aPredicateInput.getPredicateValue( _rValue.GetText(), getMatchingColumn( _rValue ) ) >>= sPredicateValue; if ( _rFilter.Handle == SQLFilterOperator::LIKE || _rFilter.Handle == SQLFilterOperator::NOT_LIKE ) ::Replace_OS_PlaceHolder( sPredicateValue ); |