sw/source/uibase/docvw/PostItMgr.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commits: commit 005eaf799a1e5424751d059afc09c92ea9b29566 Author: Rafael Lima <[email protected]> AuthorDate: Sun Sep 8 14:32:32 2024 +0200 Commit: Xisco Fauli <[email protected]> CommitDate: Mon Sep 9 08:29:14 2024 +0200 tdf#162852 Fix minimum comment sidebar width If the mouse is released over the document, the value of nPxWidth can get negative, so we need a signed integer variable here to make std::clamp work as expected. Change-Id: I721b53e9eddee4f02ad31718f8c7187242ba44e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173016 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index 21af23963b58..589f6c02a9cd 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -2195,7 +2195,7 @@ bool SwPostItMgr::HasNotes() const void SwPostItMgr::SetSidebarWidth(Point aMousePos) { sal_uInt16 nZoom = mpWrtShell->GetViewOptions()->GetZoom(); - sal_uInt16 nPxWidth + tools::Long nPxWidth = aMousePos.X() - mpEditWin->LogicToPixel(GetSidebarRect(aMousePos).TopLeft()).X(); double nFactor = static_cast<double>(nPxWidth) / static_cast<double>(nZoom); nFactor = std::clamp(nFactor, 1.0, 8.0);
