summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/extinput.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/doc/extinput.cxx')
-rw-r--r--sw/source/core/doc/extinput.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/sw/source/core/doc/extinput.cxx b/sw/source/core/doc/extinput.cxx
index 9f60ec1fabcf..6c3cf951fa72 100644
--- a/sw/source/core/doc/extinput.cxx
+++ b/sw/source/core/doc/extinput.cxx
@@ -59,7 +59,12 @@ SwExtTextInput::~SwExtTextInput()
{
// Prevent IME edited text being grouped with non-IME edited text.
bool bKeepGroupUndo = pDoc->GetIDocumentUndoRedo().DoesGroupUndo();
- pDoc->GetIDocumentUndoRedo().DoGroupUndo(false);
+ bool bWasIME = pDoc->GetIDocumentUndoRedo().GetUndoActionCount() == 0 || pDoc->getIDocumentContentOperations().GetIME();
+ if (!bWasIME)
+ {
+ pDoc->GetIDocumentUndoRedo().DoGroupUndo(false);
+ }
+ pDoc->getIDocumentContentOperations().SetIME(true);
if( nEndCnt < nSttCnt )
{
std::swap(nSttCnt, nEndCnt);
@@ -117,7 +122,10 @@ SwExtTextInput::~SwExtTextInput()
pTNd->EraseText( rIdx, nLenghtOfOldString );
}
- pDoc->GetIDocumentUndoRedo().DoGroupUndo(bKeepGroupUndo);
+ if (!bWasIME)
+ {
+ pDoc->GetIDocumentUndoRedo().DoGroupUndo(bKeepGroupUndo);
+ }
if (eInputLanguage != LANGUAGE_DONTKNOW)
{
sal_uInt16 nWhich = RES_CHRATR_LANGUAGE;