diff options
author | Rafael Dominguez <venccsralph@gmail.com> | 2012-08-15 10:16:09 -0430 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-08-20 06:40:46 +0200 |
commit | 709a6c1541e53f19a742048ef34ac06b5e7df251 (patch) | |
tree | a76e8f530ea7e4abda53f6589faadeba0f12a438 /sfx2/source | |
parent | f681ec232ece0ca46c2ab1b6b5e4670d553cfb3a (diff) |
Fix filtering items in thumbnailview when painting.
Change-Id: I2ec3f6d93246b690a5c28305b3173143b53dab35
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/control/thumbnailview.cxx | 74 |
1 files changed, 50 insertions, 24 deletions
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); + } } } |