diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-11-01 12:05:01 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-11-01 12:05:01 +0100 |
commit | c070ae66b97fc0662e97a96048741b0f56a5157a (patch) | |
tree | 65901079def84ca64a1901c65fb5babbbfd001ed /svx | |
parent | 98a64d26435b2e9a40e158f17f22641423e10183 (diff) |
dba34a: during #i115312#: getFastPropertyValue( FILTER ): don't deliver an invalid filter when one predicate string cannot be generated, instead just skip this particular string
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/form/formcontroller.cxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index b2c79c9cd9bc..8bc10453b55f 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -865,15 +865,13 @@ void FormController::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) cons if ( aFilter.getLength() ) aFilter.appendAscii( " OR " ); - aFilter.appendAscii( "( " ); + ::rtl::OUStringBuffer aRowFilter; for ( FmFilterRow::const_iterator condition = rRow.begin(); condition != rRow.end(); ++condition ) { // get the field of the controls map Reference< XControl > xControl( condition->first, UNO_QUERY_THROW ); Reference< XPropertySet > xModelProps( xControl->getModel(), UNO_QUERY_THROW ); Reference< XPropertySet > xField( xModelProps->getPropertyValue( FM_PROP_BOUNDFIELD ), UNO_QUERY_THROW ); - if ( condition != rRow.begin() ) - aFilter.appendAscii( " AND " ); sal_Int32 nDataType = DataType::OTHER; OSL_VERIFY( xField->getPropertyValue( FM_PROP_FIELDTYPE ) >>= nDataType ); @@ -897,10 +895,17 @@ void FormController::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) cons { // don't use a parse context here, we need it unlocalized xParseNode->parseNodeToStr( sCriteria, xConnection, NULL ); - aFilter.append( sCriteria ); + if ( condition != rRow.begin() ) + aRowFilter.appendAscii( " AND " ); + aRowFilter.append( sCriteria ); } } - aFilter.appendAscii( " )" ); + if ( aRowFilter.getLength() > 0 ) + { + aFilter.appendAscii( "( " ); + aFilter.append( aRowFilter.makeStringAndClear() ); + aFilter.appendAscii( " )" ); + } } } catch( const Exception& ) |