summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-04-24 16:38:26 +0100
committerMichael Stahl <michael.stahl@cib.de>2020-04-29 10:15:17 +0200
commit994526fadb3faeb57c47cf1060a2ad7d53bd4f94 (patch)
tree8a8e665878fec7f5608d5ec2e7f64a2ba5f3876b /editeng
parent68f75fe0701fcf9b92c5f1b5fd5eeb9268297494 (diff)
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>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/inc/editdoc.hxx3
-rw-r--r--editeng/source/editeng/editdoc.cxx12
-rw-r--r--editeng/source/editeng/editeng.cxx4
3 files changed, 18 insertions, 1 deletions
diff --git a/editeng/inc/editdoc.hxx b/editeng/inc/editdoc.hxx
index 2924a0e20c45..2e808e192c8e 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 6fb8c3cfe181..82cb0e7a0c29 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -1907,7 +1907,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
};
@@ -2355,6 +2356,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 ac9fdd5202ce..2b600871c27d 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -2809,6 +2809,10 @@ bool EditEngine::IsPageOverflow() {
return pImpEditEngine->IsPageOverflow();
}
+void EditEngine::DisableAttributeExpanding() {
+ pImpEditEngine->GetEditDoc().DisableAttributeExpanding();
+}
+
EFieldInfo::EFieldInfo()
{
}