diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-04-24 16:38:26 +0100 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2021-04-09 23:22:04 +0200 |
commit | 5c3ba21bc017d61645de8eb9cc0d53ac984a644b (patch) | |
tree | 7994c5371b2c8202deb4c87b1532800c31adc40e /editeng | |
parent | Release 6.3.6.7 (diff) | |
download | core-5c3ba21bc017d61645de8eb9cc0d53ac984a644b.tar.gz core-5c3ba21bc017d61645de8eb9cc0d53ac984a644b.zip |
Resolves: tdf#132288 don't merge adjacent properties for spell checking
spell checking relies on each attribute chunk being unmerged with identical
adjacent chunks
squash includes...
nStartPosition and nEndPosition are always the same
and
tdf#132288 preservation of footnote depends on reverse iteration
like TextCharAttribList::FindAttrib does which spell checking
used before
commit 243b5b392906042ab03800e0b5765e6f3513372c
Author: Caolán McNamara <caolanm@redhat.com>
Date: Fri Jun 14 21:56:44 2019 +0100
weld SpellDialog
converted to use an EditEngine instead of a TextEngine in order to
be able to host it in a native widget
Change-Id: Ia835fa054cad0dee4304f16724b9eb0c29b46102
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92772
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
(cherry picked from commit 994526fadb3faeb57c47cf1060a2ad7d53bd4f94)
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/inc/editdoc.hxx | 3 | ||||
-rw-r--r-- | editeng/source/editeng/editdoc.cxx | 12 | ||||
-rw-r--r-- | editeng/source/editeng/editeng.cxx | 4 |
3 files changed, 18 insertions, 1 deletions
diff --git a/editeng/inc/editdoc.hxx b/editeng/inc/editdoc.hxx index 089addc59c07..258fa945912c 100644 --- a/editeng/inc/editdoc.hxx +++ b/editeng/inc/editdoc.hxx @@ -747,6 +747,7 @@ private: bool bOwnerOfPool:1; bool bModified:1; + bool bDisableAttributeExpanding:1; private: void ImplDestroyContents(); @@ -761,6 +762,8 @@ public: bool IsModified() const { return bModified; } void SetModified( bool b ); + void DisableAttributeExpanding() { bDisableAttributeExpanding = true; } + void SetModifyHdl( const Link<LinkParamNone*,void>& rLink ) { aModifyHdl = rLink; } void CreateDefFont( bool bUseStyles ); diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index 73a356054741..aacc0b2c7b6b 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -1906,7 +1906,8 @@ EditDoc::EditDoc( SfxItemPool* pPool ) : bIsTopToBottomVert(false), bIsFixedCellHeight(false), bOwnerOfPool(pPool == nullptr), - bModified(false) + bModified(false), + bDisableAttributeExpanding(false) { // Don't create an empty node, Clear() will be called in EditEngine-CTOR }; @@ -2354,6 +2355,15 @@ void EditDoc::InsertAttribInSelection( ContentNode* pNode, sal_Int32 nStart, sal RemoveAttribs( pNode, nStart, nEnd, pStartingAttrib, pEndingAttrib, rPoolItem.Which() ); + // tdf#132288 By default inserting an attribute beside another that is of + // the same type expands the original instead of inserting another. But the + // spell check dialog doesn't want that behaviour + if (bDisableAttributeExpanding) + { + pStartingAttrib = nullptr; + pEndingAttrib = nullptr; + } + if ( pStartingAttrib && pEndingAttrib && ( *(pStartingAttrib->GetItem()) == rPoolItem ) && ( *(pEndingAttrib->GetItem()) == rPoolItem ) ) diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 458f71b34d3f..f46106a5773c 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -2802,6 +2802,10 @@ bool EditEngine::IsPageOverflow() { return pImpEditEngine->IsPageOverflow(); } +void EditEngine::DisableAttributeExpanding() { + pImpEditEngine->GetEditDoc().DisableAttributeExpanding(); +} + EFieldInfo::EFieldInfo() { } |