diff options
author | Mark Hung <marklh9@gmail.com> | 2020-10-19 00:07:34 +0800 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-10-26 10:25:45 +0100 |
commit | a419deb3279e9d3571ac55fa77c1b162f4eaabea (patch) | |
tree | e60964d6b9e5de1037c45d24eaa813955b8172d3 /include | |
parent | Update git submodules (diff) | |
download | core-a419deb3279e9d3571ac55fa77c1b162f4eaabea.tar.gz core-a419deb3279e9d3571ac55fa77c1b162f4eaabea.zip |
tdf#104378: don't reset para attributes while
converting Chinese characters.
In TextConvWrapper::ChangeText_impl, calls to
EditView::RemoveAttribs() reset the paragraph attributes.
That makes SvxLanguageItem of EE_CHAR_LANGUAGE_CJK become
LANGUAGE_DONTKNOW. Hence it always stops converting after the
first success.
This patch overload EditView::RemoveAttribs() so that it is
possible to clear all character attributes of the selction
without touching paragraph attributes.
Before, bRemoveParaAttribs either removes items between
EE_ITEMS_START and EE_CHAR_END, or removes items between
EE_CHAR_START and EE_CHAR_END. The patch add a new enum
class EERemoveParaAttribsMode, with the following values:
1. RemoveAll : correspond to the old bRemoveParaAttribs = true
2. RemoveCharItems: correspond to the old bRemoveParaAttribs = false
3. RemoveNone: new thing for "don't touch para attributes."
Change-Id: I5132e708dea9e2066f13f1b001bd954d7b477f56
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104484
Tested-by: Jenkins
Reviewed-by: Mark Hung <marklh9@gmail.com>
(cherry picked from commit 5b74b3322fd51cf075eb0c218b3adb786a28b4c9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104680
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/editeng/editdata.hxx | 2 | ||||
-rw-r--r-- | include/editeng/editeng.hxx | 1 | ||||
-rw-r--r-- | include/editeng/editview.hxx | 1 |
3 files changed, 4 insertions, 0 deletions
diff --git a/include/editeng/editdata.hxx b/include/editeng/editdata.hxx index 8d3d39591a42..40c74cb2b8c6 100644 --- a/include/editeng/editdata.hxx +++ b/include/editeng/editdata.hxx @@ -42,6 +42,8 @@ enum class EEAnchorMode { VCenterLeft, VCenterHCenter, VCenterRight, BottomLeft, BottomHCenter, BottomRight }; +enum class EERemoveParaAttribsMode { RemoveAll, RemoveCharItems, RemoveNone }; + #define EE_PARA_NOT_FOUND SAL_MAX_INT32 #define EE_PARA_APPEND SAL_MAX_INT32 #define EE_PARA_ALL SAL_MAX_INT32 diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx index 292b620a9b95..46f5ccf520cc 100644 --- a/include/editeng/editeng.hxx +++ b/include/editeng/editeng.hxx @@ -609,6 +609,7 @@ public: void RemoveCharAttribs(sal_Int32 nPara, sal_uInt16 nWhich = 0, bool bRemoveFeatures = false); void RemoveCharAttribs(const EditSelection& rSel, bool bRemoveParaAttribs, sal_uInt16 nWhich); + void RemoveCharAttribs(const EditSelection& rSel, EERemoveParaAttribsMode eMode, sal_uInt16 nWhich); ViewsType& GetEditViews(); const ViewsType& GetEditViews() const; diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx index c750dcef9254..bf6374ca3ce8 100644 --- a/include/editeng/editview.hxx +++ b/include/editeng/editview.hxx @@ -234,6 +234,7 @@ public: SfxItemSet GetAttribs(); void SetAttribs( const SfxItemSet& rSet ); void RemoveAttribs( bool bRemoveParaAttribs = false, sal_uInt16 nWhich = 0 ); + void RemoveAttribs( EERemoveParaAttribsMode eMode, sal_uInt16 nWhich ); void RemoveCharAttribs( sal_Int32 nPara, sal_uInt16 nWhich ); void RemoveAttribsKeepLanguages( bool bRemoveParaAttribs ); |