diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-11-03 20:43:31 +0000 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-11-04 12:25:36 +0100 |
commit | cff943453a8d42b64b8019b43f6cdc934d5d5f44 (patch) | |
tree | 90604e6c9fc025a9298a5613f8fc1831f8b2c6c4 /sw | |
parent | 0d2bcb7062fe9df5dabd69f6623d21ad4f1b954f (diff) |
Resolves: tdf#144686 set the initial "papersize" to the sidebarwidth
this is the width it is eventually set to, setting that when constructed
makes more sense so text height calculations for the annotation window
are always sane for sidebar layout.
Change-Id: I159255cd877478902599fc4e62b3f6c7df70abb4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124688
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/docvw/SidebarTxtControl.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sw/source/uibase/docvw/SidebarTxtControl.cxx b/sw/source/uibase/docvw/SidebarTxtControl.cxx index 6a7a7770a17e..6f1c1d49da3f 100644 --- a/sw/source/uibase/docvw/SidebarTxtControl.cxx +++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx @@ -112,9 +112,12 @@ void SidebarTextControl::SetDrawingArea(weld::DrawingArea* pDrawingArea) pEditView->setEditViewCallbacks(this); EditEngine* pEditEngine = GetEditEngine(); - // tdf#143443 note we don't call SetPaperSize on pEditEngine unlike - // similar cases so that the Control defaults to the smallest possible - // height it might take, it can grow later + // For tdf#143443 note we want an 'infinite' height initially (which is the + // editengines default). For tdf#144686 it is helpful if the initial width + // is the "SidebarWidth" so the calculated text height is always meaningful + // for layout in the sidebar. + Size aPaperSize(mrPostItMgr.GetSidebarWidth(), pEditEngine->GetPaperSize().Height()); + pEditEngine->SetPaperSize(aPaperSize); pEditEngine->SetRefDevice(&rDevice); pEditView->SetOutputArea(tools::Rectangle(Point(0, 0), aOutputSize)); |