sw/source/core/edit/autofmt.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
New commits: commit 083975f9666e3dc6fd665dc0418e6c3130628359 Author: Baole Fang <baole.f...@gmail.com> AuthorDate: Sat Apr 29 20:37:03 2023 -0400 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Fri Jun 2 11:41:52 2023 +0200 tdf#90507: Prevent changing default style in AutoCorrect Change-Id: I3bc7d99daf49ff32d9d80fcbbb7538cc036bc279 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151213 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index f8bcfebe9875..2c9eb69ac16a 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -1433,7 +1433,6 @@ void SwAutoFormat::BuildText() bBreak = !IsFastFullLine(*m_pCurTextFrame) || IsBlanksInString(*m_pCurTextFrame) || IsSentenceAtEnd(*m_pCurTextFrame); - SetColl( RES_POOLCOLL_TEXT, true ); if( !bBreak ) { SetRedlineText( STR_AUTOFMTREDL_DEL_MORELINES ); @@ -2420,6 +2419,12 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFormatFlags aFlags, break; } + // replace custom styles with text body + if ( IsPoolUserFormat( nPoolId ) && m_aFlags.bChgUserColl ) + { + SetColl( RES_POOLCOLL_TEXT, true ); + } + // check for left margin set by the style if( IsPoolUserFormat( nPoolId ) || RES_POOLCOLL_STANDARD == nPoolId )