summaryrefslogtreecommitdiffstats
path: root/drawinglayer/source/primitive2d/textlayoutdevice.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'drawinglayer/source/primitive2d/textlayoutdevice.cxx')
-rw-r--r--drawinglayer/source/primitive2d/textlayoutdevice.cxx48
1 files changed, 13 insertions, 35 deletions
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index 60370e722941..1c551ce01363 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>
@@ -215,8 +216,8 @@ double TextLayouterDevice::getTextWidth(const OUString& rText, sal_uInt32 nIndex
void TextLayouterDevice::getTextOutlines(basegfx::B2DPolyPolygonVector& rB2DPolyPolyVector,
const OUString& rText, sal_uInt32 nIndex,
- sal_uInt32 nLength,
- const std::vector<double>& rDXArray) const
+ sal_uInt32 nLength, const std::vector<double>& rDXArray,
+ const std::vector<sal_Bool>& rKashidaArray) const
{
const sal_uInt32 nDXArrayCount(rDXArray.size());
sal_uInt32 nTextLength(nLength);
@@ -231,15 +232,14 @@ 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);
+ aIntegerDXArray, rKashidaArray);
}
else
{
@@ -294,30 +294,7 @@ void TextLayouterDevice::addTextRectActions(const ::tools::Rectangle& rRectangle
}
std::vector<double> TextLayouterDevice::getTextArray(const OUString& rText, sal_uInt32 nIndex,
- sal_uInt32 nLength) const
-{
- std::vector<double> aRetval;
- sal_uInt32 nTextLength(nLength);
- const sal_uInt32 nStringLength(rText.getLength());
-
- if (nTextLength + nIndex > nStringLength)
- {
- nTextLength = nStringLength - nIndex;
- }
-
- if (nTextLength)
- {
- aRetval.reserve(nTextLength);
- std::vector<sal_Int32> aArray(nTextLength);
- mrDevice.GetTextArray(rText, &aArray, nIndex, nLength);
- aRetval.assign(aArray.begin(), aArray.end());
- }
-
- return aRetval;
-}
-
-std::vector<double> TextLayouterDevice::getCaretPositions(const OUString& rText, sal_uInt32 nIndex,
- sal_uInt32 nLength) const
+ sal_uInt32 nLength, bool bCaret) const
{
std::vector<double> aRetval;
sal_uInt32 nTextLength(nLength);
@@ -330,10 +307,11 @@ std::vector<double> TextLayouterDevice::getCaretPositions(const OUString& rText,
if (nTextLength)
{
- aRetval.reserve(2 * nTextLength);
- std::vector<sal_Int32> aArray(2 * nTextLength);
- mrDevice.GetCaretPositions(rText, aArray.data(), nIndex, nLength);
- aRetval.assign(aArray.begin(), aArray.end());
+ KernArray aArray;
+ mrDevice.GetTextArray(rText, &aArray, nIndex, nTextLength, bCaret);
+ aRetval.reserve(aArray.size());
+ for (size_t i = 0, nEnd = aArray.size(); i < nEnd; ++i)
+ aRetval.push_back(aArray[i]);
}
return aRetval;