diff options
author | László Németh <laszlo.nemeth@collabora.com> | 2015-06-18 00:44:45 +0200 |
---|---|---|
committer | László Németh <laszlo.nemeth@collabora.com> | 2015-06-18 00:47:54 +0200 |
commit | 2b067f929389fee1382a2cb7c609c420c17e23af (patch) | |
tree | 5ca3b3d1a959130c834a14175416ca17543ef10b /sfx2/source | |
parent | ef82115aef668b649a80324f5cd126f93a169c4d (diff) |
fix start center rendering
Change-Id: Ib32b299806851fd2df1fbe8a824c1fe49a4efd99
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/control/templateabstractview.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/control/thumbnailview.cxx | 23 |
2 files changed, 13 insertions, 15 deletions
diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx index fdf246a44e0f..dbd237920a14 100644 --- a/sfx2/source/control/templateabstractview.cxx +++ b/sfx2/source/control/templateabstractview.cxx @@ -20,6 +20,7 @@ #include <basegfx/polygon/b2dpolygon.hxx> #include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> #include <drawinglayer/processor2d/baseprocessor2d.hxx> +#include <drawinglayer/processor2d/processorfromoutputdevice.hxx> #include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/embed/XStorage.hpp> @@ -313,6 +314,10 @@ void TemplateAbstractView::Paint(vcl::RenderContext& rRenderContext, const Recta new PolyPolygonColorPrimitive2D(B2DPolyPolygon(Polygon(aRect).getB2DPolygon()), BColor(1.0, 1.0, 1.0))); + const drawinglayer::geometry::ViewInformation2D aNewViewInfos; + std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> mpProcessor( + drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(rRenderContext, aNewViewInfos)); + mpProcessor->process(aSeq); } diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index 4bcdf562f3f2..08675c06b199 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -252,7 +252,7 @@ void ThumbnailView::DrawItem(ThumbnailViewItem *pItem) Rectangle aRect = pItem->getDrawArea(); if ((aRect.GetHeight() > 0) && (aRect.GetWidth() > 0)) - pItem->Paint(mpProcessor.get(), mpItemAttrs); + Invalidate(aRect); } } @@ -855,7 +855,7 @@ void ThumbnailView::Command( const CommandEvent& rCEvt ) Control::Command( rCEvt ); } -void ThumbnailView::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangle& rRect) +void ThumbnailView::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) { size_t nItemCount = mItemList.size(); @@ -865,6 +865,11 @@ void ThumbnailView::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangl B2DPolyPolygon(Polygon(rRect, 5, 5).getB2DPolygon()), maColor.getBColor())); + // Create the processor and process the primitives + const drawinglayer::geometry::ViewInformation2D aNewViewInfos; + + std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> mpProcessor( + drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(rRenderContext, aNewViewInfos)); mpProcessor->process(aSeq); // draw items @@ -874,7 +879,7 @@ void ThumbnailView::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangl if (pItem->isVisible()) { - DrawItem(pItem); + pItem->Paint(mpProcessor.get(), mpItemAttrs); } } @@ -882,18 +887,6 @@ void ThumbnailView::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangl mpScrBar->Invalidate(rRect); } -void ThumbnailView::PrePaint(vcl::RenderContext& rRenderContext) -{ - // Create the processor and process the primitives - const drawinglayer::geometry::ViewInformation2D aNewViewInfos; - mpProcessor.reset(drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(rRenderContext, aNewViewInfos)); -} - -void ThumbnailView::PostPaint(vcl::RenderContext& /*rRenderContext*/) -{ - mpProcessor.reset(); -} - void ThumbnailView::GetFocus() { // Select the first item if nothing selected |