sw/source/uibase/docvw/AnnotationWin2.cxx |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 4a4f0f6daa2ce1f4b4a99cdc9b86f48df5d961ea
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Dec 10 15:08:54 2020 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Dec 10 17:25:53 2020 +0100

    Don't leave an empty area at the bottom if we can move the text down
    
    in writer's margin comment, which is what ScTextWnd does
    
    Change-Id: I2d71d32619e0f6f5c11f57584b1889c7c4fbe121
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107559
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx 
b/sw/source/uibase/docvw/AnnotationWin2.cxx
index 4e17e799e46d..edcdf448d7b8 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -935,7 +935,15 @@ void SwAnnotationWin::DoResize()
     {   // if we do not have a scrollbar anymore, we want to see the complete 
text
         mpOutlinerView->SetVisArea( PixelToLogic( 
tools::Rectangle(0,0,aWidth,aHeight) ) );
     }
-    mpOutlinerView->SetOutputArea( PixelToLogic( 
tools::Rectangle(0,0,aWidth,aHeight) ) );
+    tools::Rectangle aOutputArea = PixelToLogic(tools::Rectangle(0, 0, aWidth, 
aHeight));
+    mpOutlinerView->SetOutputArea(aOutputArea);
+
+    // Don't leave an empty area at the bottom if we can move the text down.
+    tools::Long nMaxVisAreaTop = mpOutliner->GetTextHeight() - 
aOutputArea.GetHeight();
+    if (mpOutlinerView->GetVisArea().Top() > nMaxVisAreaTop)
+    {
+        GetOutlinerView()->Scroll(0, mpOutlinerView->GetVisArea().Top() - 
nMaxVisAreaTop);
+    }
 
     if (!AllSettings::GetLayoutRTL())
     {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to