diff options
author | Mark Hung <marklh9@gmail.com> | 2017-12-30 01:00:26 +0800 |
---|---|---|
committer | Mark Hung <marklh9@gmail.com> | 2018-01-04 12:23:55 +0100 |
commit | a16b44481e3c5582dfb581f769e07ab94e8ac44b (patch) | |
tree | 1dadc7aeab6351535f392d87fc0a3303abf7dccf /editeng | |
parent | 334601603aa04ea968e8a850f4e7f6cf52f7735b (diff) |
tdf#114732 backspace can only make bullet invisible.
It toggled the bullet on unexptectedly before connecting
two paragraphs, which made undo recover the incorrect result.
Change-Id: I83104d72fef95d8bd95e8e0e3bca4a063b69a450
Reviewed-on: https://gerrit.libreoffice.org/47181
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mark Hung <marklh9@gmail.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editeng.cxx | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 2a3ccb3d52bb..c896e9aeb2f7 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -1121,28 +1121,29 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v if (pFmt && nCode == KEY_BACKSPACE && !aCurSel.HasRange() && aCurSel.Min().GetIndex() == 0) { - // if the bullet is still visible just do not paint it from - // now on and that will be all. Otherwise continue as usual. + // if the bullet is still visible, just make it invisible. + // Otherwise continue as usual. sal_Int32 nPara = pImpEditEngine->GetEditDoc().GetPos( pNode ); SfxBoolItem aBulletState( pImpEditEngine->GetParaAttrib( nPara, EE_PARA_BULLETSTATE ) ); - bool bBulletIsVisible = aBulletState.GetValue(); - // just toggling EE_PARA_BULLETSTATE should be fine for both cases... - aBulletState.SetValue( !bBulletIsVisible ); - SfxItemSet aSet( pImpEditEngine->GetParaAttribs( nPara ) ); - aSet.Put( aBulletState ); - pImpEditEngine->SetParaAttribs( nPara, aSet ); + if ( aBulletState.GetValue() ) + { + + aBulletState.SetValue( false ); + SfxItemSet aSet( pImpEditEngine->GetParaAttribs( nPara ) ); + aSet.Put( aBulletState ); + pImpEditEngine->SetParaAttribs( nPara, aSet ); - // have this and the following paragraphs formatted and repainted. - // (not painting a numbering in the list may cause the following - // numberings to have different numbers than before and thus the - // length may have changed as well ) - pImpEditEngine->FormatAndUpdate( pImpEditEngine->GetActiveView() ); + // have this and the following paragraphs formatted and repainted. + // (not painting a numbering in the list may cause the following + // numberings to have different numbers than before and thus the + // length may have changed as well ) + pImpEditEngine->FormatAndUpdate( pImpEditEngine->GetActiveView() ); - if (bBulletIsVisible) // bullet just turned invisible... break; + } } sal_uInt8 nDel = 0; |