Kaydet (Commit) dd881805 authored tarafından Marco Cecchetti's avatar Marco Cecchetti Kaydeden (comit) Jan Holesovsky

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
üst 32be5541
......@@ -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();
};
......
......@@ -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;
};
......
......@@ -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();
......
......@@ -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
{
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment