diff options
author | Khaled Hosny <khaled@aliftype.com> | 2022-12-15 22:51:54 +0200 |
---|---|---|
committer | خالد حسني <khaled@aliftype.com> | 2022-12-16 06:04:25 +0000 |
commit | bfecacb2487ba9470600e6f64056d9b1816ee96b (patch) | |
tree | b4bb57afef9d84af552a7df79798820cc0d2e442 /svx/inc | |
parent | ba8eb90925aa31be4029b5486a6f5dcd2e9573fd (diff) |
tdf#152460: Improve script handling in style previews
Use Edit Engine to get the script types instead of trying to duplicate
(poorly) its behaviour. This has the advantage of handling weak
characters and digits properly and is closer to what would happen in the
document itself.
We probably should go further and render the preview entirely using Edit
Engine (since the current code fails short of proper bidi handling), but
this is a bigger change.
Change-Id: I79b28067d80f66087e1d5e9399ba1a513de96c8a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144283
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@aliftype.com>
Diffstat (limited to 'svx/inc')
-rw-r--r-- | svx/inc/CommonStylePreviewRenderer.hxx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/svx/inc/CommonStylePreviewRenderer.hxx b/svx/inc/CommonStylePreviewRenderer.hxx index cb0563be15c4..0e99421b4bfe 100644 --- a/svx/inc/CommonStylePreviewRenderer.hxx +++ b/svx/inc/CommonStylePreviewRenderer.hxx @@ -12,6 +12,7 @@ #include <optional> #include <vector> +#include <editeng/editeng.hxx> #include <editeng/svxfont.hxx> #include <sfx2/objsh.hxx> #include <sfx2/StylePreviewRenderer.hxx> @@ -19,9 +20,6 @@ #include <tools/color.hxx> #include <tools/gen.hxx> -#include <com/sun/star/uno/Reference.h> -#include <com/sun/star/i18n/BreakIterator.hpp> - class OutputDevice; class SfxStyleSheetBase; @@ -41,13 +39,12 @@ class CommonStylePreviewRenderer final : public sfx2::StylePreviewRenderer tools::Long mnBaseLine; OUString maStyleName; OUString maScriptText; - css::uno::Reference<css::i18n::XBreakIterator> mxBreak; struct ScriptInfo { tools::Long textWidth; - sal_uInt16 scriptType; + SvtScriptType scriptType; sal_Int32 changePos; - ScriptInfo(sal_uInt16 scrptType, sal_Int32 position) + ScriptInfo(SvtScriptType scrptType, sal_Int32 position) : textWidth(0) , scriptType(scrptType) , changePos(position) |