Kaydet (Commit) a2765c02 authored tarafından Szymon Kłos's avatar Szymon Kłos

Notebookbar: fixed context handling

After last changes context switching was not working.
Removed unnecessary Resize call to avoid flickering.

Change-Id: I7931f4d442737c704c41bb7944c6d95e45b964f7
Reviewed-on: https://gerrit.libreoffice.org/29411Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarSzymon Kłos <eszkadev@gmail.com>
üst 74b2cc60
...@@ -30,8 +30,6 @@ public: ...@@ -30,8 +30,6 @@ public:
void SetIconClickHdl(Link<NotebookBar*, void> aHdl); void SetIconClickHdl(Link<NotebookBar*, void> aHdl);
virtual void StateChanged(StateChangedType nType) override;
const css::uno::Reference<css::ui::XContextChangeEventListener>& getContextChangeEventListener() const { return m_pEventListener; } const css::uno::Reference<css::ui::XContextChangeEventListener>& getContextChangeEventListener() const { return m_pEventListener; }
private: private:
css::uno::Reference<css::ui::XContextChangeEventListener> m_pEventListener; css::uno::Reference<css::ui::XContextChangeEventListener> m_pEventListener;
......
...@@ -252,8 +252,6 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow, ...@@ -252,8 +252,6 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow,
if (IsActive()) if (IsActive())
{ {
RemoveListeners(pSysWindow);
const Reference<frame::XModuleManager> xModuleManager = frame::ModuleManager::create( ::comphelper::getProcessComponentContext() ); const Reference<frame::XModuleManager> xModuleManager = frame::ModuleManager::create( ::comphelper::getProcessComponentContext() );
vcl::EnumContext::Application eApp = vcl::EnumContext::GetApplicationEnum(xModuleManager->identify(xFrame)); vcl::EnumContext::Application eApp = vcl::EnumContext::GetApplicationEnum(xModuleManager->identify(xFrame));
OUString sFile = lcl_getNotebookbarFileName( eApp ); OUString sFile = lcl_getNotebookbarFileName( eApp );
...@@ -275,6 +273,8 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow, ...@@ -275,6 +273,8 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow,
if ( ( !sFile.isEmpty() && bChangedFile ) || !pSysWindow->GetNotebookBar()->IsVisible() ) if ( ( !sFile.isEmpty() && bChangedFile ) || !pSysWindow->GetNotebookBar()->IsVisible() )
{ {
RemoveListeners(pSysWindow);
OUStringBuffer aBuf(rUIFile); OUStringBuffer aBuf(rUIFile);
aBuf.append( sFile ); aBuf.append( sFile );
......
...@@ -99,17 +99,6 @@ void NotebookBar::SetIconClickHdl(Link<NotebookBar*, void> aHdl) ...@@ -99,17 +99,6 @@ void NotebookBar::SetIconClickHdl(Link<NotebookBar*, void> aHdl)
m_pContextContainer->SetIconClickHdl(aHdl); m_pContextContainer->SetIconClickHdl(aHdl);
} }
void NotebookBar::StateChanged(StateChangedType nType)
{
if (nType == StateChangedType::Visible)
{
// visibility changed, update the container
GetParent()->Resize();
}
Control::StateChanged(nType);
}
void SAL_CALL NotebookBarContextChangeEventListener::notifyContextChangeEvent(const css::ui::ContextChangeEventObject& rEvent) void SAL_CALL NotebookBarContextChangeEventListener::notifyContextChangeEvent(const css::ui::ContextChangeEventObject& rEvent)
throw (css::uno::RuntimeException, std::exception) throw (css::uno::RuntimeException, std::exception)
{ {
......
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