From 709a6c1541e53f19a742048ef34ac06b5e7df251 Mon Sep 17 00:00:00 2001 From: Rafael Dominguez Date: Wed, 15 Aug 2012 10:16:09 -0430 Subject: Fix filtering items in thumbnailview when painting. Change-Id: I2ec3f6d93246b690a5c28305b3173143b53dab35 --- sfx2/source/control/thumbnailview.cxx | 74 +++++++++++++++++++++++------------ 1 file changed, 50 insertions(+), 24 deletions(-) (limited to 'sfx2/source') diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index c9b4a1383221..996e458eeca9 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -322,47 +322,73 @@ void ThumbnailView::CalculateItemPositions () { ThumbnailViewItem *const pItem = mItemList[i]; - if ((i >= nFirstItem) && (i < nLastItem) && maFilterFunc(pItem) && nCurCount < nTotalItems) + if (maFilterFunc(pItem)) { - if( !pItem->isVisible() && ImplHasAccessibleListeners() ) + if ((nCurCount >= nFirstItem) && (nCurCount < nLastItem)) { - ::com::sun::star::uno::Any aOldAny, aNewAny; + if( !pItem->isVisible()) + { + if ( ImplHasAccessibleListeners() ) + { + ::com::sun::star::uno::Any aOldAny, aNewAny; - aNewAny <<= pItem->GetAccessible( mbIsTransientChildrenDisabled ); - ImplFireAccessibleEvent( ::com::sun::star::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny ); - } + aNewAny <<= pItem->GetAccessible( mbIsTransientChildrenDisabled ); + ImplFireAccessibleEvent( ::com::sun::star::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny ); + } + + pItem->show(true); - if (!mItemList[i]->isVisible()) - maItemStateHdl.Call(mItemList[i]); + maItemStateHdl.Call(pItem); + } - pItem->show(true); - pItem->setDrawArea(Rectangle( Point(x,y), Size(mnItemWidth, mnItemHeight) )); - pItem->calculateItemsPosition(mnThumbnailHeight,mnDisplayHeight,mnItemPadding,mpItemAttrs->nMaxTextLenght); + pItem->setDrawArea(Rectangle( Point(x,y), Size(mnItemWidth, mnItemHeight) )); + pItem->calculateItemsPosition(mnThumbnailHeight,mnDisplayHeight,mnItemPadding,mpItemAttrs->nMaxTextLenght); - if ( !((nCurCount+1) % mnCols) ) - { - x = nStartX; - y += mnItemHeight+nVItemSpace; + if ( !((nCurCount+1) % mnCols) ) + { + x = nStartX; + y += mnItemHeight+nVItemSpace; + } + else + x += mnItemWidth+nHItemSpace; } else - x += mnItemWidth+nHItemSpace; + { + if( pItem->isVisible()) + { + if ( ImplHasAccessibleListeners() ) + { + ::com::sun::star::uno::Any aOldAny, aNewAny; + + aOldAny <<= pItem->GetAccessible( mbIsTransientChildrenDisabled ); + ImplFireAccessibleEvent( ::com::sun::star::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny ); + } + + pItem->show(false); + + maItemStateHdl.Call(pItem); + } + + } ++nCurCount; } else { - if( pItem->isVisible() && ImplHasAccessibleListeners() ) + if( pItem->isVisible()) { - ::com::sun::star::uno::Any aOldAny, aNewAny; + if ( ImplHasAccessibleListeners() ) + { + ::com::sun::star::uno::Any aOldAny, aNewAny; - aOldAny <<= pItem->GetAccessible( mbIsTransientChildrenDisabled ); - ImplFireAccessibleEvent( ::com::sun::star::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny ); - } + aOldAny <<= pItem->GetAccessible( mbIsTransientChildrenDisabled ); + ImplFireAccessibleEvent( ::com::sun::star::accessibility::AccessibleEventId::CHILD, aOldAny, aNewAny ); + } - if (mItemList[i]->isVisible()) - maItemStateHdl.Call(mItemList[i]); + pItem->show(false); - pItem->show(false); + maItemStateHdl.Call(pItem); + } } } -- cgit