summaryrefslogtreecommitdiffstats
path: root/sw/source/uibase/docvw
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 09:27:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 09:27:30 +0000
commita2baea7faff31d26459dab3668a39eae85e4991b (patch)
treeeaa2048ce9c715481f932dcfe20368e252b77d2f /sw/source/uibase/docvw
parentAdding upstream version 4:24.2.0. (diff)
downloadlibreoffice-58b4fd97d4526c3e8a75ace3a6be15d2f53c6dcf.tar.xz
libreoffice-58b4fd97d4526c3e8a75ace3a6be15d2f53c6dcf.zip
Adding upstream version 4:24.2.1.upstream/4%24.2.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sw/source/uibase/docvw')
-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);
+ }
}
}
}