From 7aa6e5ce82eaca64f666b9fc6c0351bfd55d376a Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Mon, 12 Sep 2016 16:29:24 +0200 Subject: tdf#102065 Notebookbar: Menu bar disappears when cancelling dialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I6f83248eddfc279fe69f0f9c1d64d6b453bb1d3e Reviewed-on: https://gerrit.libreoffice.org/28843 Tested-by: Jenkins Reviewed-by: Szymon Kłos --- sfx2/source/notebookbar/SfxNotebookBar.cxx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'sfx2') diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx index e12beadc2886..e103d69073b3 100644 --- a/sfx2/source/notebookbar/SfxNotebookBar.cxx +++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx @@ -199,7 +199,23 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow, RemoveListeners(pSysWindow); OUString sFile = officecfg::Office::UI::Notebookbar::Active::get(); - if ( !sFile.isEmpty() ) + OUString sNewFile = rUIFile + sFile; + OUString sCurrentFile; + if ( pSysWindow->GetNotebookBar() ) + sCurrentFile = OStringToOUString( pSysWindow->GetNotebookBar()->getUIFile(), RTL_TEXTENCODING_ASCII_US ); + + bool bChangedFile = true; + if ( sCurrentFile.getLength() && sNewFile.getLength() ) + { + // delete "/" + sCurrentFile = sCurrentFile.copy( 0, sCurrentFile.getLength() - 1 ); + // delete ".ui" + sNewFile = sNewFile.copy( 0, sNewFile.getLength() - 3 ); + + bChangedFile = ( sNewFile.compareTo( sCurrentFile ) != 0 ); + } + + if ( !sFile.isEmpty() && bChangedFile ) { OUStringBuffer aBuf(rUIFile); aBuf.append( sFile ); -- cgit