summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--svx/source/dialog/fntctrl.cxx4
-rw-r--r--svx/source/styles/CommonStylePreviewRenderer.cxx4
2 files changed, 6 insertions, 2 deletions
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index 0712bbe92496..de39993061fd 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -250,7 +250,9 @@ void FontPrevWin_Impl::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;
}
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;
}