summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-11-01 12:05:01 +0100
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-11-01 12:05:01 +0100
commit1d705f7df77ac8d4e99e76d8b0fbd8c08726229d (patch)
tree03241d146d47a9b336c230690d23d719188db8fe
parent0066883822a8d184264a7660e859cd9e116992cf (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
-rw-r--r--svx/source/form/formcontroller.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index 9ac5df8e48..627f2a832b 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& )