include/sfx2/thumbnailview.hxx               |    6 ------
 sfx2/source/control/templateabstractview.cxx |    5 +++++
 sfx2/source/control/thumbnailview.cxx        |   23 ++++++++---------------
 3 files changed, 13 insertions(+), 21 deletions(-)

New commits:
commit e306e206bb9a9754e2b04569dc41badd8e46471a
Author: László Németh <laszlo.nem...@collabora.com>
Date:   Thu Jun 18 00:44:45 2015 +0200

    fix start center rendering
    
    Change-Id: Ib32b299806851fd2df1fbe8a824c1fe49a4efd99
    Reviewed-on: https://gerrit.libreoffice.org/16350
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Jan Holesovsky <ke...@collabora.com>

diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx
index 04c251c..b7375dd 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 fdf246a..dbd2379 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 4bcdf56..08675c0 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
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to