summaryrefslogtreecommitdiff
path: root/editeng/inc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-10-30 09:51:26 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-10-31 12:10:52 +0100
commit11b15571475414ef853e21a6c96afa2ac81f848f (patch)
treee32da625489c121001e8436fb693b2a25a1e1b6e /editeng/inc
parentef085d09e0c019f78a3d35f759c8fe567856b615 (diff)
convert KernArray from sal_Int32 to double
which allows us to eliminate a bunch of rounding at various layers, and consequently maintain a lot more precision Change-Id: I911dedd7c041c1d67396c082e5695346ea689acb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175814 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng/inc')
-rw-r--r--editeng/inc/EditLine.hxx10
-rw-r--r--editeng/inc/TextPortion.hxx6
-rw-r--r--editeng/inc/outleeng.hxx2
3 files changed, 8 insertions, 10 deletions
diff --git a/editeng/inc/EditLine.hxx b/editeng/inc/EditLine.hxx
index 46a2379853e6..38625bc246da 100644
--- a/editeng/inc/EditLine.hxx
+++ b/editeng/inc/EditLine.hxx
@@ -22,16 +22,14 @@
#include <vector>
#include <sal/types.h>
#include <tools/gen.hxx>
+#include <vcl/kernarray.hxx>
class ParaPortion;
class EditLine
{
-public:
- typedef std::vector<sal_Int32> CharPosArrayType;
-
private:
- CharPosArrayType maPositions;
+ KernArray maPositions;
std::vector<sal_Bool> maKashidaPositions;
sal_Int32 mnTextWidth = 0;
sal_Int32 mnStartPosX = 0;
@@ -111,8 +109,8 @@ public:
bool IsEmpty() const { return mnEnd <= mnStart; }
- CharPosArrayType& GetCharPosArray() { return maPositions; }
- const CharPosArrayType& GetCharPosArray() const { return maPositions; }
+ KernArray& GetCharPosArray() { return maPositions; }
+ const KernArray& GetCharPosArray() const { return maPositions; }
std::vector<sal_Bool>& GetKashidaArray() { return maKashidaPositions; }
const std::vector<sal_Bool>& GetKashidaArray() const { return maKashidaPositions; }
diff --git a/editeng/inc/TextPortion.hxx b/editeng/inc/TextPortion.hxx
index e5560f260326..5458eaa9cf23 100644
--- a/editeng/inc/TextPortion.hxx
+++ b/editeng/inc/TextPortion.hxx
@@ -71,14 +71,14 @@ struct ExtraPortionInfo
bool bFirstCharIsRightPunktuation = false;
bool bCompressed = false;
- std::unique_ptr<sal_Int32[]> pOrgDXArray;
+ std::unique_ptr<double[]> pOrgDXArray;
std::vector<sal_Int32> lineBreaksList;
- void SaveOrgDXArray(const sal_Int32* pDXArray, sal_Int32 nLen)
+ void SaveOrgDXArray(const double* pDXArray, sal_Int32 nLen)
{
if (pDXArray)
{
- pOrgDXArray.reset(new sal_Int32[nLen]);
+ pOrgDXArray.reset(new double[nLen]);
memcpy(pOrgDXArray.get(), pDXArray, nLen * sizeof(sal_Int32));
}
else
diff --git a/editeng/inc/outleeng.hxx b/editeng/inc/outleeng.hxx
index c40837dc5f8f..56f7aa62485e 100644
--- a/editeng/inc/outleeng.hxx
+++ b/editeng/inc/outleeng.hxx
@@ -46,7 +46,7 @@ public:
virtual void ParagraphConnected( sal_Int32 nLeftParagraph, sal_Int32 nRightParagraph ) override;
virtual void DrawingText( const Point& rStartPos, const OUString& rText, sal_Int32 nTextStart,
- sal_Int32 nTextLen, std::span<const sal_Int32> pDXArray,
+ sal_Int32 nTextLen, KernArraySpan pDXArray,
std::span<const sal_Bool> pKashidaArray, const SvxFont& rFont,
sal_Int32 nPara, sal_uInt8 nRightToLeft,
const EEngineData::WrongSpellVector* pWrongSpellVector,