diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-01-05 13:23:31 +0000 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2024-01-10 05:17:33 +0100 |
commit | 606537da38eca6077a0c6ec7d82ca31c92b7e3a6 (patch) | |
tree | 2b2c0ca668eee67b5e3171da583786c394e7f225 | |
parent | 38b16540369287f795285adb987f6d7f789e4d57 (diff) |
Resolves: tdf#158997 optimal col width too narrow to render text
optimal is measured with kerning on, while text is rendered with
kerning off
possibly a problem since:
commit 36eed54d3dfed6551fd2ad944feff7e217c56e82
Date: Tue Jul 3 15:00:26 2018 +0200
Resolves: tdf#118221 whole cell kerning default is off
Change-Id: I0e6de75a89823f6ed58a74782e47feb0a44014e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161678
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r-- | sc/source/core/data/column2.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/output2.cxx | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 3abb568befbc..f4b0ce18410f 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -283,6 +283,7 @@ tools::Long ScColumn::GetNeededSize( { Fraction aFontZoom = ( eOrient == SvxCellOrientation::Standard ) ? rZoomX : rZoomY; vcl::Font aFont; + aFont.SetKerning(FontKerning::NONE); // like ScDrawStringsVars::SetPattern // font color doesn't matter here pPattern->fillFontOnly(aFont, pDev, &aFontZoom, pCondSet, nScript); pDev->SetFont(aFont); @@ -754,6 +755,7 @@ sal_uInt16 ScColumn::GetOptimalColWidth( SCROW nRow = 0; const ScPatternAttr* pPattern = GetPattern( nRow ); vcl::Font aFont; + aFont.SetKerning(FontKerning::NONE); // like ScDrawStringsVars::SetPattern // font color doesn't matter here pPattern->fillFontOnly(aFont, pDev, &rZoomX); pDev->SetFont(aFont); diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 9b325a5dbe82..8f59a529fa93 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -407,7 +407,9 @@ void ScDrawStringsVars::SetPattern( // There is no cell attribute for kerning, default is kerning OFF, all // kerning is stored at an EditText object that is drawn using EditEngine. - aFont.SetKerning( FontKerning::NONE); + // See also matching kerning cases in ScColumn::GetNeededSize and + // ScColumn::GetOptimalColWidth. + aFont.SetKerning(FontKerning::NONE); pDev->SetFont( aFont ); if ( pFmtDevice != pDev ) |