diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2011-03-04 22:30:39 -0500 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-03-05 15:21:08 -0500 |
commit | 726a7d3893d49214ca5ef955beb30dcd49b67dd0 (patch) | |
tree | 5a987b7544125138cd24d8d490a41837dfe1e58b /sc/source/ui/vba/vbarange.cxx | |
parent | e40df3cb083c365d542395b4b48f575ff287b277 (diff) |
More on adjusting for ScRangeName's new API.
Diffstat (limited to 'sc/source/ui/vba/vbarange.cxx')
-rw-r--r-- | sc/source/ui/vba/vbarange.cxx | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index b3c498d41e37..3dd34ca7854e 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -6002,7 +6002,6 @@ uno::Any SAL_CALL ScVbaRange::AdvancedFilter( sal_Int32 Action, const uno::Any& // CriteriaRange String aBuiltInCriteria; // Excel Built-In Filter Criteria. - ScRangeData* pData = NULL; table::CellRangeAddress refParentAddr; uno::Any aCriteriaRange = CriteriaRange; formula::FormulaGrammar::AddressConvention aConv = formula::FormulaGrammar::CONV_XL_A1; @@ -6016,19 +6015,18 @@ uno::Any SAL_CALL ScVbaRange::AdvancedFilter( sal_Int32 Action, const uno::Any& { // Get Excel BuiltIn Filter Criteria. ScRangeName* pRangeNames = pDoc->GetRangeName(); -#if NEW_RANGE_NAME -#else - const USHORT nCount = pRangeNames ? pRangeNames->GetCount() : 0; - for ( USHORT index = 0; index < nCount; index++ ) + if (pRangeNames) { - pData = ( ScRangeData* )( pRangeNames->At( index ) ); - if ( pData && pData->HasType( RT_CRITERIA ) ) + ScRangeName::const_iterator itr = pRangeNames->begin(), itrEnd = pRangeNames->end(); + for (; itr != itrEnd; ++itr) { - pData->GetSymbol( aBuiltInCriteria, formula::FormulaGrammar::GRAM_NATIVE_XL_A1 ); - break; + if (itr->HasType(RT_CRITERIA)) + { + itr->GetSymbol( aBuiltInCriteria, formula::FormulaGrammar::GRAM_NATIVE_XL_A1 ); + break; + } } } -#endif aCriteriaRange = aBuiltInCriteria.Len() > 0 ? uno::makeAny( rtl::OUString( aBuiltInCriteria ) ) : aCriteriaRange; } if ( aCriteriaRange.hasValue() ) |