diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx index c3b797f239ce..42ebe77c306f 100644 --- a/sd/source/ui/annotations/annotationwindow.cxx +++ b/sd/source/ui/annotations/annotationwindow.cxx @@ -390,8 +390,13 @@ void AnnotationWindow::DoResize() if( aTextHeight > aHeight ) { - // we need vertical scrollbars and have to reduce the width - aWidth -= mxVScrollbar->get_scroll_thickness(); + const int nThickness = mxVScrollbar->get_scroll_thickness(); + if (nThickness) + { + // we need vertical scrollbars and have to reduce the width + aWidth -= nThickness; + mpOutliner->SetPaperSize(rDevice.PixelToLogic(Size(aWidth, aHeight))); + } mxVScrollbar->set_vpolicy(VclPolicyType::ALWAYS); } else diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx index 30e391182118..913430ed9822 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -752,8 +752,13 @@ void SwAnnotationWin::DoResize() if (aTextHeight > aHeight) { - // we need vertical scrollbars and have to reduce the width - aWidth -= mxVScrollbar->get_scroll_thickness(); + const int nThickness = mxVScrollbar->get_scroll_thickness(); + if (nThickness) + { + // we need vertical scrollbars and have to reduce the width + aWidth -= nThickness; + mpOutliner->SetPaperSize(PixelToLogic(Size(aWidth, aHeight))); + } mxVScrollbar->set_vpolicy(VclPolicyType::ALWAYS); } else