sw/source/uibase/docvw/PostItMgr.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit efa83921498980c43c21aba6678a1f0a587ebbf3
Author:     Rafael Lima <rafael.palma.l...@gmail.com>
AuthorDate: Sun Sep 8 14:32:32 2024 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon Sep 9 12:12:21 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 <xiscofa...@libreoffice.org>
    (cherry picked from commit 005eaf799a1e5424751d059afc09c92ea9b29566)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173021
    (cherry picked from commit 4bbc45eb48f91a552a9583b6aad4d59b2dac96f8)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173024
    Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Tested-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/source/uibase/docvw/PostItMgr.cxx 
b/sw/source/uibase/docvw/PostItMgr.cxx
index d68fc77c4940..29697f5742ae 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -2204,7 +2204,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);

Reply via email to