summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorBaole Fang <baole.fang@gmail.com>2023-04-29 20:37:03 -0400
committerMike Kaganski <mike.kaganski@collabora.com>2023-06-02 11:41:52 +0200
commit083975f9666e3dc6fd665dc0418e6c3130628359 (patch)
treec93d70282acc797c653b6298ed0a274535719cfe /sw/source
parent845054aa25b7cba1daa1ff30b142d549027299bd (diff)
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.kaganski@collabora.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/edit/autofmt.cxx7
1 files changed, 6 insertions, 1 deletions
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 )