diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-11-14 17:24:18 +0000 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-11-15 11:08:06 +0100 |
commit | c0df28f957b43f0ecbffdc994ee0702dbe5bc33f (patch) | |
tree | fa0480a617555b03ef1771276455dbe1b5c06399 /sc/source/ui/inc | |
parent | 47d824dd167eb34b08e5aec7141d2d9e6e996b34 (diff) |
merge duplicate formula bar updates in close time proximity
We get three updates per keystroke, StartExtTextInput, ExtTextInput and
PostExtTextInput. Skip duplicate updates. Be conservative and don't
skip duplicates that are 5+ seconds apart.
Change-Id: I501bff4193528fa9263d296700d64e2f60b52222
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159433
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sc/source/ui/inc')
-rw-r--r-- | sc/source/ui/inc/inputhdl.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/inc/tabvwsh.hxx | 20 |
2 files changed, 19 insertions, 3 deletions
diff --git a/sc/source/ui/inc/inputhdl.hxx b/sc/source/ui/inc/inputhdl.hxx index 90a562f6c11f..3067dd819397 100644 --- a/sc/source/ui/inc/inputhdl.hxx +++ b/sc/source/ui/inc/inputhdl.hxx @@ -295,8 +295,6 @@ public: tools::Long nTab, const Color& rColor ); void LOKPasteFunctionData(const OUString& rFunctionName); - static void LOKSendFormulabarUpdate(EditView* pEditView, const SfxViewShell* pActiveViewSh, - const OUString& rText, const ESelection& rSelection); }; // ScInputHdlState diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index 53b093695297..cc52a84f8354 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -91,9 +91,26 @@ enum ObjectSelectionType }; class ScFormEditData; -class SC_DLLPUBLIC ScTabViewShell: public SfxViewShell, public ScDBFunc +class SC_DLLPUBLIC ScTabViewShell : public SfxViewShell, public ScDBFunc { private: + struct SendFormulabarUpdate + { + OUString m_aText; + OUString m_aSelection; + sal_uInt64 m_nShellId; + std::chrono::steady_clock::time_point m_nTimeStamp; + + SendFormulabarUpdate() + : m_nShellId(0) + { + } + + void Send(); + }; + + SendFormulabarUpdate maSendFormulabarUpdate; + ObjectSelectionType eCurOST; sal_uInt16 nDrawSfxId; SdrObjKind eFormObjKind; @@ -405,6 +422,7 @@ public: /// is equal to nCurrentTabIndex static void notifyAllViewsSheetGeomInvalidation(const SfxViewShell* pForViewShell, bool bColumns, bool bRows, bool bSizes, bool bHidden, bool bFiltered, bool bGroups, SCTAB nCurrentTabIndex); + void LOKSendFormulabarUpdate(EditView* pEditView, const OUString& rText, const ESelection& rSelection); css::uno::Reference<css::drawing::XShapes> getSelectedXShapes(); static css::uno::Reference<css::datatransfer::XTransferable2> GetClipData(vcl::Window* pWin); |