sc/source/ui/view/output2.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit efb60b6fb5e11c31fecddf1e0502c1fe4feb7b57
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Tue Apr 12 20:02:24 2022 +0200
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Tue Apr 12 22:15:41 2022 +0200

    treat Calc cells that don't fit as top-aligned rather than bottom
    
    For cells it normally looks better to align them to the bottom,
    but if the content doesn't fit, it looks better to align to top,
    because that shows the start rather than the end of the content,
    and it also logically goes together with the clip mark shown
    to the right of it.
    
    Change-Id: Iac51e9e59d5ab9f5c89374a3e638a4a572f8b1fe
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132931
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index ea35193dc24b..e7bed3f92790 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -3092,6 +3092,11 @@ void ScOutputData::DrawEditStandard(DrawEditParam& 
rParam)
             tools::Long nMarkPixel = static_cast<tools::Long>( 
SC_CLIPMARK_SIZE * mnPPTX );
             if ( aAreaParam.maClipRect.Right() - nMarkPixel > 
aAreaParam.maClipRect.Left() )
                 aAreaParam.maClipRect.AdjustRight( -nMarkPixel );
+
+            // Standard is normally treated as Bottom, but if text height is 
clipped, then
+            // Top looks better and also allows using 
EditEngine::EnableSkipOutsideFormat().
+            if (rParam.meVerJust==SvxCellVerJustify::Standard)
+                rParam.meVerJust=SvxCellVerJustify::Top;
         }
     }
 

Reply via email to