Resolves: tdf#145974 reduce the papersize by scrollbar thickness

if scrollbar required and scrollbar isn't an overlay one

Change-Id: I839fd8c214febadb80f692b53dc156e251f506ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126645
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2021-12-10 16:25:45 +00:00
parent 70591eb5ef
commit f40390d98f
2 changed files with 14 additions and 4 deletions

View File

@@ -389,9 +389,14 @@ void AnnotationWindow::DoResize()
::tools::Long aTextHeight = rDevice.LogicToPixel(mpOutliner->CalcTextSize()).Height();
if( aTextHeight > aHeight )
{
const int nThickness = mxVScrollbar->get_scroll_thickness();
if (nThickness)
{
// we need vertical scrollbars and have to reduce the width
aWidth -= mxVScrollbar->get_scroll_thickness();
aWidth -= nThickness;
mpOutliner->SetPaperSize(rDevice.PixelToLogic(Size(aWidth, aHeight)));
}
mxVScrollbar->set_vpolicy(VclPolicyType::ALWAYS);
}
else

View File

@@ -751,9 +751,14 @@ void SwAnnotationWin::DoResize()
mxMetadataDate->show();
if (aTextHeight > aHeight)
{
const int nThickness = mxVScrollbar->get_scroll_thickness();
if (nThickness)
{
// we need vertical scrollbars and have to reduce the width
aWidth -= mxVScrollbar->get_scroll_thickness();
aWidth -= nThickness;
mpOutliner->SetPaperSize(PixelToLogic(Size(aWidth, aHeight)));
}
mxVScrollbar->set_vpolicy(VclPolicyType::ALWAYS);
}
else