diff options
author | Szymon Kłos <eszkadev@gmail.com> | 2016-10-06 21:17:42 +0200 |
---|---|---|
committer | Szymon Kłos <eszkadev@gmail.com> | 2016-10-06 21:11:09 +0000 |
commit | 2796291bd84eeb71115f3d9fb3b8aec67c4f4214 (patch) | |
tree | b8a20de62ffff207c653ac6ef590d523390dee04 /sfx2 | |
parent | a5442b696697e4a24566b1f5b7e5c9bc77a9fd03 (diff) |
tdf#102776 : fixed Notebookbar hiding
Change-Id: I86cdf2aa9fd5167073da215f5baf50bb4f64f4dd
Reviewed-on: https://gerrit.libreoffice.org/29579
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Szymon Kłos <eszkadev@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/notebookbar/SfxNotebookBar.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx index 282a168a3256..182b70aee2ae 100644 --- a/sfx2/source/notebookbar/SfxNotebookBar.cxx +++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx @@ -258,8 +258,9 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow, OUString sFile = lcl_getNotebookbarFileName( eApp ); OUString sNewFile = rUIFile + sFile; OUString sCurrentFile; - if ( pSysWindow->GetNotebookBar() ) - sCurrentFile = OStringToOUString( pSysWindow->GetNotebookBar()->getUIFile(), RTL_TEXTENCODING_ASCII_US ); + NotebookBar* pNotebookBar = pSysWindow->GetNotebookBar(); + if ( pNotebookBar ) + sCurrentFile = OStringToOUString( pNotebookBar->getUIFile(), RTL_TEXTENCODING_ASCII_US ); bool bChangedFile = true; if ( sCurrentFile.getLength() && sNewFile.getLength() ) @@ -272,7 +273,7 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow, bChangedFile = ( sNewFile.compareTo( sCurrentFile ) != 0 ); } - if ( ( !sFile.isEmpty() && bChangedFile ) || !pSysWindow->GetNotebookBar()->IsVisible() ) + if ( ( !sFile.isEmpty() && bChangedFile ) || !pNotebookBar || !pNotebookBar->IsVisible() ) { RemoveListeners(pSysWindow); @@ -281,8 +282,10 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow, // setup if necessary pSysWindow->SetNotebookBar(aBuf.makeStringAndClear(), xFrame); - pSysWindow->GetNotebookBar()->Show(); - pSysWindow->GetNotebookBar()->SetIconClickHdl(LINK(nullptr, SfxNotebookBar, OpenNotebookbarPopupMenu)); + pNotebookBar = pSysWindow->GetNotebookBar(); + pNotebookBar->Show(); + pNotebookBar->GetParent()->Resize(); + pNotebookBar->SetIconClickHdl( LINK( nullptr, SfxNotebookBar, OpenNotebookbarPopupMenu ) ); utl::OConfigurationTreeRoot aRoot; const utl::OConfigurationNode aModeNode( lcl_getCurrentImplConfigNode( xFrame, aRoot ) ); @@ -299,7 +302,7 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow, if(xFrame.is() && xMultiplexer.is()) { xMultiplexer->addContextChangeEventListener( - pSysWindow->GetNotebookBar()->getContextChangeEventListener(), + pNotebookBar->getContextChangeEventListener(), xFrame->getController()); } } @@ -310,6 +313,7 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow, else if (auto pNotebookBar = pSysWindow->GetNotebookBar()) { pNotebookBar->Hide(); + pNotebookBar->GetParent()->Resize(); SfxNotebookBar::ShowMenubar(true); } |