diff options
-rw-r--r-- | include/sfx2/thumbnailview.hxx | 6 | ||||
-rw-r--r-- | sfx2/source/control/templateabstractview.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/control/thumbnailview.cxx | 23 |
3 files changed, 13 insertions, 21 deletions
diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx index 04c251cc8cf7..b7375dd9f4a0 100644 --- a/include/sfx2/thumbnailview.hxx +++ b/include/sfx2/thumbnailview.hxx @@ -261,10 +261,6 @@ protected: virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) SAL_OVERRIDE; - virtual void PrePaint(vcl::RenderContext& rRenderContext) SAL_OVERRIDE; - - virtual void PostPaint(vcl::RenderContext& rRenderContext) SAL_OVERRIDE; - virtual void GetFocus() SAL_OVERRIDE; virtual void LoseFocus() SAL_OVERRIDE; @@ -339,8 +335,6 @@ protected: Link<> maItemStateHdl; ThumbnailItemAttributes* mpItemAttrs; - std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> mpProcessor; - boost::function<bool (const ThumbnailViewItem*)> maFilterFunc; }; 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 |