summaryrefslogtreecommitdiff
path: root/cppcanvas
diff options
context:
space:
mode:
authorKhaled Hosny <khaled@libreoffice.org>2023-06-18 17:35:32 +0300
committerخالد حسني <khaled@libreoffice.org>2023-06-18 22:01:53 +0200
commit68a4f005bc3e74d847e82dddf3237137cf3a1648 (patch)
tree3712971edf90e5fb753369a6874093a9e90c73d7 /cppcanvas
parent94bf26798bb973c7df26e2aa841099bb9cbaf3cb (diff)
tdf#155810: Pass Kashida insertion positions through canvas
This was missed in: commit 3901e029bd39575f700e69a73818565d62226a23 Author: Khaled Hosny <khaled@aliftype.com> Date: Mon Aug 8 22:08:37 2022 +0200 tdf#104921: Cleanup Kashida insertion logic The width adjustment passed through, but Kashida insertion positions didn’t, leaving gaps in place of Kashidas when canvas is used (apparently canvas is only used for slideshow). Change-Id: I25ff30f10cc46a5c87bda2f3936df26b2fc926b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153234 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
Diffstat (limited to 'cppcanvas')
-rw-r--r--cppcanvas/source/inc/implrenderer.hxx1
-rw-r--r--cppcanvas/source/mtfrenderer/implrenderer.cxx6
-rw-r--r--cppcanvas/source/mtfrenderer/textaction.cxx29
-rw-r--r--cppcanvas/source/mtfrenderer/textaction.hxx1
4 files changed, 36 insertions, 1 deletions
diff --git a/cppcanvas/source/inc/implrenderer.hxx b/cppcanvas/source/inc/implrenderer.hxx
index edf4fcf9efba..1cd4fd91d72e 100644
--- a/cppcanvas/source/inc/implrenderer.hxx
+++ b/cppcanvas/source/inc/implrenderer.hxx
@@ -195,6 +195,7 @@ namespace cppcanvas::internal
int nIndex,
int nLength,
KernArraySpan pCharWidths,
+ o3tl::span<const sal_Bool> pKashidaArray,
const ActionFactoryParameters& rParms,
bool bSubsettable );
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 10ccaf1ccdbb..958faf8f8378 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -847,6 +847,7 @@ namespace cppcanvas::internal
int nIndex,
int nLength,
KernArraySpan pCharWidths,
+ o3tl::span<const sal_Bool> pKashidaArray,
const ActionFactoryParameters& rParms,
bool bSubsettableActions )
{
@@ -943,6 +944,7 @@ namespace cppcanvas::internal
nIndex,
nLength,
pCharWidths,
+ pKashidaArray,
rParms.mrVDev,
rParms.mrCanvas,
rState,
@@ -1008,6 +1010,7 @@ namespace cppcanvas::internal
0/*nStartPos*/,
nLen,
aStrikeoutCharWidths,
+ pKashidaArray,
rParms.mrVDev,
rParms.mrCanvas,
rState,
@@ -2450,6 +2453,7 @@ namespace cppcanvas::internal
pAct->GetIndex(),
nLen,
{},
+ {},
rFactoryParms,
bSubsettableActions );
}
@@ -2471,6 +2475,7 @@ namespace cppcanvas::internal
pAct->GetIndex(),
nLen,
pAct->GetDXArray(),
+ pAct->GetKashidaArray(),
rFactoryParms,
bSubsettableActions );
}
@@ -2578,6 +2583,7 @@ namespace cppcanvas::internal
pAct->GetIndex(),
nLen,
aDXArray,
+ {},
rFactoryParms,
bSubsettableActions );
}
diff --git a/cppcanvas/source/mtfrenderer/textaction.cxx b/cppcanvas/source/mtfrenderer/textaction.cxx
index 4b945c2f2ce3..fb75f661fcad 100644
--- a/cppcanvas/source/mtfrenderer/textaction.cxx
+++ b/cppcanvas/source/mtfrenderer/textaction.cxx
@@ -229,6 +229,7 @@ namespace cppcanvas::internal
sal_Int32 nStartPos,
sal_Int32 nLen,
const uno::Sequence< double >& rOffsets,
+ const uno::Sequence< sal_Bool >& rKashidas,
const CanvasSharedPtr& rCanvas,
const OutDevState& rState,
const ::basegfx::B2DHomMatrix* pTextTransform )
@@ -255,6 +256,7 @@ namespace cppcanvas::internal
"::cppcanvas::internal::initArrayAction(): Invalid font" );
o_rTextLayout->applyLogicalAdvancements( rOffsets );
+ o_rTextLayout->applyKashidaPositions( rKashidas );
}
@@ -457,6 +459,10 @@ namespace cppcanvas::internal
io_rTextLayout,
nLayoutWidth,
rSubset ) );
+ uno::Sequence< sal_Bool > aOrigKashidaPositions(io_rTextLayout->queryKashidaPositions());
+ uno::Sequence< sal_Bool > aKashidaPositions(aOrigKashidaPositions.getArray() + rSubset.mnSubsetBegin,
+ rSubset.mnSubsetEnd - rSubset.mnSubsetBegin);
+ xTextLayout->applyKashidaPositions(aKashidaPositions);
}
io_rTextLayout = xTextLayout;
@@ -1017,6 +1023,7 @@ namespace cppcanvas::internal
sal_Int32 nStartPos,
sal_Int32 nLen,
const uno::Sequence< double >& rOffsets,
+ const uno::Sequence< sal_Bool >& rKashidas,
const CanvasSharedPtr& rCanvas,
const OutDevState& rState );
@@ -1025,6 +1032,7 @@ namespace cppcanvas::internal
sal_Int32 nStartPos,
sal_Int32 nLen,
const uno::Sequence< double >& rOffsets,
+ const uno::Sequence< sal_Bool >& rKashidas,
const CanvasSharedPtr& rCanvas,
const OutDevState& rState,
const ::basegfx::B2DHomMatrix& rTextTransform );
@@ -1061,6 +1069,7 @@ namespace cppcanvas::internal
sal_Int32 nStartPos,
sal_Int32 nLen,
const uno::Sequence< double >& rOffsets,
+ const uno::Sequence< sal_Bool >& rKashidas,
const CanvasSharedPtr& rCanvas,
const OutDevState& rState ) :
mpCanvas( rCanvas )
@@ -1074,6 +1083,7 @@ namespace cppcanvas::internal
nStartPos,
nLen,
rOffsets,
+ rKashidas,
rCanvas,
rState, nullptr );
}
@@ -1083,6 +1093,7 @@ namespace cppcanvas::internal
sal_Int32 nStartPos,
sal_Int32 nLen,
const uno::Sequence< double >& rOffsets,
+ const uno::Sequence< sal_Bool >& rKashidas,
const CanvasSharedPtr& rCanvas,
const OutDevState& rState,
const ::basegfx::B2DHomMatrix& rTextTransform ) :
@@ -1097,6 +1108,7 @@ namespace cppcanvas::internal
nStartPos,
nLen,
rOffsets,
+ rKashidas,
rCanvas,
rState,
&rTextTransform );
@@ -1206,6 +1218,7 @@ namespace cppcanvas::internal
sal_Int32 nStartPos,
sal_Int32 nLen,
const uno::Sequence< double >& rOffsets,
+ const uno::Sequence< sal_Bool >& rKashidas,
VirtualDevice const & rVDev,
const CanvasSharedPtr& rCanvas,
const OutDevState& rState );
@@ -1219,6 +1232,7 @@ namespace cppcanvas::internal
sal_Int32 nStartPos,
sal_Int32 nLen,
const uno::Sequence< double >& rOffsets,
+ const uno::Sequence< sal_Bool >& rKashidas,
VirtualDevice const & rVDev,
const CanvasSharedPtr& rCanvas,
const OutDevState& rState,
@@ -1273,6 +1287,7 @@ namespace cppcanvas::internal
sal_Int32 nStartPos,
sal_Int32 nLen,
const uno::Sequence< double >& rOffsets,
+ const uno::Sequence< sal_Bool >& rKashidas,
VirtualDevice const & rVDev,
const CanvasSharedPtr& rCanvas,
const OutDevState& rState ) :
@@ -1296,6 +1311,7 @@ namespace cppcanvas::internal
nStartPos,
nLen,
rOffsets,
+ rKashidas,
rCanvas,
rState, nullptr );
}
@@ -1310,6 +1326,7 @@ namespace cppcanvas::internal
sal_Int32 nStartPos,
sal_Int32 nLen,
const uno::Sequence< double >& rOffsets,
+ const uno::Sequence< sal_Bool >& rKashidas,
VirtualDevice const & rVDev,
const CanvasSharedPtr& rCanvas,
const OutDevState& rState,
@@ -1334,6 +1351,7 @@ namespace cppcanvas::internal
nStartPos,
nLen,
rOffsets,
+ rKashidas,
rCanvas,
rState,
&rTextTransform );
@@ -1967,6 +1985,7 @@ namespace cppcanvas::internal
sal_Int32 nStartPos,
sal_Int32 nLen,
KernArraySpan pDXArray,
+ o3tl::span<const sal_Bool> pKashidaArray,
VirtualDevice& rVDev,
const CanvasSharedPtr& rCanvas,
const OutDevState& rState,
@@ -1994,7 +2013,7 @@ namespace cppcanvas::internal
static_cast<sal_uInt16>(nStartPos),
static_cast<sal_uInt16>(nStartPos),
static_cast<sal_uInt16>(nLen),
- 0, pDXArray ) );
+ 0, pDXArray, pKashidaArray ) );
rVDev.SetFont(aOrigFont);
if( !bHaveOutlines )
@@ -2097,6 +2116,7 @@ namespace cppcanvas::internal
sal_Int32 nStartPos,
sal_Int32 nLen,
KernArraySpan pDXArray,
+ o3tl::span<const sal_Bool> pKashidaArray,
VirtualDevice& rVDev,
const CanvasSharedPtr& rCanvas,
const OutDevState& rState,
@@ -2129,6 +2149,7 @@ namespace cppcanvas::internal
nStartPos,
nLen,
pDXArray,
+ pKashidaArray,
rVDev,
rCanvas,
rState,
@@ -2146,6 +2167,8 @@ namespace cppcanvas::internal
rVDev,
rState ));
+ const uno::Sequence< sal_Bool > aKashidas(pKashidaArray.data(), pKashidaArray.size());
+
// determine type of text action to create
// =======================================
@@ -2240,6 +2263,7 @@ namespace cppcanvas::internal
nStartPos,
nLen,
aCharWidths,
+ aKashidas,
rCanvas,
rState,
*rParms.maTextTransformation );
@@ -2250,6 +2274,7 @@ namespace cppcanvas::internal
nStartPos,
nLen,
aCharWidths,
+ aKashidas,
rCanvas,
rState );
}
@@ -2268,6 +2293,7 @@ namespace cppcanvas::internal
nStartPos,
nLen,
aCharWidths,
+ aKashidas,
rVDev,
rCanvas,
rState,
@@ -2284,6 +2310,7 @@ namespace cppcanvas::internal
nStartPos,
nLen,
aCharWidths,
+ aKashidas,
rVDev,
rCanvas,
rState );
diff --git a/cppcanvas/source/mtfrenderer/textaction.hxx b/cppcanvas/source/mtfrenderer/textaction.hxx
index 66d08ca8cfa2..bc399f0f8502 100644
--- a/cppcanvas/source/mtfrenderer/textaction.hxx
+++ b/cppcanvas/source/mtfrenderer/textaction.hxx
@@ -69,6 +69,7 @@ namespace cppcanvas::internal
sal_Int32 nStartPos,
sal_Int32 nLen,
KernArraySpan pDXArray,
+ o3tl::span<const sal_Bool> pKashidaArray,
VirtualDevice& rVDev,
const CanvasSharedPtr& rCanvas,
const OutDevState& rState,