summaryrefslogtreecommitdiff
path: root/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx')
-rwxr-xr-x[-rw-r--r--]sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx30
1 files changed, 11 insertions, 19 deletions
diff --git a/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx b/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx
index 57872105e1cc..f46e205e7ba8 100644..100755
--- a/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx
+++ b/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx
@@ -24,18 +24,16 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sd.hxx"
#include "precompiled_sd.hxx"
#include "SlsViewCacheContext.hxx"
+#include "SlideSorter.hxx"
#include "model/SlideSorterModel.hxx"
#include "model/SlsPageDescriptor.hxx"
#include "model/SlsPageEnumerationProvider.hxx"
#include "view/SlideSorterView.hxx"
-#include "view/SlsPageObjectViewObjectContact.hxx"
#include "sdpage.hxx"
#include "Window.hxx"
#include "drawdoc.hxx"
@@ -48,11 +46,9 @@
namespace sd { namespace slidesorter { namespace view {
-ViewCacheContext::ViewCacheContext (
- model::SlideSorterModel& rModel,
- SlideSorterView& rView)
- : mrModel(rModel),
- mrView(rView)
+ViewCacheContext::ViewCacheContext (SlideSorter& rSlideSorter)
+ : mrModel(rSlideSorter.GetModel()),
+ mrSlideSorter(rSlideSorter)
{
}
@@ -68,22 +64,17 @@ ViewCacheContext::~ViewCacheContext (void)
void ViewCacheContext::NotifyPreviewCreation (
cache::CacheKey aKey,
- const ::boost::shared_ptr<BitmapEx>& rPreview)
+ const Bitmap&)
{
- (void)rPreview;
const model::SharedPageDescriptor pDescriptor (GetDescriptor(aKey));
if (pDescriptor.get() != NULL)
{
- // Use direct view-invalidate here and no ActionChanged() at the VC
- // since the VC is a PageObjectViewObjectContact and in its ActionChanged()
- // implementation invalidates the cache entry again.
- view::PageObjectViewObjectContact* pContact = pDescriptor->GetViewObjectContact();
- if (pContact != NULL)
- pContact->GetObjectContact().InvalidatePartOfView(pContact->getObjectRange());
+ // Force a repaint that will trigger their re-creation.
+ mrSlideSorter.GetView().RequestRepaint(pDescriptor);
}
else
{
- OSL_ASSERT(pDescriptor.get() != NULL);
+ OSL_ASSERT(pDescriptor);
}
}
@@ -92,7 +83,7 @@ void ViewCacheContext::NotifyPreviewCreation (
bool ViewCacheContext::IsIdle (void)
{
- sal_Int32 nIdleState (tools::IdleDetection::GetIdleState(mrView.GetWindow()));
+ sal_Int32 nIdleState (tools::IdleDetection::GetIdleState(mrSlideSorter.GetContentWindow().get()));
if (nIdleState == tools::IdleDetection::IDET_IDLE)
return true;
else
@@ -104,7 +95,8 @@ bool ViewCacheContext::IsIdle (void)
bool ViewCacheContext::IsVisible (cache::CacheKey aKey)
{
- return GetDescriptor(aKey)->IsVisible();
+ const model::SharedPageDescriptor pDescriptor (GetDescriptor(aKey));
+ return pDescriptor && pDescriptor->HasState(model::PageDescriptor::ST_Visible);
}