summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-11-20 10:24:29 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-11-20 10:43:59 +0100
commitf411ef1b8065d3ae03d1a820812e64b250de0932 (patch)
treea2759e614d72fcb937c877787678a2b6864c94eb /sw/source
parentb60e464cb6bb7f4d90e806c46eaf3dd184a37163 (diff)
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
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/uibase/docvw/SidebarWin.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
index c51fc570964e..394fcbe40d6e 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();
}