From 1a92b2d9a40071c5a86f4f7c6aa405ca5affe433 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Sat, 5 Mar 2011 00:36:23 -0500 Subject: Adjusted ScSpecialFilterDlg for the ScRangeName change. --- sc/source/ui/dbgui/sfiltdlg.cxx | 41 ++++++++++++----------------------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx index 0defb836d5eb..e7bfecfdea3d 100644 --- a/sc/source/ui/dbgui/sfiltdlg.cxx +++ b/sc/source/ui/dbgui/sfiltdlg.cxx @@ -149,42 +149,25 @@ void ScSpecialFilterDlg::Init( const SfxItemSet& rArgSet ) { if(pDoc->GetChangeTrack()!=NULL) aBtnCopyResult.Disable(); - ScRangeName* pRangeNames = pDoc->GetRangeName(); -#if NEW_RANGE_NAME -#else - const USHORT nCount = pRangeNames ? pRangeNames->GetCount() : 0; - - /* - * Aus den RangeNames des Dokumentes werden nun die - * gemerkt, bei denen es sich um Filter-Bereiche handelt - */ - + ScRangeName* pRangeNames = pDoc->GetRangeName(); aLbFilterArea.Clear(); aLbFilterArea.InsertEntry( aStrUndefined, 0 ); - if ( nCount > 0 ) + if (!pRangeNames->empty()) { - String aString; - ScRangeData* pData = NULL; - USHORT nInsert = 0; - - for ( USHORT i=0; ibegin(), itrEnd = pRangeNames->end(); + USHORT nInsert = 0; + for (; itr != itrEnd; ++itr) { - pData = (ScRangeData*)(pRangeNames->At( i )); - if ( pData ) - { - if ( pData->HasType( RT_CRITERIA ) ) - { - pData->GetName( aString ); - nInsert = aLbFilterArea.InsertEntry( aString ); - pData->GetSymbol( aString ); - aLbFilterArea.SetEntryData( nInsert, - new String( aString ) ); - } - } + if (!itr->HasType(RT_CRITERIA)) + continue; + + nInsert = aLbFilterArea.InsertEntry(itr->GetName()); + rtl::OUString aSymbol; + itr->GetSymbol(aSymbol); + aLbFilterArea.SetEntryData(nInsert, new String(aSymbol)); } } -#endif // is there a stored source range? -- cgit