[Libreoffice-commits] core.git: sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Fri Nov 20 01:45:45 PST 2015
sw/source/uibase/docvw/SidebarWin.cxx | 14 ++++++++++++++
1 file changed, 14 insertions(+)
New commits:
commit f411ef1b8065d3ae03d1a820812e64b250de0932
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Fri Nov 20 10:24:29 2015 +0100
sw lok comments: implement painting of the vertical scrollbar
This one is special, as normally its map mode is in pixels, but we need
all sub-widgets to work in twips when tiled rendering.
With this, the scrollbar widget (both the buttons and the
button/background area of the scrollbar itself) is painted at the
correct location when Writer comments have enough content so the
scrollbar is visible.
Change-Id: I4ee9ef8618974b965339078d2262364ec19732ef
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
index c51fc57..394fcbe 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -289,8 +289,22 @@ void SwSidebarWin::PaintTile(vcl::RenderContext& rRenderContext, const Rectangle
aMapMode.SetOrigin(aMapMode.GetOrigin() + aOffset);
rRenderContext.SetMapMode(aMapMode);
+ bool bPopChild = false;
+ if (pChild->GetMapMode().GetMapUnit() != rRenderContext.GetMapMode().GetMapUnit())
+ {
+ // This is needed for the scrollbar that has its map unit in pixels.
+ pChild->Push(PushFlags::MAPMODE);
+ bPopChild = true;
+ pChild->EnableMapMode();
+ aMapMode = pChild->GetMapMode();
+ aMapMode.SetMapUnit(rRenderContext.GetMapMode().GetMapUnit());
+ pChild->SetMapMode(aMapMode);
+ }
+
pChild->Paint(rRenderContext, rRect);
+ if (bPopChild)
+ pChild->Pop();
rRenderContext.Pop();
}
More information about the Libreoffice-commits
mailing list