[Libreoffice-commits] core.git: include/sfx2 sfx2/source
László Németh
laszlo.nemeth at collabora.com
Wed Jun 17 15:50:59 PDT 2015
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 2b067f929389fee1382a2cb7c609c420c17e23af
Author: László Németh <laszlo.nemeth at collabora.com>
Date: Thu Jun 18 00:44:45 2015 +0200
fix start center rendering
Change-Id: Ib32b299806851fd2df1fbe8a824c1fe49a4efd99
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
More information about the Libreoffice-commits
mailing list