summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2011-11-29 17:17:59 -0500
committerKohei Yoshida <kohei.yoshida@suse.com>2011-11-29 22:35:46 -0500
commitaf4435c5a4964a86457fe61c3bade42ca3cf236d (patch)
tree8e2a9f1f5c4b7f17b753ca9f5416df782590f5d1 /oox
parent24497be46946032324aade1eeaed6cf0b87a610a (diff)
Switch to TableFilterField3, but no other changes.
Diffstat (limited to 'oox')
-rw-r--r--oox/inc/oox/xls/autofilterbuffer.hxx10
-rw-r--r--oox/source/xls/autofilterbuffer.cxx26
2 files changed, 20 insertions, 16 deletions
diff --git a/oox/inc/oox/xls/autofilterbuffer.hxx b/oox/inc/oox/xls/autofilterbuffer.hxx
index bc2a98614959..869c2114b098 100644
--- a/oox/inc/oox/xls/autofilterbuffer.hxx
+++ b/oox/inc/oox/xls/autofilterbuffer.hxx
@@ -34,9 +34,9 @@
#include "oox/xls/workbookhelper.hxx"
namespace com { namespace sun { namespace star {
- namespace sheet { struct TableFilterField2; }
+ namespace sheet { struct TableFilterField3; }
namespace sheet { class XDatabaseRange; }
- namespace sheet { class XSheetFilterDescriptor2; }
+ namespace sheet { class XSheetFilterDescriptor3; }
} } }
namespace oox {
@@ -47,7 +47,7 @@ namespace xls {
/** Contains UNO API filter settings for a column in a filtered range. */
struct ApiFilterSettings
{
- typedef ::std::vector< ::com::sun::star::sheet::TableFilterField2 > FilterFieldVector;
+ typedef ::std::vector<com::sun::star::sheet::TableFilterField3> FilterFieldVector;
FilterFieldVector maFilterFields; /// List of UNO API filter settings.
OptValue< bool > mobNeedsRegExp; /// If set, requires regular expressions to be enabled/disabled.
@@ -236,7 +236,9 @@ public:
FilterColumn& createFilterColumn();
/** Applies the filter to the passed filter descriptor. */
- void finalizeImport( const ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XSheetFilterDescriptor2 >& rxFilterDesc );
+ void finalizeImport(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::sheet::XSheetFilterDescriptor3>& rxFilterDesc );
private:
typedef RefVector< FilterColumn > FilterColumnVector;
diff --git a/oox/source/xls/autofilterbuffer.cxx b/oox/source/xls/autofilterbuffer.cxx
index 0ffcdf6a151b..dd3fc5acf31d 100644
--- a/oox/source/xls/autofilterbuffer.cxx
+++ b/oox/source/xls/autofilterbuffer.cxx
@@ -30,9 +30,9 @@
#include <com/sun/star/sheet/FilterConnection.hpp>
#include <com/sun/star/sheet/FilterOperator2.hpp>
-#include <com/sun/star/sheet/TableFilterField2.hpp>
+#include <com/sun/star/sheet/TableFilterField3.hpp>
#include <com/sun/star/sheet/XDatabaseRange.hpp>
-#include <com/sun/star/sheet/XSheetFilterDescriptor2.hpp>
+#include <com/sun/star/sheet/XSheetFilterDescriptor3.hpp>
#include <com/sun/star/table/TableOrientation.hpp>
#include <rtl/ustrbuf.hxx>
#include "oox/helper/attributelist.hxx"
@@ -170,21 +170,23 @@ ApiFilterSettings::ApiFilterSettings()
void ApiFilterSettings::appendField( bool bAnd, sal_Int32 nOperator, double fValue )
{
maFilterFields.resize( maFilterFields.size() + 1 );
- TableFilterField2& rFilterField = maFilterFields.back();
+ TableFilterField3& rFilterField = maFilterFields.back();
rFilterField.Connection = bAnd ? FilterConnection_AND : FilterConnection_OR;
rFilterField.Operator = nOperator;
- rFilterField.IsNumeric = sal_True;
- rFilterField.NumericValue = fValue;
+ rFilterField.Values.realloc(1);
+ rFilterField.Values[0].IsNumeric = true;
+ rFilterField.Values[0].NumericValue = fValue;
}
void ApiFilterSettings::appendField( bool bAnd, sal_Int32 nOperator, const OUString& rValue )
{
maFilterFields.resize( maFilterFields.size() + 1 );
- TableFilterField2& rFilterField = maFilterFields.back();
+ TableFilterField3& rFilterField = maFilterFields.back();
rFilterField.Connection = bAnd ? FilterConnection_AND : FilterConnection_OR;
rFilterField.Operator = nOperator;
- rFilterField.IsNumeric = sal_False;
- rFilterField.StringValue = rValue;
+ rFilterField.Values.realloc(1);
+ rFilterField.Values[0].IsNumeric = false;
+ rFilterField.Values[0].StringValue = rValue;
}
// ============================================================================
@@ -669,7 +671,7 @@ FilterColumn& AutoFilter::createFilterColumn()
return *xFilterColumn;
}
-void AutoFilter::finalizeImport( const Reference< XSheetFilterDescriptor2 >& rxFilterDesc )
+void AutoFilter::finalizeImport( const Reference<XSheetFilterDescriptor3>& rxFilterDesc )
{
if( rxFilterDesc.is() )
{
@@ -687,7 +689,7 @@ void AutoFilter::finalizeImport( const Reference< XSheetFilterDescriptor2 >& rxF
OSL_ENSURE( nMaxCount > 0, "AutoFilter::finalizeImport - invalid maximum filter field count" );
// resulting list of all UNO API filter fields
- ::std::vector< TableFilterField2 > aFilterFields;
+ ::std::vector<TableFilterField3> aFilterFields;
// track if columns require to enable or disable regular expressions
OptValue< bool > obNeedsRegExp;
@@ -742,7 +744,7 @@ void AutoFilter::finalizeImport( const Reference< XSheetFilterDescriptor2 >& rxF
// insert all filter fields to the filter descriptor
if( !aFilterFields.empty() )
- rxFilterDesc->setFilterFields2( ContainerHelper::vectorToSequence( aFilterFields ) );
+ rxFilterDesc->setFilterFields3( ContainerHelper::vectorToSequence( aFilterFields ) );
// regular expressions
bool bUseRegExp = obNeedsRegExp.get( false );
@@ -828,7 +830,7 @@ bool AutoFilterBuffer::finalizeImport( const Reference< XDatabaseRange >& rxData
PropertySet aRangeProps( rxDatabaseRange );
aRangeProps.setProperty( PROP_AutoFilter, true );
// convert filter settings using the filter descriptor of the database range
- Reference< XSheetFilterDescriptor2 > xFilterDesc( rxDatabaseRange->getFilterDescriptor(), UNO_QUERY_THROW );
+ Reference< XSheetFilterDescriptor3 > xFilterDesc( rxDatabaseRange->getFilterDescriptor(), UNO_QUERY_THROW );
pAutoFilter->finalizeImport( xFilterDesc );
// return true to indicate enabled autofilter
return true;