summaryrefslogtreecommitdiff
path: root/vcl/qa
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/qa')
-rw-r--r--vcl/qa/cppunit/complextext.cxx80
-rw-r--r--vcl/qa/cppunit/pdfexport/pdfexport.cxx14
-rw-r--r--vcl/qa/cppunit/svm/svmtest.cxx8
-rw-r--r--vcl/qa/cppunit/text.cxx16
4 files changed, 64 insertions, 54 deletions
diff --git a/vcl/qa/cppunit/complextext.cxx b/vcl/qa/cppunit/complextext.cxx
index a3d033e7adba..693cde25b206 100644
--- a/vcl/qa/cppunit/complextext.cxx
+++ b/vcl/qa/cppunit/complextext.cxx
@@ -18,6 +18,7 @@
#if HAVE_MORE_FONTS
// must be declared before inclusion of test/bootstrapfixture.hxx
static std::ostream& operator<<(std::ostream& rStream, const std::vector<sal_Int32>& rVec);
+static std::ostream& operator<<(std::ostream& rStream, const std::vector<double>& rVec);
#endif
#include <test/bootstrapfixture.hxx>
@@ -40,6 +41,15 @@ static std::ostream& operator<<(std::ostream& rStream, const std::vector<sal_Int
rStream << " }";
return rStream;
}
+static std::ostream& operator<<(std::ostream& rStream, const std::vector<double>& rVec)
+{
+ rStream << "{ ";
+ for (size_t i = 0; i < rVec.size() - 1; i++)
+ rStream << rVec[i] << ", ";
+ rStream << rVec.back();
+ rStream << " }";
+ return rStream;
+}
#endif
class VclComplexTextTest : public test::BootstrapFixture
@@ -82,17 +92,17 @@ CPPUNIT_TEST_FIXTURE(VclComplexTextTest, testArabic)
// absolute character widths AKA text array.
tools::Long nRefTextWidth = 12595;
- std::vector<sal_Int32> aRefCharWidths = { 989, 1558, 2824, 2824, 3899,
+ KernArray aRefCharWidths = { 989, 1558, 2824, 2824, 3899,
3899, 4550, 5119, 5689, 5689, 6307, 6925, 8484, 9135, 9705, 10927,
10927, 11497, 12595, 12595 };
KernArray aCharWidths;
tools::Long nTextWidth
= basegfx::fround<tools::Long>(pOutDev->GetTextArray(aOneTwoThree, &aCharWidths).nWidth);
- CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths.get_subunit_array());
+ CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths);
// this sporadically returns 75 or 74 on some of the windows tinderboxes eg. tb73
CPPUNIT_ASSERT_EQUAL(nRefTextWidth, nTextWidth);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(nTextWidth), aCharWidths.back());
+ CPPUNIT_ASSERT_EQUAL(nTextWidth, tools::Long(aCharWidths.back()));
// text advance width and line height
CPPUNIT_ASSERT_EQUAL(nRefTextWidth, pOutDev->GetTextWidth(aOneTwoThree));
@@ -258,7 +268,7 @@ CPPUNIT_TEST_FIXTURE(VclComplexTextTest, testCaret)
OUString aText;
KernArray aCharWidths;
- std::vector<sal_Int32> aRefCharWidths;
+ KernArray aRefCharWidths;
tools::Long nTextWidth, nTextWidth2, nRefTextWidth;
// A. RTL text
@@ -270,18 +280,18 @@ CPPUNIT_TEST_FIXTURE(VclComplexTextTest, testCaret)
aRefCharWidths = { 1168, 1168, 1819, 2389, 3611, 3611 };
nTextWidth = basegfx::fround<tools::Long>(
pOutDev->GetTextArray(aText, &aCharWidths, 0, -1, /*bCaret*/ false).nWidth);
- CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths.get_subunit_array());
+ CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths);
CPPUNIT_ASSERT_EQUAL(nRefTextWidth, nTextWidth);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(nTextWidth), aCharWidths.back());
+ CPPUNIT_ASSERT_EQUAL(nTextWidth, tools::Long(aCharWidths.back()));
// 2) Caret placement DX array, ligature width is distributed over its
// components.
aRefCharWidths = { 584, 1168, 1819, 2389, 3000, 3611 };
nTextWidth = basegfx::fround<tools::Long>(
pOutDev->GetTextArray(aText, &aCharWidths, 0, -1, /*bCaret*/ true).nWidth);
- CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths.get_subunit_array());
+ CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths);
CPPUNIT_ASSERT_EQUAL(nRefTextWidth, nTextWidth);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(nTextWidth), aCharWidths.back());
+ CPPUNIT_ASSERT_EQUAL(nTextWidth, tools::Long(aCharWidths.back()));
// 3) caret placement with combining marks, they should not add to ligature
// component count.
@@ -293,10 +303,10 @@ CPPUNIT_TEST_FIXTURE(VclComplexTextTest, testCaret)
CPPUNIT_ASSERT_EQUAL(aCharWidths[2], aCharWidths[3]);
CPPUNIT_ASSERT_EQUAL(aCharWidths[6], aCharWidths[7]);
CPPUNIT_ASSERT_EQUAL(aCharWidths[8], aCharWidths[9]);
- CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths.get_subunit_array());
+ CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths);
CPPUNIT_ASSERT_EQUAL(nRefTextWidth, nTextWidth2);
CPPUNIT_ASSERT_EQUAL(nTextWidth, nTextWidth2);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(nTextWidth), aCharWidths.back());
+ CPPUNIT_ASSERT_EQUAL(nTextWidth, tools::Long(aCharWidths.back()));
// B. LTR text
aText = u"fi fl ffi ffl"_ustr;
@@ -307,18 +317,18 @@ CPPUNIT_TEST_FIXTURE(VclComplexTextTest, testCaret)
aRefCharWidths = { 1290, 1290, 1941, 3231, 3231, 3882, 5862, 5862, 5862, 6513, 8493, 8493, 8493 };
nTextWidth = basegfx::fround<tools::Long>(
pOutDev->GetTextArray(aText, &aCharWidths, 0, -1, /*bCaret*/ false).nWidth);
- CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths.get_subunit_array());
+ CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths);
CPPUNIT_ASSERT_EQUAL(nRefTextWidth, nTextWidth);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(nTextWidth), aCharWidths.back());
+ CPPUNIT_ASSERT_EQUAL(nTextWidth, tools::Long(aCharWidths.back()));
// 2) Caret placement DX array, ligature width is distributed over its
// components.
aRefCharWidths = { 645, 1290, 1941, 2586, 3231, 3882, 4542, 5202, 5862, 6513, 7173, 7833, 8493 };
nTextWidth = basegfx::fround<tools::Long>(
pOutDev->GetTextArray(aText, &aCharWidths, 0, -1, /*bCaret*/ true).nWidth);
- CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths.get_subunit_array());
+ CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths);
CPPUNIT_ASSERT_EQUAL(nRefTextWidth, nTextWidth);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(nTextWidth), aCharWidths.back());
+ CPPUNIT_ASSERT_EQUAL(nTextWidth, tools::Long(aCharWidths.back()));
#endif
}
@@ -332,7 +342,7 @@ CPPUNIT_TEST_FIXTURE(VclComplexTextTest, testGdefCaret)
vcl::Font aFont;
OUString aText;
KernArray aCharWidths;
- std::vector<sal_Int32> aRefCharWidths;
+ KernArray aRefCharWidths;
tools::Long nTextWidth, nTextWidth2, nRefTextWidth;
// A. RTL text
@@ -348,18 +358,18 @@ CPPUNIT_TEST_FIXTURE(VclComplexTextTest, testGdefCaret)
aRefCharWidths= { 582, 582, 842, 1111, 1710, 1710 };
nTextWidth = basegfx::fround<tools::Long>(
pOutDev->GetTextArray(aText, &aCharWidths, 0, -1, /*bCaret*/ false).nWidth);
- CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths.get_subunit_array());
+ CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths);
CPPUNIT_ASSERT_EQUAL(nRefTextWidth, nTextWidth);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(nTextWidth), aCharWidths.back());
+ CPPUNIT_ASSERT_EQUAL(nTextWidth, tools::Long(aCharWidths.back()));
// 2) Caret placement DX array, ligature width is distributed over its
// components.
aRefCharWidths = { 291, 582, 842, 1111, 1410, 1710 };
nTextWidth = basegfx::fround<tools::Long>(
pOutDev->GetTextArray(aText, &aCharWidths, 0, -1, /*bCaret*/ true).nWidth);
- CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths.get_subunit_array());
+ CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths);
CPPUNIT_ASSERT_EQUAL(nRefTextWidth, nTextWidth);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(nTextWidth), aCharWidths.back());
+ CPPUNIT_ASSERT_EQUAL(nTextWidth, tools::Long(aCharWidths.back()));
// 3) caret placement with combining marks, they should not add to ligature
// component count.
@@ -371,10 +381,10 @@ CPPUNIT_TEST_FIXTURE(VclComplexTextTest, testGdefCaret)
CPPUNIT_ASSERT_EQUAL(aCharWidths[2], aCharWidths[3]);
CPPUNIT_ASSERT_EQUAL(aCharWidths[6], aCharWidths[7]);
CPPUNIT_ASSERT_EQUAL(aCharWidths[8], aCharWidths[9]);
- CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths.get_subunit_array());
+ CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths);
CPPUNIT_ASSERT_EQUAL(nRefTextWidth, nTextWidth2);
CPPUNIT_ASSERT_EQUAL(nTextWidth, nTextWidth2);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(nTextWidth), aCharWidths.back());
+ CPPUNIT_ASSERT_EQUAL(nTextWidth, tools::Long(aCharWidths.back()));
// B. LTR text
// Set font size to its UPEM to decrease rounding issues
@@ -390,9 +400,9 @@ CPPUNIT_TEST_FIXTURE(VclComplexTextTest, testGdefCaret)
3544, 3544, 3544, 3836, 4634, 4634, 4926, 5996, 5996, 5996 };
nTextWidth = basegfx::fround<tools::Long>(
pOutDev->GetTextArray(aText, &aCharWidths, 0, -1, /*bCaret*/ false).nWidth);
- CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths.get_subunit_array());
+ CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths);
CPPUNIT_ASSERT_EQUAL(nRefTextWidth, nTextWidth);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(nTextWidth), aCharWidths.back());
+ CPPUNIT_ASSERT_EQUAL(nTextWidth, tools::Long(aCharWidths.back()));
// 2) Caret placement DX array, ligature width is distributed over its
// components.
@@ -400,9 +410,9 @@ CPPUNIT_TEST_FIXTURE(VclComplexTextTest, testGdefCaret)
3004, 3278, 3544, 3836, 4138, 4634, 4926, 5199, 5494, 5996 };
nTextWidth = basegfx::fround<tools::Long>(
pOutDev->GetTextArray(aText, &aCharWidths, 0, -1, /*bCaret*/ true).nWidth);
- CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths.get_subunit_array());
+ CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths);
CPPUNIT_ASSERT_EQUAL(nRefTextWidth, nTextWidth);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(nTextWidth), aCharWidths.back());
+ CPPUNIT_ASSERT_EQUAL(nTextWidth, tools::Long(aCharWidths.back()));
#endif
}
@@ -417,25 +427,25 @@ CPPUNIT_TEST_FIXTURE(VclComplexTextTest, testTdf152048)
pOutDev->SetFont(aFont);
// get an compare the default text array
- std::vector<sal_Int32> aRefCharWidths{ 934, 2341, 2341, 3689, 4647, 5495 };
+ KernArray aRefCharWidths{ 934, 2341, 2341, 3689, 4647, 5495 };
tools::Long nRefTextWidth(5495);
KernArray aCharWidths;
tools::Long nTextWidth
= basegfx::fround<tools::Long>(pOutDev->GetTextArray(aText, &aCharWidths).nWidth);
- CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths.get_subunit_array());
+ CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths);
CPPUNIT_ASSERT_EQUAL(nRefTextWidth, nTextWidth);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(nTextWidth), aCharWidths.back());
+ CPPUNIT_ASSERT_EQUAL(nTextWidth, tools::Long(aCharWidths.back()));
// Simulate Kashida insertion using Kashida array and extending text array
// to have room for Kashida.
std::vector<sal_Bool> aKashidaArray{ false, false, false, true, false, false };
auto nKashida = 4000;
- aCharWidths.set(3, aCharWidths[3] + nKashida);
- aCharWidths.set(4, aCharWidths[4] + nKashida);
- aCharWidths.set(5, aCharWidths[5] + nKashida);
+ aCharWidths[3] += nKashida;
+ aCharWidths[4] += nKashida;
+ aCharWidths[5] += nKashida;
auto pLayout = pOutDev->ImplLayout(aText, 0, -1, Point(0, 0), 0, aCharWidths, aKashidaArray);
// Without the fix this fails with:
@@ -463,7 +473,7 @@ CPPUNIT_TEST_FIXTURE(VclComplexTextTest, testTdf152048_2)
// Without the fix this fails with:
// - Expected: 158
// - Actual : 118
- CPPUNIT_ASSERT_EQUAL(aCharWidths.back(), sal_Int32(nTextWidth));
+ CPPUNIT_ASSERT_EQUAL(tools::Long(aCharWidths.back()), nTextWidth);
#endif
}
@@ -525,14 +535,14 @@ CPPUNIT_TEST_FIXTURE(VclComplexTextTest, testMixedCJKLatinScript_glyph_advanceme
// absolute character widths AKA text array.
tools::Long nRefTextWidth = 704;
- std::vector<sal_Int32> aRefCharWidths = { 72, 144, 190, 236, 259, 305, 333, 379, 425, 474, 523, 551, 567, 612, 658, 704 };
+ KernArray aRefCharWidths = { 72, 144, 190, 236, 259, 305, 333, 379, 425, 474, 523, 551, 567, 612, 658, 704 };
KernArray aCharWidths;
tools::Long nTextWidth
= basegfx::fround<tools::Long>(pOutDev->GetTextArray(aTestScript, &aCharWidths).nWidth);
- CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths.get_subunit_array());
+ CPPUNIT_ASSERT_EQUAL(aRefCharWidths, aCharWidths);
CPPUNIT_ASSERT_EQUAL(nRefTextWidth, nTextWidth);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(nTextWidth), aCharWidths.back());
+ CPPUNIT_ASSERT_EQUAL(nTextWidth, tools::Long(aCharWidths.back()));
// text advance width and line height
CPPUNIT_ASSERT_EQUAL(nRefTextWidth, pOutDev->GetTextWidth(aTestScript));
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index 765e4a0aaa4f..453b36f7bb84 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -2246,7 +2246,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf157816)
const auto* pNumR = dynamic_cast<vcl::filter::PDFNumberElement*>(rElements[2]);
CPPUNIT_ASSERT(pNumR);
// this changed to the end of the text, not the start of the fly
- CPPUNIT_ASSERT_DOUBLES_EQUAL(187.207, pNumR->GetValue(), 1e-3);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(187.157, pNumR->GetValue(), 1e-3);
const auto* pNumB = dynamic_cast<vcl::filter::PDFNumberElement*>(rElements[3]);
CPPUNIT_ASSERT(pNumB);
CPPUNIT_ASSERT_DOUBLES_EQUAL(688.389, pNumB->GetValue(), 1e-3);
@@ -2312,7 +2312,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf157816)
CPPUNIT_ASSERT_DOUBLES_EQUAL(660.789, pNumT->GetValue(), 1e-3);
const auto* pNumR = dynamic_cast<vcl::filter::PDFNumberElement*>(rElements[2]);
CPPUNIT_ASSERT(pNumR);
- CPPUNIT_ASSERT_DOUBLES_EQUAL(146.157, pNumR->GetValue(), 1e-3);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(146.107, pNumR->GetValue(), 1e-3);
const auto* pNumB = dynamic_cast<vcl::filter::PDFNumberElement*>(rElements[3]);
CPPUNIT_ASSERT(pNumB);
CPPUNIT_ASSERT_DOUBLES_EQUAL(674.589, pNumB->GetValue(), 1e-3);
@@ -2372,13 +2372,13 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf157816)
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(4), rElements.size());
const auto* pNumL = dynamic_cast<vcl::filter::PDFNumberElement*>(rElements[0]);
CPPUNIT_ASSERT(pNumL);
- CPPUNIT_ASSERT_DOUBLES_EQUAL(146.093, pNumL->GetValue(), 1e-3);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(146.043, pNumL->GetValue(), 1e-3);
const auto* pNumT = dynamic_cast<vcl::filter::PDFNumberElement*>(rElements[1]);
CPPUNIT_ASSERT(pNumT);
CPPUNIT_ASSERT_DOUBLES_EQUAL(660.789, pNumT->GetValue(), 1e-3);
const auto* pNumR = dynamic_cast<vcl::filter::PDFNumberElement*>(rElements[2]);
CPPUNIT_ASSERT(pNumR);
- CPPUNIT_ASSERT_DOUBLES_EQUAL(179.457, pNumR->GetValue(), 1e-3);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(179.357, pNumR->GetValue(), 1e-3);
const auto* pNumB = dynamic_cast<vcl::filter::PDFNumberElement*>(rElements[3]);
CPPUNIT_ASSERT(pNumB);
CPPUNIT_ASSERT_DOUBLES_EQUAL(674.589, pNumB->GetValue(), 1e-3);
@@ -2510,7 +2510,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf157816)
CPPUNIT_ASSERT_DOUBLES_EQUAL(633.189, pNumT->GetValue(), 1e-3);
const auto* pNumR = dynamic_cast<vcl::filter::PDFNumberElement*>(rElements[2]);
CPPUNIT_ASSERT(pNumR);
- CPPUNIT_ASSERT_DOUBLES_EQUAL(86.807, pNumR->GetValue(), 1e-3);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(86.757, pNumR->GetValue(), 1e-3);
const auto* pNumB = dynamic_cast<vcl::filter::PDFNumberElement*>(rElements[3]);
CPPUNIT_ASSERT(pNumB);
CPPUNIT_ASSERT_DOUBLES_EQUAL(646.989, pNumB->GetValue(), 1e-3);
@@ -2636,7 +2636,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf157816Link)
const auto* pNumR = dynamic_cast<vcl::filter::PDFNumberElement*>(rElements[2]);
CPPUNIT_ASSERT(pNumR);
// this changed to the end of the text, not the start of the fly
- CPPUNIT_ASSERT_DOUBLES_EQUAL(191.707, pNumR->GetValue(), 1e-3);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(191.657, pNumR->GetValue(), 1e-3);
const auto* pNumB = dynamic_cast<vcl::filter::PDFNumberElement*>(rElements[3]);
CPPUNIT_ASSERT(pNumB);
CPPUNIT_ASSERT_DOUBLES_EQUAL(785.189, pNumB->GetValue(), 1e-3);
@@ -2792,7 +2792,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf157816Link)
const auto* pNumR = dynamic_cast<vcl::filter::PDFNumberElement*>(rElements[2]);
CPPUNIT_ASSERT(pNumR);
// this changed to the end of the text, not the start of the fly
- CPPUNIT_ASSERT_DOUBLES_EQUAL(191.707, pNumR->GetValue(), 1e-3);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(191.657, pNumR->GetValue(), 1e-3);
const auto* pNumB = dynamic_cast<vcl::filter::PDFNumberElement*>(rElements[3]);
CPPUNIT_ASSERT(pNumB);
CPPUNIT_ASSERT_DOUBLES_EQUAL(771.389, pNumB->GetValue(), 1e-3);
diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx
index 67d59f9b7242..c9096728442a 100644
--- a/vcl/qa/cppunit/svm/svmtest.cxx
+++ b/vcl/qa/cppunit/svm/svmtest.cxx
@@ -865,8 +865,8 @@ void SvmTest::testTextArray()
GDIMetaFile aGDIMetaFile;
ScopedVclPtrInstance<VirtualDevice> pVirtualDev;
setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile);
- sal_Int32 const aDX[] = { 10, 15, 20, 25, 30, 35 };
- pVirtualDev->DrawTextArray(Point(4,6), u"123456"_ustr, KernArraySpan(aDX), {}, 1, 4);
+ KernArray aDX { 10, 15, 20, 25, 30, 35 };
+ pVirtualDev->DrawTextArray(Point(4,6), u"123456"_ustr, aDX, {}, 1, 4);
checkTextArray(writeAndReadStream(aGDIMetaFile));
checkTextArray(readFile(u"textarray.svm"));
@@ -892,8 +892,8 @@ void SvmTest::testTextArrayWithContext()
GDIMetaFile aGDIMetaFile;
ScopedVclPtrInstance<VirtualDevice> pVirtualDev;
setupBaseVirtualDevice(*pVirtualDev, aGDIMetaFile);
- sal_Int32 const aDX[] = { 10, 15, 20, 25, 30, 35 };
- pVirtualDev->DrawPartialTextArray(Point(4, 6), u"123456"_ustr, KernArraySpan(aDX), {}, 0, 5, 1, 4);
+ KernArray aDX { 10, 15, 20, 25, 30, 35 };
+ pVirtualDev->DrawPartialTextArray(Point(4, 6), u"123456"_ustr, aDX, {}, 0, 5, 1, 4);
checkTextArrayWithContext(writeAndReadStream(aGDIMetaFile));
checkTextArrayWithContext(readFile(u"textarraycontext.svm"));
diff --git a/vcl/qa/cppunit/text.cxx b/vcl/qa/cppunit/text.cxx
index ad7077a32a2a..f417b574fee8 100644
--- a/vcl/qa/cppunit/text.cxx
+++ b/vcl/qa/cppunit/text.cxx
@@ -240,16 +240,16 @@ CPPUNIT_TEST_FIXTURE(VclTextTest, testSimpleTextFontSpecificKerning)
// absolute character widths AKA text array.
tools::Long nRefTextWidth = 2671;
- std::vector<sal_Int32> aRefCharWidths = { 1270, 2671 };
+ KernArray aRefCharWidths{ 1270, 2671 };
KernArray aCharWidths;
tools::Long nTextWidth
= basegfx::fround<tools::Long>(pOutDev->GetTextArray(aAV, &aCharWidths).nWidth);
- CPPUNIT_ASSERT_EQUAL(aRefCharWidths[0], aCharWidths.get_subunit_array()[0]);
- CPPUNIT_ASSERT_EQUAL(aRefCharWidths[1], aCharWidths.get_subunit_array()[1]);
+ CPPUNIT_ASSERT_EQUAL(aRefCharWidths[0], aCharWidths[0]);
+ CPPUNIT_ASSERT_EQUAL(aRefCharWidths[1], aCharWidths[1]);
// this sporadically returns 75 or 74 on some of the windows tinderboxes eg. tb73
CPPUNIT_ASSERT_EQUAL(nRefTextWidth, nTextWidth);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(nTextWidth), aCharWidths.back());
+ CPPUNIT_ASSERT_EQUAL(nTextWidth, tools::Long(aCharWidths.back()));
// text advance width and line height
CPPUNIT_ASSERT_EQUAL(nRefTextWidth, pOutDev->GetTextWidth(aAV));
@@ -290,16 +290,16 @@ CPPUNIT_TEST_FIXTURE(VclTextTest, testSimpleTextNoKerning)
// absolute character widths AKA text array.
tools::Long nRefTextWidth = 2802;
- std::vector<sal_Int32> aRefCharWidths = { 1401, 2802 };
+ KernArray aRefCharWidths{ 1401, 2802 };
KernArray aCharWidths;
tools::Long nTextWidth
= basegfx::fround<tools::Long>(pOutDev->GetTextArray(aAV, &aCharWidths).nWidth);
- CPPUNIT_ASSERT_EQUAL(aRefCharWidths[0], aCharWidths.get_subunit_array()[0]);
- CPPUNIT_ASSERT_EQUAL(aRefCharWidths[1], aCharWidths.get_subunit_array()[1]);
+ CPPUNIT_ASSERT_EQUAL(aRefCharWidths[0], aCharWidths[0]);
+ CPPUNIT_ASSERT_EQUAL(aRefCharWidths[1], aCharWidths[1]);
// this sporadically returns 75 or 74 on some of the windows tinderboxes eg. tb73
CPPUNIT_ASSERT_EQUAL(nRefTextWidth, nTextWidth);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(nTextWidth), aCharWidths.back());
+ CPPUNIT_ASSERT_EQUAL(nTextWidth, tools::Long(aCharWidths.back()));
// text advance width and line height
CPPUNIT_ASSERT_EQUAL(nRefTextWidth, pOutDev->GetTextWidth(aAV));