summaryrefslogtreecommitdiffstats
path: root/sw/source/uibase/docvw/edtwin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/uibase/docvw/edtwin.cxx')
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx63
1 files changed, 40 insertions, 23 deletions
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 322928eb4e..073b6b5964 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -896,6 +896,25 @@ void SwEditWin::FlushInBuffer()
return;
SwWrtShell& rSh = m_rView.GetWrtShell();
+ uno::Reference<frame::XDispatchRecorder> xRecorder
+ = m_rView.GetViewFrame().GetBindings().GetRecorder();
+
+ comphelper::ScopeGuard showTooltipGuard(
+ [this, &rSh]
+ {
+ SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get();
+ const bool bAutoTextShown
+ = rACfg.IsAutoTextTip() && ShowAutoText(rSh.GetChunkForAutoText());
+ if (!bAutoTextShown)
+ {
+ SvxAutoCorrect* pACorr = rACfg.GetAutoCorrect();
+ if (pACorr && pACorr->GetSwFlags().bAutoCompleteWords)
+ ShowAutoCorrectQuickHelp(rSh.GetPrevAutoCorrWord(*pACorr), *pACorr);
+ }
+ });
+ if (!m_bMaybeShowTooltipAfterBufferFlush || xRecorder)
+ showTooltipGuard.dismiss();
+ m_bMaybeShowTooltipAfterBufferFlush = false;
// generate new sequence input checker if not already done
if ( !pCheckIt )
@@ -993,8 +1012,6 @@ void SwEditWin::FlushInBuffer()
}
}
- uno::Reference< frame::XDispatchRecorder > xRecorder =
- m_rView.GetViewFrame().GetBindings().GetRecorder();
if ( xRecorder.is() )
{
// determine shell
@@ -1381,6 +1398,9 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
}
}
+ // Do not show autotext / word completion tooltips in intermediate flushes
+ m_bMaybeShowTooltipAfterBufferFlush = false;
+
sal_uInt16 nKey = rKEvt.GetKeyCode().GetCode();
if (nKey == KEY_ESCAPE)
@@ -2821,19 +2841,12 @@ KEYINPUT_CHECKTABLE_INSDEL:
if( KEY_UP == nKey || KEY_DOWN == nKey || KEY_PAGEUP == nKey || KEY_PAGEDOWN == nKey )
GetView().GetViewFrame().GetBindings().Update( FN_STAT_PAGE );
+ m_bMaybeShowTooltipAfterBufferFlush = bNormalChar;
+
// in case the buffered characters are inserted
if( bFlushBuffer && !m_aInBuffer.isEmpty() )
{
FlushInBuffer();
-
- // maybe show Tip-Help
- if (bNormalChar)
- {
- const bool bAutoTextShown
- = pACfg && pACfg->IsAutoTextTip() && ShowAutoText(rSh.GetChunkForAutoText());
- if (!bAutoTextShown && pACorr && pACorr->GetSwFlags().bAutoCompleteWords)
- ShowAutoCorrectQuickHelp(rSh.GetPrevAutoCorrWord(*pACorr), *pACorr);
- }
}
// get the word count dialog to update itself
@@ -4662,19 +4675,23 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
SdrObject* pObj = pSdrView ? pSdrView->PickObj(aDocPos, pSdrView->getHitTolLog(), pPV, SdrSearchOptions::ALSOONMASTER) : nullptr;
if (pObj)
{
- SwFrameFormat* pFormat = GetUserCall(pObj)->GetFormat();
- SwFrameFormat* pShapeFormat = SwTextBoxHelper::getOtherTextBoxFormat(pFormat, RES_FLYFRMFMT);
- if (!pShapeFormat)
- {
- pSdrView->UnmarkAllObj();
- pSdrView->MarkObj(pObj,pPV);
- }
- else
+ if (SwDrawContact* pContact = static_cast<SwDrawContact*>(GetUserCall(pObj)))
{
- // If the fly frame is a textbox of a shape, then select the shape instead.
- SdrObject* pShape = pShapeFormat->FindSdrObject();
- pSdrView->UnmarkAllObj();
- pSdrView->MarkObj(pShape, pPV);
+ SwFrameFormat* pFormat = pContact->GetFormat();
+ SwFrameFormat* pShapeFormat
+ = SwTextBoxHelper::getOtherTextBoxFormat(pFormat, RES_FLYFRMFMT);
+ if (!pShapeFormat)
+ {
+ pSdrView->UnmarkAllObj();
+ pSdrView->MarkObj(pObj, pPV);
+ }
+ else
+ {
+ // If the fly frame is a textbox of a shape, then select the shape instead.
+ SdrObject* pShape = pShapeFormat->FindSdrObject();
+ pSdrView->UnmarkAllObj();
+ pSdrView->MarkObj(pShape, pPV);
+ }
}
}
}