diff options
author | Mark Hung <marklh9@gmail.com> | 2017-12-31 21:04:59 +0800 |
---|---|---|
committer | Mark Hung <marklh9@gmail.com> | 2018-01-09 13:18:41 +0100 |
commit | 7d10477aa54536aeeb190d25979234ab732c1bcf (patch) | |
tree | b97174f7f971ea5a092df373f1c75e0452ce17e2 /editeng/source/editeng/impedit2.cxx | |
parent | 1c1653e4d6520aa8fbe5d3dc8a94cfb9330916cf (diff) |
tdf#99524 - allow backward connect paragraph to undo.
When pressing backspace, two paragaphs connected. The first paragraph
get the style of the second paragraph. However the ParaAttribsChanged()
doesn't update Outliner's nDepth because it is not in undo. So it create
incorrect undo information when user press enter later.
And during undo, the nDepth isn't updated because there is a check
to compare the number of paragraphs, so SetParaAttribs needs to be
called after ParagraphInserted.
Change-Id: I6a860514042240035cde95d64bdd1f374e05a94e
Reviewed-on: https://gerrit.libreoffice.org/47226
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mark Hung <marklh9@gmail.com>
Diffstat (limited to 'editeng/source/editeng/impedit2.cxx')
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 8f2336c21b3b..f837b2a57cac 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -731,7 +731,7 @@ void ImpEditEngine::TextModified() } -void ImpEditEngine::ParaAttribsChanged( ContentNode const * pNode ) +void ImpEditEngine::ParaAttribsChanged( ContentNode const * pNode, bool bIgnoreUndoCheck ) { assert(pNode && "ParaAttribsChanged: Which one?"); @@ -743,7 +743,8 @@ void ImpEditEngine::ParaAttribsChanged( ContentNode const * pNode ) pPortion->MarkSelectionInvalid( 0 ); sal_Int32 nPara = aEditDoc.GetPos( pNode ); - pEditEngine->ParaAttribsChanged( nPara ); + if ( bIgnoreUndoCheck || pEditEngine->IsInUndo() ) + pEditEngine->ParaAttribsChanged( nPara ); ParaPortion* pNextPortion = GetParaPortions().SafeGetObject( nPara+1 ); // => is formatted again anyway, if Invalid. @@ -2261,7 +2262,7 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pR pLeft->GetCharAttribs().GetDefFont() = pRight->GetCharAttribs().GetDefFont(); } - ParaAttribsChanged( pLeft ); + ParaAttribsChanged( pLeft, true ); // First search for Portions since pRight is gone after ConnectParagraphs. ParaPortion* pLeftPortion = FindParaPortion( pLeft ); |