diff -cNr sc/inc/datauno.hxx sc.new/inc/datauno.hxx *** sc/inc/datauno.hxx Fri Nov 16 13:14:12 2007 --- sc.new/inc/datauno.hxx Mon Feb 18 15:38:48 2008 *************** *** 60,65 **** --- 60,68 ---- #ifndef _COM_SUN_STAR_SHEET_XSHEETFILTERDESCRIPTOR_HPP_ #include #endif + #ifndef _COM_SUN_STAR_SHEET_XSHEETFILTERDESCRIPTOR2_HPP_ + #include + #endif #ifndef _COM_SUN_STAR_SHEET_XCONSOLIDATIONDESCRIPTOR_HPP_ #include #endif *************** *** 397,403 **** // to uno, all three look the same ! class ScFilterDescriptorBase : public cppu::WeakImplHelper3< com::sun::star::sheet::XSheetFilterDescriptor, com::sun::star::beans::XPropertySet, com::sun::star::lang::XServiceInfo >, --- 400,407 ---- // to uno, all three look the same ! class ScFilterDescriptorBase : public cppu::WeakImplHelper4< ! com::sun::star::sheet::XSheetFilterDescriptor2, com::sun::star::sheet::XSheetFilterDescriptor, com::sun::star::beans::XPropertySet, com::sun::star::lang::XServiceInfo >, *************** *** 425,430 **** --- 429,440 ---- ::com::sun::star::sheet::TableFilterField >& aFilterFields ) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::TableFilterField2 > SAL_CALL + getFilterFields2() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setFilterFields2( const ::com::sun::star::uno::Sequence< + ::com::sun::star::sheet::TableFilterField2 >& aFilterFields ) + throw(::com::sun::star::uno::RuntimeException); + // XPropertySet virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() diff -cNr sc/source/filter/xml/xmlfilti.cxx sc.new/source/filter/xml/xmlfilti.cxx *** sc/source/filter/xml/xmlfilti.cxx Fri Nov 16 13:15:56 2007 --- sc.new/source/filter/xml/xmlfilti.cxx Mon Feb 18 15:40:40 2008 *************** *** 751,756 **** --- 751,768 ---- aFilterOperator = SC_TOPPERC; else if (IsXMLToken(sTempOperator, XML_TOP_VALUES)) aFilterOperator = SC_TOPVAL; + else if (IsXMLToken(sTempOperator, XML_CONTAINS)) + aFilterOperator = SC_CONTAINS; + else if (IsXMLToken(sTempOperator, XML_DOES_NOT_CONTAIN)) + aFilterOperator = SC_DOES_NOT_CONTAIN; + else if (IsXMLToken(sTempOperator, XML_BEGINS_WITH)) + aFilterOperator = SC_BEGINS_WITH; + else if (IsXMLToken(sTempOperator, XML_DOES_NOT_BEGIN_WITH)) + aFilterOperator = SC_DOES_NOT_BEGIN_WITH; + else if (IsXMLToken(sTempOperator, XML_ENDS_WITH)) + aFilterOperator = SC_ENDS_WITH; + else if (IsXMLToken(sTempOperator, XML_DOES_NOT_END_WITH)) + aFilterOperator = SC_DOES_NOT_END_WITH; } void ScXMLDPConditionContext::EndElement() diff -cNr sc/source/ui/unoobj/datauno.cxx sc.new/source/ui/unoobj/datauno.cxx *** sc/source/ui/unoobj/datauno.cxx Fri Nov 16 13:17:14 2007 --- sc.new/source/ui/unoobj/datauno.cxx Thu Jan 31 11:50:02 2008 *************** *** 51,56 **** --- 51,60 ---- #include #include + #include + #include + #include + #include "datauno.hxx" #include "dapiuno.hxx" #include "cellsuno.hxx" *************** *** 1189,1194 **** --- 1193,1273 ---- return aSeq; } + uno::Sequence SAL_CALL ScFilterDescriptorBase::getFilterFields2() + throw(uno::RuntimeException) + { + ScUnoGuard aGuard; + ScQueryParam aParam; + GetData(aParam); + + SCSIZE nEntries = aParam.GetEntryCount(); // allozierte Eintraege im Param + SCSIZE nCount = 0; // aktive + while ( nCount < nEntries && + aParam.GetEntry(nCount).bDoQuery ) + ++nCount; + + sheet::TableFilterField2 aField; + uno::Sequence aSeq(static_cast(nCount)); + sheet::TableFilterField2* pAry = aSeq.getArray(); + for (SCSIZE i=0; i& aFilterFields ) throw(uno::RuntimeException) *************** *** 1263,1268 **** --- 1342,1427 ---- PutData(aParam); } + void SAL_CALL ScFilterDescriptorBase::setFilterFields2( + const uno::Sequence& aFilterFields ) + throw(uno::RuntimeException) + { + ScUnoGuard aGuard; + ScQueryParam aParam; + GetData(aParam); + + SCSIZE nCount = static_cast(aFilterFields.getLength()); + DBG_ASSERT( nCount <= MAXQUERY, "setFilterFields: zu viele" ); + + aParam.Resize( nCount ); + + const sheet::TableFilterField2* pAry = aFilterFields.getConstArray(); + SCSIZE i; + for (i=0; iGetDocument()->GetFormatTable()->GetInputLineString(rEntry.nVal, 0, *rEntry.pStr); + } + + switch (pAry[i].Operator) // FilterOperator + { + case sheet::FilterOperator2::EQUAL: rEntry.eOp = SC_EQUAL; break; + case sheet::FilterOperator2::LESS: rEntry.eOp = SC_LESS; break; + case sheet::FilterOperator2::GREATER: rEntry.eOp = SC_GREATER; break; + case sheet::FilterOperator2::LESS_EQUAL: rEntry.eOp = SC_LESS_EQUAL; break; + case sheet::FilterOperator2::GREATER_EQUAL: rEntry.eOp = SC_GREATER_EQUAL; break; + case sheet::FilterOperator2::NOT_EQUAL: rEntry.eOp = SC_NOT_EQUAL; break; + case sheet::FilterOperator2::TOP_VALUES: rEntry.eOp = SC_TOPVAL; break; + case sheet::FilterOperator2::BOTTOM_VALUES: rEntry.eOp = SC_BOTVAL; break; + case sheet::FilterOperator2::TOP_PERCENT: rEntry.eOp = SC_TOPPERC; break; + case sheet::FilterOperator2::BOTTOM_PERCENT: rEntry.eOp = SC_BOTPERC; break; + case sheet::FilterOperator2::CONTAINS: rEntry.eOp = SC_CONTAINS; break; + case sheet::FilterOperator2::DOES_NOT_CONTAIN: rEntry.eOp = SC_DOES_NOT_CONTAIN; break; + case sheet::FilterOperator2::BEGINS_WITH: rEntry.eOp = SC_BEGINS_WITH; break; + case sheet::FilterOperator2::DOES_NOT_BEGIN_WITH: rEntry.eOp = SC_DOES_NOT_BEGIN_WITH; break; + case sheet::FilterOperator2::ENDS_WITH: rEntry.eOp = SC_ENDS_WITH; break; + case sheet::FilterOperator2::DOES_NOT_END_WITH: rEntry.eOp = SC_DOES_NOT_END_WITH; break; + case sheet::FilterOperator2::EMPTY: + { + rEntry.eOp = SC_EQUAL; + rEntry.nVal = SC_EMPTYFIELDS; + rEntry.bQueryByString = FALSE; + *rEntry.pStr = EMPTY_STRING; + } + break; + case sheet::FilterOperator2::NOT_EMPTY: + { + rEntry.eOp = SC_EQUAL; + rEntry.nVal = SC_NONEMPTYFIELDS; + rEntry.bQueryByString = FALSE; + *rEntry.pStr = EMPTY_STRING; + } + break; + default: + DBG_ERROR("Falscher Query-enum"); + rEntry.eOp = SC_EQUAL; + } + } + + SCSIZE nParamCount = aParam.GetEntryCount(); // Param wird nicht unter 8 resized + for (i=nCount; i