[Libreoffice-commits] core.git: sw/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Thu Dec 10 16:26:34 UTC 2020
sw/source/uibase/docvw/AnnotationWin2.cxx | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
New commits:
commit 4a4f0f6daa2ce1f4b4a99cdc9b86f48df5d961ea
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Dec 10 15:08:54 2020 +0000
Commit: Caolán McNamara <caolanm at 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 <caolanm at 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())
{
More information about the Libreoffice-commits
mailing list