diff options
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() ) |