summaryrefslogtreecommitdiffstats
path: root/editeng
diff options
context:
space:
mode:
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/editeng.cxx9
-rw-r--r--editeng/source/editeng/editview.cxx2
-rw-r--r--editeng/source/editeng/impedit3.cxx6
-rw-r--r--editeng/source/outliner/outliner.cxx7
4 files changed, 14 insertions, 10 deletions
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 9871e502316f..5a6aee022a80 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1449,11 +1449,14 @@ sal_uInt32 EditEngine::CalcTextWidth()
return nWidth;
}
-void EditEngine::SetUpdateMode( bool bUpdate )
+void EditEngine::SetUpdateMode(bool bUpdate, bool bRestoring)
{
pImpEditEngine->SetUpdateMode( bUpdate );
- if ( pImpEditEngine->pActiveView )
- pImpEditEngine->pActiveView->ShowCursor( false, false, /*bActivate=*/true );
+ if (pImpEditEngine->pActiveView)
+ {
+ // Not an activation if we are restoring the previous update mode.
+ pImpEditEngine->pActiveView->ShowCursor(false, false, /*bActivate=*/!bRestoring);
+ }
}
bool EditEngine::GetUpdateMode() const
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 315f9ef6716f..3848553cf4d9 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -482,7 +482,7 @@ void EditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor, bool bActivat
if (pParent && pParent->GetLOKWindowId() != 0)
return;
- OString aPayload = OString::boolean(true);
+ static const OString aPayload = OString::boolean(true);
pImpEditView->mpViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_CURSOR_VISIBLE, aPayload.getStr());
pImpEditView->mpViewShell->NotifyOtherViews(LOK_CALLBACK_VIEW_CURSOR_VISIBLE, "visible", aPayload);
}
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 6ec2a6152ee6..05ab3ccf6823 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -3939,12 +3939,12 @@ EditPaM ImpEditEngine::ConnectContents( sal_Int32 nLeftNode, bool bBackward )
void ImpEditEngine::SetUpdateMode( bool bUp, EditView* pCurView, bool bForceUpdate )
{
- bool bChanged = ( GetUpdateMode() != bUp );
+ const bool bChanged = (GetUpdateMode() != bUp);
- // When switching from sal_True to sal_False, all selections were visible,
+ // When switching from true to false, all selections were visible,
// => paint over
// the other hand, were all invisible => paint
- // If !bFormatted, e.g. after SetText, then if UpdateMode=sal_True
+ // If !bFormatted, e.g. after SetText, then if UpdateMode=true
// formatting is not needed immediately, probably because more text is coming.
// At latest it is formatted at a Paint/CalcTextWidth.
bUpdate = bUp;
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 072851d2702f..f7f8cc316ad1 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -399,7 +399,7 @@ void Outliner::SetText( const OUString& rText, Paragraph* pPara )
{
DBG_ASSERT(pPara,"SetText:No Para");
- sal_Int32 nPara = pParaList->GetAbsPos( pPara );
+ const sal_Int32 nPara = pParaList->GetAbsPos( pPara );
if (pEditEngine->GetText( nPara ) == rText)
{
@@ -408,7 +408,7 @@ void Outliner::SetText( const OUString& rText, Paragraph* pPara )
return;
}
- bool bUpdate = pEditEngine->GetUpdateMode();
+ const bool bUpdate = pEditEngine->GetUpdateMode();
pEditEngine->SetUpdateMode( false );
ImplBlockInsertionCallbacks( true );
@@ -482,7 +482,8 @@ void Outliner::SetText( const OUString& rText, Paragraph* pPara )
DBG_ASSERT(pParaList->GetParagraphCount()==pEditEngine->GetParagraphCount(),"SetText failed!");
bFirstParaIsEmpty = false;
ImplBlockInsertionCallbacks( false );
- pEditEngine->SetUpdateMode( bUpdate );
+ // Restore the update mode.
+ pEditEngine->SetUpdateMode(bUpdate, /*bRestoring=*/true);
}
// pView == 0 -> Ignore tabs