renaissance1: #i107215# Obeying application background color.

This commit is contained in:
Andre Fischer
2010-03-03 13:21:37 +01:00
parent 6be133ca03
commit c87f10322a
4 changed files with 45 additions and 15 deletions

View File

@@ -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

View File

@@ -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.

View File

@@ -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());

View File

@@ -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;
}