diff options
author | László Németh <nemeth@numbertext.org> | 2021-01-04 14:05:46 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2021-01-05 19:32:14 +0100 |
commit | aecb7364713871ce068effdb59a5da68ab4b2e53 (patch) | |
tree | 4d614a660238536f81ffef03d188c1f09d6fc3f6 /sw/source/core/edit/acorrect.cxx | |
parent | 8000c2b4bbba1448d5c438eca4b29160ba650437 (diff) |
tdf#106380 sw AutoCorrect: track deletion at capitalization
Deletion of the original lowercase character wasn't
tracked during sentence capitalization, resulting broken
change tracking data.
Note: for similar potential problems, see FIXME at the
end of DocumentContentOperationsManager::Overwrite().
Change-Id: If6ddbb77675d87eb126f7d3bf554b529892b88d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108670
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/core/edit/acorrect.cxx')
-rw-r--r-- | sw/source/core/edit/acorrect.cxx | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx index a45f1a7de11c..1a5ffe5ca762 100644 --- a/sw/source/core/edit/acorrect.cxx +++ b/sw/source/core/edit/acorrect.cxx @@ -259,17 +259,12 @@ bool SwAutoCorrDoc::ReplaceRange( sal_Int32 nPos, sal_Int32 nSourceLength, const } else { - if( nSourceLength != rText.getLength() ) - { - pPam->SetMark(); - pPam->GetPoint()->nContent = std::min<sal_Int32>( - pos.first->GetText().getLength(), pos.second + nSourceLength); - pDoc->getIDocumentContentOperations().ReplaceRange( *pPam, rText, false ); - pPam->Exchange(); - pPam->DeleteMark(); - } - else - pDoc->getIDocumentContentOperations().Overwrite( *pPam, rText ); + pPam->SetMark(); + pPam->GetPoint()->nContent = std::min<sal_Int32>( + pos.first->GetText().getLength(), pos.second + nSourceLength); + pDoc->getIDocumentContentOperations().ReplaceRange( *pPam, rText, false ); + pPam->Exchange(); + pPam->DeleteMark(); } if( m_bUndoIdInitialized ) |