[Libreoffice-commits] core.git: include/sfx2 sc/source sfx2/source

Marco Cecchetti marco.cecchetti at collabora.com
Tue May 16 09:30:58 UTC 2017


 include/sfx2/viewsh.hxx        |    2 ++
 sc/source/ui/inc/tabvwsh.hxx   |    2 ++
 sc/source/ui/view/tabvwshc.cxx |    5 +++++
 sfx2/source/view/viewsh.cxx    |    6 ++++++
 4 files changed, 15 insertions(+)

New commits:
commit dd881805bf5cc5ec99314d02534ffeaf31de1cae
Author: Marco Cecchetti <marco.cecchetti at collabora.com>
Date:   Mon May 8 00:28:37 2017 +0200

    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

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
 {
 }


More information about the Libreoffice-commits mailing list