diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-11-29 20:31:27 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-12-02 15:20:07 +0000 |
commit | f9395a123e8c85134bdd6e471bc93b2745e22a9d (patch) | |
tree | fd64e75a7ea36f28e9b993ae0c00480c480803df /toolkit/source/awt/vclxfont.cxx | |
parent | 1e222575a3b637398b5b2d8e3172f12538ff34e3 (diff) |
tdf#152094 retain more accuracy from RefDevMode::MSO1
do it like this to avoid adding another mapmode and to keep things
"the same" as much as possible
Change-Id: I1965aa545646f2d27b950d6335b2f608c3e4e04b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143475
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'toolkit/source/awt/vclxfont.cxx')
-rw-r--r-- | toolkit/source/awt/vclxfont.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/toolkit/source/awt/vclxfont.cxx b/toolkit/source/awt/vclxfont.cxx index e84fe338c5b6..866a362e710f 100644 --- a/toolkit/source/awt/vclxfont.cxx +++ b/toolkit/source/awt/vclxfont.cxx @@ -25,12 +25,11 @@ #include <toolkit/awt/vclxfont.hxx> #include <toolkit/helper/vclunohelper.hxx> +#include <vcl/kernarray.hxx> #include <vcl/metric.hxx> #include <vcl/outdev.hxx> #include <vcl/svapp.hxx> - - VCLXFont::VCLXFont() { mpFontMetric = nullptr; @@ -156,10 +155,12 @@ sal_Int32 VCLXFont::getStringWidthArray( const OUString& str, css::uno::Sequence { vcl::Font aOldFont = pOutDev->GetFont(); pOutDev->SetFont( maFont ); - std::vector<sal_Int32> aDXA; + KernArray aDXA; nRet = pOutDev->GetTextArray( str, &aDXA ); - // I don't know if size of aDXA is guaranteed same as length of str, so use arrayToSequence - rDXArray = comphelper::arrayToSequence<sal_Int32>(aDXA.data(), str.getLength()); + rDXArray.realloc(aDXA.size()); + sal_Int32* pArray = rDXArray.getArray(); + for (size_t i = 0, nLen = aDXA.size(); i < nLen; ++i) + pArray[i] = aDXA[i]; pOutDev->SetFont( aOldFont ); } return nRet; |