diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2017-05-08 00:28:37 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2017-05-16 11:28:24 +0200 |
commit | dd881805bf5cc5ec99314d02534ffeaf31de1cae (patch) | |
tree | 386cd256867f7ec527fee38a989302cb42260702 | |
parent | 32be55414da2af0ea796a57c7f15d18a3fd756cb (diff) |
lok: sc: address and formula text field empty on creating a new view
When the client starts the address and formula text field were empty
because the updating callbacks occurred before the view callback
handler had been registered.
So a new method `afterCallbackRegistered` has been added in order to
perform any needed updating/initialization soon after the view
callback handler has been registered.
Change-Id: Ia47234e32796f7e4bc1a8408736102054b4666e2
-rw-r--r-- | include/sfx2/viewsh.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/inc/tabvwsh.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwshc.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 6 |
4 files changed, 15 insertions, 0 deletions
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx index 3e276546aa94..a6dd243da4d7 100644 --- a/include/sfx2/viewsh.hxx +++ b/include/sfx2/viewsh.hxx @@ -338,6 +338,8 @@ public: void NotifyOtherView(OutlinerViewShell* pOtherShell, int nType, const OString& rKey, const OString& rPayload) override; /// Ask this view to send its cursor position to pViewShell. virtual void NotifyCursor(SfxViewShell* /*pViewShell*/) const; + /// Where a new view can perform some update/initialization soon after the callback has been registered. + virtual void afterCallbackRegistered(); }; diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index 08aeaaf85929..c08e4ee2a08f 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -390,6 +390,8 @@ public: void SetForceFocusOnCurCell(bool bFlag) { bForceFocusOnCurCell=bFlag; } /// See SfxViewShell::getPart(). int getPart() const override; + /// See SfxViewShell::afterCallbackRegistered(). + void afterCallbackRegistered() override; /// See SfxViewShell::NotifyCursor(). void NotifyCursor(SfxViewShell* pViewShell) const override; }; diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index 5ac562612ed3..20d02dd9a1ea 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -511,6 +511,11 @@ int ScTabViewShell::getPart() const return GetViewData().GetTabNo(); } +void ScTabViewShell::afterCallbackRegistered() +{ + UpdateInputHandler(true, false); +} + void ScTabViewShell::NotifyCursor(SfxViewShell* pOtherShell) const { ScDrawView* pDrView = const_cast<ScTabViewShell*>(this)->GetScDrawView(); diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index d8486f336dc9..8fc744e5c033 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1436,6 +1436,8 @@ void SfxViewShell::registerLibreOfficeKitViewCallback(LibreOfficeKitCallback pCa pImpl->m_pLibreOfficeKitViewCallback = pCallback; pImpl->m_pLibreOfficeKitViewData = pData; + afterCallbackRegistered(); + // Ask other views to tell us about their cursors. SfxViewShell* pViewShell = SfxViewShell::GetFirst(); while (pViewShell) @@ -1468,6 +1470,10 @@ void SfxViewShell::libreOfficeKitViewCallback(int nType, const char* pPayload) c pImpl->m_pLibreOfficeKitViewCallback(nType, pPayload, pImpl->m_pLibreOfficeKitViewData); } +void SfxViewShell::afterCallbackRegistered() +{ +} + void SfxViewShell::NotifyCursor(SfxViewShell* /*pViewShell*/) const { } |