sd/source/ui/annotations/annotationwindow.cxx | 6 +++--- sw/source/uibase/docvw/AnnotationWin2.cxx | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-)
New commits: commit 3d9f5d21154f4a79df0a3ea4c2d3b6289a034d31 Author: Caolán McNamara <[email protected]> AuthorDate: Fri Feb 26 16:53:00 2021 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Sat Feb 27 20:13:03 2021 +0100 calculate text height after setting paper size Change-Id: Ifb92109ead6b4a321d4abd81c2d36c415cbd767a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111655 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx index fbed7c862aea..408eb1a548bd 100644 --- a/sd/source/ui/annotations/annotationwindow.cxx +++ b/sd/source/ui/annotations/annotationwindow.cxx @@ -399,12 +399,14 @@ void AnnotationWindow::DoResize() void AnnotationContents::DoResize() { - ::tools::Long aTextHeight = LogicToPixel( mpOutliner->CalcTextSize()).Height(); ::tools::Long aHeight = GetSizePixel().Height(); ::tools::ULong aWidth = GetSizePixel().Width(); aHeight -= POSTIT_META_HEIGHT; + mpOutliner->SetPaperSize( PixelToLogic( Size(aWidth, aHeight) ) ) ; + ::tools::Long aTextHeight = LogicToPixel( mpOutliner->CalcTextSize()).Height(); + if( aTextHeight > aHeight ) { // we need vertical scrollbars and have to reduce the width @@ -416,8 +418,6 @@ void AnnotationContents::DoResize() mxVScrollbar->set_vpolicy(VclPolicyType::NEVER); } - mpOutliner->SetPaperSize( PixelToLogic( Size(aWidth,aHeight) ) ) ; - ::tools::Rectangle aOutputArea = PixelToLogic(::tools::Rectangle(0, 0, aWidth, aHeight)); if (mxVScrollbar->get_vpolicy() == VclPolicyType::NEVER) { diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx index cee5d859ae57..b3e361793b99 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -711,11 +711,14 @@ void SwAnnotationWin::SetPosAndSize() void SwAnnotationWin::DoResize() { - tools::Long aTextHeight = LogicToPixel( mpOutliner->CalcTextSize()).Height(); - tools::Long aHeight = GetSizePixel().Height(); - tools::ULong aWidth = GetSizePixel().Width(); + tools::Long aHeight = GetSizePixel().Height(); + tools::ULong aWidth = GetSizePixel().Width(); aHeight -= GetMetaHeight(); + + mpOutliner->SetPaperSize( PixelToLogic( Size(aWidth, aHeight) ) ) ; + tools::Long aTextHeight = LogicToPixel( mpOutliner->CalcTextSize()).Height(); + mxMetadataAuthor->show(); if(IsResolved()) { mxMetadataResolved->show(); } mxMetadataDate->show(); @@ -731,9 +734,6 @@ void SwAnnotationWin::DoResize() mxVScrollbar->set_vpolicy(VclPolicyType::NEVER); } - mpOutliner->SetPaperSize( PixelToLogic( Size(aWidth,aHeight) ) ) ; - - tools::Rectangle aOutputArea = PixelToLogic(tools::Rectangle(0, 0, aWidth, aHeight)); if (mxVScrollbar->get_vpolicy() == VclPolicyType::NEVER) { _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
