summaryrefslogtreecommitdiff
path: root/sd/source/ui/slidesorter/cache
diff options
context:
space:
mode:
authorAndre Fischer <af@openoffice.org>2010-06-07 11:03:39 +0200
committerAndre Fischer <af@openoffice.org>2010-06-07 11:03:39 +0200
commite96918175018ddff6b954c0b980b810f1569178c (patch)
tree7634d44ebd11a829e71ba1da3298200c60d7c745 /sd/source/ui/slidesorter/cache
parent4da1188ef466399a1bf910de924cc58cb28df2fc (diff)
renaissance1: #i107215# Fixed updates of slide previews.
Diffstat (limited to 'sd/source/ui/slidesorter/cache')
-rw-r--r--sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx9
-rw-r--r--sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx10
2 files changed, 15 insertions, 4 deletions
diff --git a/sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx b/sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx
index 386adf7d5042..f71bddc2372d 100644
--- a/sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx
+++ b/sd/source/ui/slidesorter/cache/SlsGenericPageCache.cxx
@@ -252,7 +252,14 @@ void GenericPageCache::RequestPreviewBitmap (
bool GenericPageCache::InvalidatePreviewBitmap (const CacheKey aKey)
{
- if (mpBitmapCache.get() != NULL)
+ // Invalidate the page in all caches that reference it, not just this one.
+ ::boost::shared_ptr<cache::PageCacheManager> pCacheManager (
+ cache::PageCacheManager::Instance());
+ if (pCacheManager)
+ return pCacheManager->InvalidatePreviewBitmap(
+ mpCacheContext->GetModel(),
+ aKey);
+ else if (mpBitmapCache.get() != NULL)
return mpBitmapCache->InvalidateBitmap(mpCacheContext->GetPage(aKey));
else
return false;
diff --git a/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx b/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx
index 820288de331d..97eb70dd7296 100644
--- a/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx
+++ b/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx
@@ -353,10 +353,12 @@ void PageCacheManager::ReleaseCache (const ::boost::shared_ptr<Cache>& rpCache)
-void PageCacheManager::InvalidatePreviewBitmap (
+bool PageCacheManager::InvalidatePreviewBitmap (
DocumentKey pDocument,
const SdrPage* pKey)
{
+ bool bHasChanged (false);
+
if (pDocument!=NULL)
{
// Iterate over all caches that are currently in use and invalidate
@@ -364,7 +366,7 @@ void PageCacheManager::InvalidatePreviewBitmap (
PageCacheContainer::iterator iCache;
for (iCache=mpPageCaches->begin(); iCache!=mpPageCaches->end(); ++iCache)
if (iCache->first.mpDocument == pDocument)
- iCache->second->InvalidateBitmap(pKey);
+ bHasChanged |= iCache->second->InvalidateBitmap(pKey);
// Invalidate the previews in the recently used caches belonging to
// the given document.
@@ -373,9 +375,11 @@ void PageCacheManager::InvalidatePreviewBitmap (
{
RecentlyUsedQueue::const_iterator iCache2;
for (iCache2=iQueue->second.begin(); iCache2!=iQueue->second.end(); ++iCache2)
- iCache2->mpCache->InvalidateBitmap(pKey);
+ bHasChanged |= iCache2->mpCache->InvalidateBitmap(pKey);
}
}
+
+ return bHasChanged;
}