Kaydet (Commit) 100ac369 authored tarafından Miklos Vajna's avatar Miklos Vajna

sw lok comments: optimize sidebar text control invalidation

Instead of invalidating the whole area, invalidate the sub-widget when
the whole area of the sub-widget would be invalidated.

With this, a test comment with enough comment to have a scrollbar
results in 3 paintTile() calls instead of 11 ones (70% save).

(cherry picked from commit 9ece5c87)

Conflicts:
	sw/source/uibase/docvw/SidebarTxtControl.cxx

Change-Id: I2fe317549eefac9a63aaf50f5a9a242e15c4dc86
üst 952e9eed
......@@ -191,24 +191,28 @@ void SidebarTextControl::Paint(vcl::RenderContext& rRenderContext, const Rectang
void SidebarTextControl::LogicInvalidate(const Rectangle* pRectangle)
{
OString sRectangle;
Rectangle aRectangle;
if (!pRectangle)
sRectangle = "EMPTY";
else
{
// Convert from relative twips to absolute ones.
Rectangle aRectangle(*pRectangle);
vcl::Window& rParent = *mrSidebarWin.EditWin();
Point aOffset(GetOutOffXPixel() - rParent.GetOutOffXPixel(), GetOutOffYPixel() - rParent.GetOutOffYPixel());
rParent.Push(PushFlags::MAPMODE);
rParent.EnableMapMode();
aOffset = rParent.PixelToLogic(aOffset);
rParent.Pop();
aRectangle.Move(aOffset.getX(), aOffset.getY());
sRectangle = aRectangle.toString();
Push(PushFlags::MAPMODE);
EnableMapMode();
aRectangle = Rectangle(Point(0, 0), PixelToLogic(GetSizePixel()));
Pop();
}
else
aRectangle = *pRectangle;
// Convert from relative twips to absolute ones.
vcl::Window& rParent = *mrSidebarWin.EditWin();
Point aOffset(GetOutOffXPixel() - rParent.GetOutOffXPixel(), GetOutOffYPixel() - rParent.GetOutOffYPixel());
rParent.Push(PushFlags::MAPMODE);
rParent.EnableMapMode();
aOffset = rParent.PixelToLogic(aOffset);
rParent.Pop();
aRectangle.Move(aOffset.getX(), aOffset.getY());
OString sRectangle = aRectangle.toString();
SwWrtShell& rWrtShell = mrDocView.GetWrtShell();
rWrtShell.libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_TILES, sRectangle.getStr());
}
......
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