Kaydet (Commit) 4fbd7887 authored tarafından László Németh's avatar László Németh Kaydeden (comit) Andras Timar

fix start center rendering

Change-Id: Ib32b299806851fd2df1fbe8a824c1fe49a4efd99
Reviewed-on: https://gerrit.libreoffice.org/16350Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJan Holesovsky <kendy@collabora.com>
üst 6ca4669f
...@@ -261,10 +261,6 @@ protected: ...@@ -261,10 +261,6 @@ protected:
virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) SAL_OVERRIDE; 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 GetFocus() SAL_OVERRIDE;
virtual void LoseFocus() SAL_OVERRIDE; virtual void LoseFocus() SAL_OVERRIDE;
...@@ -339,8 +335,6 @@ protected: ...@@ -339,8 +335,6 @@ protected:
Link<> maItemStateHdl; Link<> maItemStateHdl;
ThumbnailItemAttributes* mpItemAttrs; ThumbnailItemAttributes* mpItemAttrs;
std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> mpProcessor;
boost::function<bool (const ThumbnailViewItem*)> maFilterFunc; boost::function<bool (const ThumbnailViewItem*)> maFilterFunc;
}; };
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygon.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> #include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <drawinglayer/processor2d/baseprocessor2d.hxx> #include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <drawinglayer/processor2d/processorfromoutputdevice.hxx>
#include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/XStorage.hpp> #include <com/sun/star/embed/XStorage.hpp>
...@@ -313,6 +314,10 @@ void TemplateAbstractView::Paint(vcl::RenderContext& rRenderContext, const Recta ...@@ -313,6 +314,10 @@ void TemplateAbstractView::Paint(vcl::RenderContext& rRenderContext, const Recta
new PolyPolygonColorPrimitive2D(B2DPolyPolygon(Polygon(aRect).getB2DPolygon()), new PolyPolygonColorPrimitive2D(B2DPolyPolygon(Polygon(aRect).getB2DPolygon()),
BColor(1.0, 1.0, 1.0))); 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); mpProcessor->process(aSeq);
} }
......
...@@ -252,7 +252,7 @@ void ThumbnailView::DrawItem(ThumbnailViewItem *pItem) ...@@ -252,7 +252,7 @@ void ThumbnailView::DrawItem(ThumbnailViewItem *pItem)
Rectangle aRect = pItem->getDrawArea(); Rectangle aRect = pItem->getDrawArea();
if ((aRect.GetHeight() > 0) && (aRect.GetWidth() > 0)) if ((aRect.GetHeight() > 0) && (aRect.GetWidth() > 0))
pItem->Paint(mpProcessor.get(), mpItemAttrs); Invalidate(aRect);
} }
} }
...@@ -855,7 +855,7 @@ void ThumbnailView::Command( const CommandEvent& rCEvt ) ...@@ -855,7 +855,7 @@ void ThumbnailView::Command( const CommandEvent& rCEvt )
Control::Command( 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(); size_t nItemCount = mItemList.size();
...@@ -865,6 +865,11 @@ void ThumbnailView::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangl ...@@ -865,6 +865,11 @@ void ThumbnailView::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangl
B2DPolyPolygon(Polygon(rRect, 5, 5).getB2DPolygon()), B2DPolyPolygon(Polygon(rRect, 5, 5).getB2DPolygon()),
maColor.getBColor())); 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); mpProcessor->process(aSeq);
// draw items // draw items
...@@ -874,7 +879,7 @@ void ThumbnailView::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangl ...@@ -874,7 +879,7 @@ void ThumbnailView::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangl
if (pItem->isVisible()) if (pItem->isVisible())
{ {
DrawItem(pItem); pItem->Paint(mpProcessor.get(), mpItemAttrs);
} }
} }
...@@ -882,18 +887,6 @@ void ThumbnailView::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangl ...@@ -882,18 +887,6 @@ void ThumbnailView::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangl
mpScrBar->Invalidate(rRect); 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() void ThumbnailView::GetFocus()
{ {
// Select the first item if nothing selected // Select the first item if nothing selected
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment