renaissance1: #i107215# Obeying application background color.
This commit is contained in:
@@ -42,6 +42,7 @@
|
|||||||
#include "model/SlsPageEnumerationProvider.hxx"
|
#include "model/SlsPageEnumerationProvider.hxx"
|
||||||
#include "view/SlideSorterView.hxx"
|
#include "view/SlideSorterView.hxx"
|
||||||
#include "cache/SlsPageCache.hxx"
|
#include "cache/SlsPageCache.hxx"
|
||||||
|
#include "cache/SlsPageCacheManager.hxx"
|
||||||
#include "drawdoc.hxx"
|
#include "drawdoc.hxx"
|
||||||
#include "DrawDocShell.hxx"
|
#include "DrawDocShell.hxx"
|
||||||
|
|
||||||
@@ -634,14 +635,20 @@ void Listener::HandleShapeModification (const SdrPage* pPage)
|
|||||||
model::PageEnumeration aAllPages (
|
model::PageEnumeration aAllPages (
|
||||||
model::PageEnumerationProvider::CreateAllPagesEnumeration(
|
model::PageEnumerationProvider::CreateAllPagesEnumeration(
|
||||||
mrSlideSorter.GetModel()));
|
mrSlideSorter.GetModel()));
|
||||||
while (aAllPages.HasMoreElements())
|
::boost::shared_ptr<cache::PageCacheManager> pCacheManager (
|
||||||
|
cache::PageCacheManager::Instance());
|
||||||
|
if (pCacheManager)
|
||||||
{
|
{
|
||||||
model::SharedPageDescriptor pDescriptor (aAllPages.GetNextElement());
|
while (aAllPages.HasMoreElements())
|
||||||
SdrPage* pCandidate = pDescriptor->GetPage();
|
{
|
||||||
if (pCandidate!=NULL && &pCandidate->TRG_GetMasterPage() == pPage)
|
model::SharedPageDescriptor pDescriptor (aAllPages.GetNextElement());
|
||||||
mrSlideSorter.GetView().GetPreviewCache()->InvalidatePreviewBitmap(
|
SdrPage* pCandidate = pDescriptor->GetPage();
|
||||||
pCandidate,
|
if (pCandidate!=NULL && &pCandidate->TRG_GetMasterPage() == pPage)
|
||||||
true);
|
pCacheManager->InvalidatePreviewBitmap(
|
||||||
|
mrSlideSorter.GetModel().GetDocument()->getUnoModel(),
|
||||||
|
pCandidate);
|
||||||
|
mrSlideSorter.GetView().GetPreviewCache()->RequestPreviewBitmap(pCandidate);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@@ -146,6 +146,10 @@ public:
|
|||||||
sdr::contact::ViewObjectContactRedirector* pRedirector = NULL);
|
sdr::contact::ViewObjectContactRedirector* pRedirector = NULL);
|
||||||
void Paint (OutputDevice& rDevice, const Rectangle& rRepaintArea);
|
void Paint (OutputDevice& rDevice, const Rectangle& rRepaintArea);
|
||||||
|
|
||||||
|
virtual void ConfigurationChanged (
|
||||||
|
utl::ConfigurationBroadcaster* pBroadcaster,
|
||||||
|
sal_uInt32 nHint);
|
||||||
|
|
||||||
void Layout (void);
|
void Layout (void);
|
||||||
/** This tells the view that it has to re-determine the visibility of
|
/** This tells the view that it has to re-determine the visibility of
|
||||||
the page objects before painting them the next time.
|
the page objects before painting them the next time.
|
||||||
|
@@ -322,12 +322,12 @@ TYPEINIT1(SlideSorterView, ::sd::View);
|
|||||||
SlideSorterView::SlideSorterView (SlideSorter& rSlideSorter)
|
SlideSorterView::SlideSorterView (SlideSorter& rSlideSorter)
|
||||||
: ::sd::View (
|
: ::sd::View (
|
||||||
rSlideSorter.GetModel().GetDocument(),
|
rSlideSorter.GetModel().GetDocument(),
|
||||||
NULL,
|
rSlideSorter.GetContentWindow().get(),
|
||||||
rSlideSorter.GetViewShell()),
|
rSlideSorter.GetViewShell()),
|
||||||
mrSlideSorter(rSlideSorter),
|
mrSlideSorter(rSlideSorter),
|
||||||
mrModel(rSlideSorter.GetModel()),
|
mrModel(rSlideSorter.GetModel()),
|
||||||
mbIsDisposed(false),
|
mbIsDisposed(false),
|
||||||
mpLayouter (new Layouter (rSlideSorter.GetContentWindow())),
|
mpLayouter (new Layouter(rSlideSorter.GetContentWindow())),
|
||||||
mbPageObjectVisibilitiesValid (false),
|
mbPageObjectVisibilitiesValid (false),
|
||||||
mpPreviewCache(),
|
mpPreviewCache(),
|
||||||
mpLayeredDevice(new LayeredDevice(rSlideSorter.GetContentWindow())),
|
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)
|
::boost::shared_ptr<cache::PageCache> SlideSorterView::GetPreviewCache (void)
|
||||||
{
|
{
|
||||||
SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
|
SharedSdWindow pWindow (mrSlideSorter.GetContentWindow());
|
||||||
|
@@ -71,7 +71,10 @@ PreviewRenderer::PreviewRenderer (
|
|||||||
mpPreviewDevice->SetBackground(pTemplate->GetBackground());
|
mpPreviewDevice->SetBackground(pTemplate->GetBackground());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
mpPreviewDevice->SetBackground(Wallpaper(COL_WHITE));
|
{
|
||||||
|
mpPreviewDevice->SetBackground(Wallpaper(
|
||||||
|
Application::GetSettings().GetStyleSettings().GetWindowColor()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -159,8 +162,8 @@ Image PreviewRenderer::RenderSubstitution (
|
|||||||
mpPreviewDevice->SetOutputSizePixel(rPreviewPixelSize);
|
mpPreviewDevice->SetOutputSizePixel(rPreviewPixelSize);
|
||||||
|
|
||||||
// Adjust contrast mode.
|
// Adjust contrast mode.
|
||||||
bool bUseContrast = Application::GetSettings().GetStyleSettings().
|
const bool bUseContrast (
|
||||||
GetHighContrastMode();
|
Application::GetSettings().GetStyleSettings().GetHighContrastMode());
|
||||||
mpPreviewDevice->SetDrawMode (bUseContrast
|
mpPreviewDevice->SetDrawMode (bUseContrast
|
||||||
? ViewShell::OUTPUT_DRAWMODE_CONTRAST
|
? ViewShell::OUTPUT_DRAWMODE_CONTRAST
|
||||||
: ViewShell::OUTPUT_DRAWMODE_COLOR);
|
: ViewShell::OUTPUT_DRAWMODE_COLOR);
|
||||||
@@ -169,7 +172,7 @@ Image PreviewRenderer::RenderSubstitution (
|
|||||||
// visible.
|
// visible.
|
||||||
MapMode aMapMode (mpPreviewDevice->GetMapMode());
|
MapMode aMapMode (mpPreviewDevice->GetMapMode());
|
||||||
aMapMode.SetMapUnit(MAP_100TH_MM);
|
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.SetScaleX(nFinalScale);
|
||||||
aMapMode.SetScaleY(nFinalScale);
|
aMapMode.SetScaleY(nFinalScale);
|
||||||
const sal_Int32 nFrameWidth (mbHasFrame ? snFrameWidth : 0);
|
const sal_Int32 nFrameWidth (mbHasFrame ? snFrameWidth : 0);
|
||||||
@@ -178,7 +181,7 @@ Image PreviewRenderer::RenderSubstitution (
|
|||||||
mpPreviewDevice->SetMapMode (aMapMode);
|
mpPreviewDevice->SetMapMode (aMapMode);
|
||||||
|
|
||||||
// Clear the background.
|
// Clear the background.
|
||||||
Rectangle aPaintRectangle (
|
const Rectangle aPaintRectangle (
|
||||||
Point(0,0),
|
Point(0,0),
|
||||||
mpPreviewDevice->GetOutputSizePixel());
|
mpPreviewDevice->GetOutputSizePixel());
|
||||||
mpPreviewDevice->EnableMapMode(FALSE);
|
mpPreviewDevice->EnableMapMode(FALSE);
|
||||||
@@ -192,7 +195,7 @@ Image PreviewRenderer::RenderSubstitution (
|
|||||||
PaintSubstitutionText (rSubstitutionText);
|
PaintSubstitutionText (rSubstitutionText);
|
||||||
PaintFrame();
|
PaintFrame();
|
||||||
|
|
||||||
Size aSize (mpPreviewDevice->GetOutputSizePixel());
|
const Size aSize (mpPreviewDevice->GetOutputSizePixel());
|
||||||
aPreview = mpPreviewDevice->GetBitmap (
|
aPreview = mpPreviewDevice->GetBitmap (
|
||||||
mpPreviewDevice->PixelToLogic(Point(0,0)),
|
mpPreviewDevice->PixelToLogic(Point(0,0)),
|
||||||
mpPreviewDevice->PixelToLogic(aSize));
|
mpPreviewDevice->PixelToLogic(aSize));
|
||||||
@@ -266,6 +269,8 @@ bool PreviewRenderer::Initialize (
|
|||||||
rOutliner.SetDefaultLanguage(pDocument->GetLanguage(EE_CHAR_LANGUAGE));
|
rOutliner.SetDefaultLanguage(pDocument->GetLanguage(EE_CHAR_LANGUAGE));
|
||||||
mpView->SetApplicationBackgroundColor(
|
mpView->SetApplicationBackgroundColor(
|
||||||
Color(aColorConfig.GetColorValue(svtools::APPBACKGROUND).nColor));
|
Color(aColorConfig.GetColorValue(svtools::APPBACKGROUND).nColor));
|
||||||
|
mpPreviewDevice->SetBackground(Wallpaper(aPageBackgroundColor));
|
||||||
|
mpPreviewDevice->Erase();
|
||||||
|
|
||||||
bSuccess = true;
|
bSuccess = true;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user