summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-04-18 13:18:37 +0500
committerMike Kaganski <mike.kaganski@collabora.com>2024-04-20 08:53:26 +0200
commit089398e51409458c5438c49fb347e4f09d9c09dc (patch)
treef9bd3b85a2f3153db57696a68a9a9e48efd8c139 /editeng
parent7b1405689d4246e0e37e8759f03e1962af964cec (diff)
Return double from OutputDevice::GetTextArray
And introduce GetTextWidth / GetTextHeight variants returning double. It allows to avoid premature rounding. At least in one case - testTdf145111_anchor_in_Fontwork - it allowed to make the test DPI-independent (at least in my testing on Windows, using 125, 150, and 175% UI scaling). Change-Id: I973d2c729ec6bb7114b4f99b9027f1ead7c1d061 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166237 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/items/svxfont.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/editeng/source/items/svxfont.cxx b/editeng/source/items/svxfont.cxx
index a4367de4680e..db229190a403 100644
--- a/editeng/source/items/svxfont.cxx
+++ b/editeng/source/items/svxfont.cxx
@@ -38,7 +38,7 @@ static tools::Long GetTextArray( const OutputDevice* pOut, const OUString& rStr,
{
const SalLayoutGlyphs* layoutGlyphs = SalLayoutGlyphsCache::self()->GetLayoutGlyphs(pOut, rStr, nIndex, nLen);
- return pOut->GetTextArray( rStr, pDXAry, nIndex, nLen, true, nullptr, layoutGlyphs);
+ return basegfx::fround<tools::Long>(pOut->GetTextArray( rStr, pDXAry, nIndex, nLen, true, nullptr, layoutGlyphs));
}
SvxFont::SvxFont()
@@ -719,7 +719,7 @@ void SvxDoGetCapitalSize::Do( const OUString &_rTxt, const sal_Int32 _nIdx,
if (pDXAry)
{
KernArray aKernArray;
- aPartSize.setWidth(pOut->GetTextArray(_rTxt, &aKernArray, _nIdx, _nLen));
+ aPartSize.setWidth(basegfx::fround<tools::Long>(pOut->GetTextArray(_rTxt, &aKernArray, _nIdx, _nLen)));
assert(pDXAry->get_factor() == aKernArray.get_factor());
auto& dest = pDXAry->get_subunit_array();
sal_Int32 nStart = dest.empty() ? 0 : dest.back();