summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Fischer <af@openoffice.org>2010-03-03 13:21:37 +0100
committerAndre Fischer <af@openoffice.org>2010-03-03 13:21:37 +0100
commitc87f10322a175f7d45ee20db236b69befa64d277 (patch)
tree86a0255894c74cf9265932b4350b38264ccdc26f
parent6be133ca030d0e53c2c36de64a6f3b0d7f5a827d (diff)
renaissance1: #i107215# Obeying application background color.
-rw-r--r--sd/source/ui/slidesorter/controller/SlsListener.cxx21
-rw-r--r--sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx4
-rw-r--r--sd/source/ui/slidesorter/view/SlideSorterView.cxx18
-rw-r--r--sd/source/ui/tools/PreviewRenderer.cxx17
4 files changed, 45 insertions, 15 deletions
diff --git a/sd/source/ui/slidesorter/controller/SlsListener.cxx b/sd/source/ui/slidesorter/controller/SlsListener.cxx
index 34154fb36e3c..38348a4fdb6e 100644
--- a/sd/source/ui/slidesorter/controller/SlsListener.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsListener.cxx
@@ -42,6 +42,7 @@
#include "model/SlsPageEnumerationProvider.hxx"
#include "view/SlideSorterView.hxx"
#include "cache/SlsPageCache.hxx"
+#include "cache/SlsPageCacheManager.hxx"
#include "drawdoc.hxx"
#include "DrawDocShell.hxx"
@@ -634,14 +635,20 @@ void Listener::HandleShapeModification (const SdrPage* pPage)
model::PageEnumeration aAllPages (
model::PageEnumerationProvider::CreateAllPagesEnumeration(
mrSlideSorter.GetModel()));
- while (aAllPages.HasMoreElements())
+ ::boost::shared_ptr<cache::PageCacheManager> pCacheManager (
+ cache::PageCacheManager::Instance());
+ if (pCacheManager)
{
- model::SharedPageDescriptor pDescriptor (aAllPages.GetNextElement());
- SdrPage* pCandidate = pDescriptor->GetPage();
- if (pCandidate!=NULL && &pCandidate->TRG_GetMasterPage() == pPage)
- mrSlideSorter.GetView().GetPreviewCache()->InvalidatePreviewBitmap(
- pCandidate,
- true);
+ while (aAllPages.HasMoreElements())
+ {
+ model::SharedPageDescriptor pDescriptor (aAllPages.GetNextElement());
+ SdrPage* pCandidate = pDescriptor->GetPage();
+ if (pCandidate!=NULL && &pCandidate->TRG_GetMasterPage() == pPage)
+ pCacheManager->InvalidatePreviewBitmap(
+ mrSlideSorter.GetModel().GetDocument()->getUnoModel(),
+ pCandidate);
+ mrSlideSorter.GetView().GetPreviewCache()->RequestPreviewBitmap(pCandidate);
+ }
}
}
else
diff --git a/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx b/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx
index 997aa17ebf6c..0b270ff329b3 100644
--- a/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx
+++ b/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx
@@ -146,6 +146,10 @@ public:
sdr::contact::ViewObjectContactRedirector* pRedirector = NULL);
void Paint (OutputDevice& rDevice, const Rectangle& rRepaintArea);
+ virtual void ConfigurationChanged (
+ utl::ConfigurationBroadcaster* pBroadcaster,
+ sal_uInt32 nHint);
+
void Layout (void);
/** This tells the view that it has to re-determine the visibility of
the page objects before painting them the next time.
diff --git a/sd/source/ui/slidesorter/view/SlideSorterView.cxx b/sd/source/ui/slidesorter/view/SlideSorterView.cxx
index 34f0aee84d13..22e3c05eff6c 100644
--- a/sd/source/ui/slidesorter/view/SlideSorterView.cxx
+++ b/sd/source/ui/slidesorter/view/SlideSorterView.cxx
@@ -322,12 +322,12 @@ TYPEINIT1(SlideSorterView, ::sd::View);
SlideSorterView::SlideSorterView (SlideSorter& rSlideSorter)
: ::sd::View (
rSlideSorter.GetModel().GetDocument(),
- NULL,
+ rSlideSorter.GetContentWindow().get(),
rSlideSorter.GetViewShell()),
mrSlideSorter(rSlideSorter),
mrModel(rSlideSorter.GetModel()),
mbIsDisposed(false),
- mpLayouter (new Layouter (rSlideSorter.GetContentWindow())),
+ mpLayouter (new Layouter(rSlideSorter.GetContentWindow())),
mbPageObjectVisibilitiesValid (false),
mpPreviewCache(),
mpLayeredDevice(new LayeredDevice(rSlideSorter.GetContentWindow())),
@@ -886,6 +886,20 @@ void SlideSorterView::Paint (
+void SlideSorterView::ConfigurationChanged (
+ utl::ConfigurationBroadcaster* pBroadcaster,
+ sal_uInt32 nHint)
+{
+ // Some changes of the configuration (some of the colors for example)
+ // may affect the previews. Throw away the old ones and create new ones.
+ cache::PageCacheManager::Instance()->InvalidateAllCaches();
+
+ ::sd::View::ConfigurationChanged(pBroadcaster, nHint);
+}
+
+
+
+
::boost::shared_ptr<cache::PageCache> SlideSorterView::GetPreviewCache (void)
{
SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx
index bf4196667ef3..7e1c2a7f9f63 100644
--- a/sd/source/ui/tools/PreviewRenderer.cxx
+++ b/sd/source/ui/tools/PreviewRenderer.cxx
@@ -71,7 +71,10 @@ PreviewRenderer::PreviewRenderer (
mpPreviewDevice->SetBackground(pTemplate->GetBackground());
}
else
- mpPreviewDevice->SetBackground(Wallpaper(COL_WHITE));
+ {
+ mpPreviewDevice->SetBackground(Wallpaper(
+ Application::GetSettings().GetStyleSettings().GetWindowColor()));
+ }
}
@@ -159,8 +162,8 @@ Image PreviewRenderer::RenderSubstitution (
mpPreviewDevice->SetOutputSizePixel(rPreviewPixelSize);
// Adjust contrast mode.
- bool bUseContrast = Application::GetSettings().GetStyleSettings().
- GetHighContrastMode();
+ const bool bUseContrast (
+ Application::GetSettings().GetStyleSettings().GetHighContrastMode());
mpPreviewDevice->SetDrawMode (bUseContrast
? ViewShell::OUTPUT_DRAWMODE_CONTRAST
: ViewShell::OUTPUT_DRAWMODE_COLOR);
@@ -169,7 +172,7 @@ Image PreviewRenderer::RenderSubstitution (
// visible.
MapMode aMapMode (mpPreviewDevice->GetMapMode());
aMapMode.SetMapUnit(MAP_100TH_MM);
- double nFinalScale (25.0 * rPreviewPixelSize.Width() / 28000.0);
+ const double nFinalScale (25.0 * rPreviewPixelSize.Width() / 28000.0);
aMapMode.SetScaleX(nFinalScale);
aMapMode.SetScaleY(nFinalScale);
const sal_Int32 nFrameWidth (mbHasFrame ? snFrameWidth : 0);
@@ -178,7 +181,7 @@ Image PreviewRenderer::RenderSubstitution (
mpPreviewDevice->SetMapMode (aMapMode);
// Clear the background.
- Rectangle aPaintRectangle (
+ const Rectangle aPaintRectangle (
Point(0,0),
mpPreviewDevice->GetOutputSizePixel());
mpPreviewDevice->EnableMapMode(FALSE);
@@ -192,7 +195,7 @@ Image PreviewRenderer::RenderSubstitution (
PaintSubstitutionText (rSubstitutionText);
PaintFrame();
- Size aSize (mpPreviewDevice->GetOutputSizePixel());
+ const Size aSize (mpPreviewDevice->GetOutputSizePixel());
aPreview = mpPreviewDevice->GetBitmap (
mpPreviewDevice->PixelToLogic(Point(0,0)),
mpPreviewDevice->PixelToLogic(aSize));
@@ -266,6 +269,8 @@ bool PreviewRenderer::Initialize (
rOutliner.SetDefaultLanguage(pDocument->GetLanguage(EE_CHAR_LANGUAGE));
mpView->SetApplicationBackgroundColor(
Color(aColorConfig.GetColorValue(svtools::APPBACKGROUND).nColor));
+ mpPreviewDevice->SetBackground(Wallpaper(aPageBackgroundColor));
+ mpPreviewDevice->Erase();
bSuccess = true;
}