summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-11-29 20:31:27 +0000
committerCaolán McNamara <caolanm@redhat.com>2022-12-02 15:20:07 +0000
commitf9395a123e8c85134bdd6e471bc93b2745e22a9d (patch)
treefd64e75a7ea36f28e9b993ae0c00480c480803df /drawinglayer
parent1e222575a3b637398b5b2d8e3172f12538ff34e3 (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 'drawinglayer')
-rw-r--r--drawinglayer/source/primitive2d/textlayoutdevice.cxx15
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx5
-rw-r--r--drawinglayer/source/tools/wmfemfhelper.cxx2
3 files changed, 12 insertions, 10 deletions
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index fcc9b401fa48..ea9fed02a20f 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -29,6 +29,7 @@
#include <osl/diagnose.h>
#include <tools/gen.hxx>
#include <vcl/canvastools.hxx>
+#include <vcl/kernarray.hxx>
#include <vcl/timer.hxx>
#include <vcl/virdev.hxx>
#include <vcl/font.hxx>
@@ -231,12 +232,11 @@ void TextLayouterDevice::getTextOutlines(basegfx::B2DPolyPolygonVector& rB2DPoly
{
OSL_ENSURE(nDXArrayCount == nTextLength,
"DXArray size does not correspond to text portion size (!)");
- std::vector<sal_Int32> aIntegerDXArray(nDXArrayCount);
+ KernArray aIntegerDXArray;
+ aIntegerDXArray.reserve(nDXArrayCount);
for (sal_uInt32 a(0); a < nDXArrayCount; a++)
- {
- aIntegerDXArray[a] = basegfx::fround(rDXArray[a]);
- }
+ aIntegerDXArray.push_back(basegfx::fround(rDXArray[a]));
mrDevice.GetTextOutlines(rB2DPolyPolyVector, rText, nIndex, nIndex, nLength, 0,
aIntegerDXArray, rKashidaArray);
@@ -307,10 +307,11 @@ std::vector<double> TextLayouterDevice::getTextArray(const OUString& rText, sal_
if (nTextLength)
{
- aRetval.reserve(nTextLength);
- std::vector<sal_Int32> aArray;
+ KernArray aArray;
mrDevice.GetTextArray(rText, &aArray, nIndex, nTextLength);
- aRetval.assign(aArray.begin(), aArray.end());
+ aRetval.reserve(aArray.size());
+ for (size_t i = 0, nEnd = aArray.size(); i < nEnd; ++i)
+ aRetval.push_back(aArray[i]);
}
return aRetval;
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index e1d56f4da9b1..bd92921396ae 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -29,6 +29,7 @@
#include <utility>
#include <vcl/glyphitemcache.hxx>
#include <vcl/graph.hxx>
+#include <vcl/kernarray.hxx>
#include <vcl/outdev.hxx>
#include <rtl/ustrbuf.hxx>
#include <sal/log.hxx>
@@ -282,7 +283,7 @@ void VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(
}
// create integer DXArray
- std::vector<sal_Int32> aDXArray;
+ KernArray aDXArray;
if (!rTextCandidate.getDXArray().empty())
{
@@ -335,7 +336,7 @@ void VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(
sal_Int32 nDX = aDXArray[0];
aDXArray.resize(nLen);
for (sal_Int32 i = 1; i < nLen; ++i)
- aDXArray[i] = aDXArray[i - 1] + nDX;
+ aDXArray.set(i, aDXArray[i - 1] + nDX);
}
}
diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx
index 7b1f83b43195..4790465a7366 100644
--- a/drawinglayer/source/tools/wmfemfhelper.cxx
+++ b/drawinglayer/source/tools/wmfemfhelper.cxx
@@ -1797,7 +1797,7 @@ namespace wmfemfhelper
{
// prepare DXArray (if used)
std::vector< double > aDXArray;
- const std::vector<sal_Int32> & rDXArray = pA->GetDXArray();
+ const KernArray& rDXArray = pA->GetDXArray();
std::vector< sal_Bool > aKashidaArray = pA->GetKashidaArray();
if(!rDXArray.empty())