summaryrefslogtreecommitdiff
path: root/svx/source/styles
diff options
context:
space:
mode:
authorKhaled Hosny <khaled@aliftype.com>2022-12-30 18:56:41 +0200
committerخالد حسني <khaled@aliftype.com>2022-12-30 18:35:22 +0000
commit95f0dc2dc74401a097105fcfe745aba3e571d9c4 (patch)
treefab8d92816ebc936a8ad45c909b6067bacd88476 /svx/source/styles
parenta838f92bb4b1bdc84f49c61f669b1f32ee1f83c3 (diff)
tdf#152737: Fix off-by-one errors
Regressions from: commit 718af940435ae9d2ac90374e5880ecb38e96252c Author: Khaled Hosny <khaled@aliftype.com> Date: Fri Dec 16 00:10:34 2022 +0200 tdf#152533: Improve script handling in font preview and: commit bfecacb2487ba9470600e6f64056d9b1816ee96b Author: Khaled Hosny <khaled@aliftype.com> Date: Thu Dec 15 22:51:54 2022 +0200 tdf#152460: Improve script handling in style previews Change-Id: I7b12f5accbd65459d724676efb7bec947a7faaa0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144880 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@aliftype.com>
Diffstat (limited to 'svx/source/styles')
-rw-r--r--svx/source/styles/CommonStylePreviewRenderer.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/svx/source/styles/CommonStylePreviewRenderer.cxx b/svx/source/styles/CommonStylePreviewRenderer.cxx
index 9ddf3cf15017..0ca34abe9a36 100644
--- a/svx/source/styles/CommonStylePreviewRenderer.cxx
+++ b/svx/source/styles/CommonStylePreviewRenderer.cxx
@@ -418,7 +418,9 @@ void CommonStylePreviewRenderer::CheckScript()
for (sal_Int32 i = 1; i <= maScriptText.getLength(); i++)
{
auto aNextScript = aEditEngine.GetScriptType({ 0, i, 0, i });
- if (aNextScript != aScript || i == maScriptText.getLength())
+ if (aNextScript != aScript)
+ maScriptChanges.emplace_back(aScript, i - 1);
+ else if (i == maScriptText.getLength())
maScriptChanges.emplace_back(aScript, i);
aScript = aNextScript;
}