diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-29 10:18:33 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-31 18:42:08 +0100 |
commit | a8bf972230545cd0c0e5dcacb73f5fff804d22de (patch) | |
tree | 3621ede2540c6d49b88f59616530d858ff9703cc /toolkit/source/awt | |
parent | 20354bce87305a274c046cca39ffe8f16add2322 (diff) |
Prepare for removal of non-const operator[] from Sequence in toolkit
Change-Id: I10b3f696fdb0bff1781fb22ec560e1c6dfc10b9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124401
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'toolkit/source/awt')
-rw-r--r-- | toolkit/source/awt/vclxfont.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/toolkit/source/awt/vclxfont.cxx b/toolkit/source/awt/vclxfont.cxx index 2ae914cca2a7..66e5ba2bdc40 100644 --- a/toolkit/source/awt/vclxfont.cxx +++ b/toolkit/source/awt/vclxfont.cxx @@ -20,6 +20,8 @@ #include <memory> #include <com/sun/star/awt/XDevice.hpp> + +#include <comphelper/sequence.hxx> #include <toolkit/awt/vclxfont.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <toolkit/helper/macros.hxx> @@ -158,11 +160,8 @@ sal_Int32 VCLXFont::getStringWidthArray( const OUString& str, css::uno::Sequence pOutDev->SetFont( maFont ); std::vector<sal_Int32> aDXA; nRet = pOutDev->GetTextArray( str, &aDXA ); - rDXArray = css::uno::Sequence<sal_Int32>( str.getLength() ); - for(int i = 0; i < str.getLength(); i++) - { - rDXArray[i] = aDXA[i]; - } + // 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()); pOutDev->SetFont( aOldFont ); } return nRet; |